Files
openclaw/extensions/mistral/model-definitions.ts
Peter Steinberger be6ec97e11 refactor(providers): manifest-declared default models and unified onboarding presets (#113794)
* feat(model-catalog): declare provider default models

* refactor(providers): source onboarding defaults from manifests

* fix(cohere): remove unused model id export

* fix(chutes): preserve public default model id

* fix(model-catalog): accept provider default models
2026-07-25 12:54:53 -07:00

28 lines
1.1 KiB
TypeScript

import {
buildManifestModelProviderConfig,
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" };
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 = buildMistralCatalogModels().find((entry) => entry.id === MISTRAL_DEFAULT_MODEL_ID);
if (!model) {
throw new Error(`Missing Mistral provider model ${MISTRAL_DEFAULT_MODEL_ID}`);
}
return model;
}
function buildMistralCatalogModels(): ModelDefinitionConfig[] {
return buildManifestModelProviderConfig({
providerId: "mistral",
catalog: MISTRAL_MANIFEST_CATALOG,
}).models;
}