mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-16 14:11:37 +00:00
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
/**
|
|
* Meta model catalog helpers derived from the plugin manifest.
|
|
*/
|
|
import { buildManifestModelProviderConfig } 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 META_MANIFEST_CATALOG = manifest.modelCatalog.providers["meta"];
|
|
|
|
/** Base URL for Meta OpenAI-compatible inference. */
|
|
export const META_BASE_URL = META_MANIFEST_CATALOG.baseUrl;
|
|
/** Meta model catalog entries from the plugin manifest. */
|
|
export const META_MODEL_CATALOG = META_MANIFEST_CATALOG.models;
|
|
|
|
/** Builds normalized Meta catalog model definitions. */
|
|
export function buildMetaCatalogModels(): ModelDefinitionConfig[] {
|
|
return buildManifestModelProviderConfig({
|
|
providerId: "meta",
|
|
catalog: META_MANIFEST_CATALOG,
|
|
}).models;
|
|
}
|
|
|
|
/** Builds one normalized Meta model definition from a manifest entry. */
|
|
export function buildMetaModelDefinition(
|
|
model: (typeof META_MODEL_CATALOG)[number],
|
|
): ModelDefinitionConfig {
|
|
const providerConfig = buildManifestModelProviderConfig({
|
|
providerId: "meta",
|
|
catalog: { ...META_MANIFEST_CATALOG, models: [model] },
|
|
});
|
|
return providerConfig.models[0];
|
|
}
|