mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:50:43 +00:00
Merged via squash.
Prepared head SHA: ef561a59de
Co-authored-by: ai-hpc <183861985+ai-hpc@users.noreply.github.com>
Co-authored-by: hxy91819 <8814856+hxy91819@users.noreply.github.com>
Reviewed-by: @hxy91819
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
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 DEEPSEEK_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
|
providerId: "deepseek",
|
|
catalog: manifest.modelCatalog.providers.deepseek,
|
|
});
|
|
|
|
export const DEEPSEEK_BASE_URL = DEEPSEEK_MANIFEST_PROVIDER.baseUrl;
|
|
|
|
export const DEEPSEEK_MODEL_CATALOG: ModelDefinitionConfig[] = DEEPSEEK_MANIFEST_PROVIDER.models;
|
|
|
|
export function buildDeepSeekModelDefinition(
|
|
model: (typeof DEEPSEEK_MODEL_CATALOG)[number],
|
|
): ModelDefinitionConfig {
|
|
return {
|
|
...model,
|
|
api: "openai-completions",
|
|
};
|
|
}
|
|
|
|
const DEEPSEEK_V4_MODEL_IDS = new Set(["deepseek-v4-flash", "deepseek-v4-pro"]);
|
|
|
|
export function isDeepSeekV4ModelId(modelId: string): boolean {
|
|
return DEEPSEEK_V4_MODEL_IDS.has(modelId.toLowerCase());
|
|
}
|
|
|
|
export function isDeepSeekV4ModelRef(model: { provider?: string; id?: unknown }): boolean {
|
|
return (
|
|
model.provider === "deepseek" && typeof model.id === "string" && isDeepSeekV4ModelId(model.id)
|
|
);
|
|
}
|