mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 21:07:01 -06:00
89d6ce457c
* refactor(models): build provider catalogs as complete batches * refactor(models): decorate owned catalog rows in place
21 lines
956 B
TypeScript
21 lines
956 B
TypeScript
import { readManifestProviderDefaultModelRef } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
|
import manifest from "./openclaw.plugin.json" with { type: "json" };
|
|
import { buildMistralProvider } from "./provider-catalog.js";
|
|
|
|
const MISTRAL_MANIFEST_CATALOG = manifest.modelCatalog.providers.mistral;
|
|
|
|
export const MISTRAL_BASE_URL = MISTRAL_MANIFEST_CATALOG.baseUrl;
|
|
export const MISTRAL_DEFAULT_MODEL_REF = readManifestProviderDefaultModelRef(manifest, "mistral")!;
|
|
export const MISTRAL_DEFAULT_MODEL_ID = MISTRAL_DEFAULT_MODEL_REF.slice("mistral/".length);
|
|
|
|
export function buildMistralModelDefinition(): ModelDefinitionConfig {
|
|
const model = buildMistralProvider().models.find(
|
|
(entry) => entry.id === MISTRAL_DEFAULT_MODEL_ID,
|
|
);
|
|
if (!model) {
|
|
throw new Error(`Missing Mistral provider model ${MISTRAL_DEFAULT_MODEL_ID}`);
|
|
}
|
|
return model;
|
|
}
|