mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:10:49 +00:00
refactor: build deepseek catalog from manifest
This commit is contained in:
@@ -1,84 +1,15 @@
|
|||||||
|
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
||||||
import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
||||||
|
import manifest from "./openclaw.plugin.json" with { type: "json" };
|
||||||
|
|
||||||
export const DEEPSEEK_BASE_URL = "https://api.deepseek.com";
|
const DEEPSEEK_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
||||||
|
providerId: "deepseek",
|
||||||
|
catalog: manifest.modelCatalog.providers.deepseek,
|
||||||
|
});
|
||||||
|
|
||||||
// DeepSeek API pricing (per 1M tokens)
|
export const DEEPSEEK_BASE_URL = DEEPSEEK_MANIFEST_PROVIDER.baseUrl;
|
||||||
// https://api-docs.deepseek.com/quick_start/pricing
|
|
||||||
const DEEPSEEK_V3_2_COST = {
|
|
||||||
input: 0.28,
|
|
||||||
output: 0.42,
|
|
||||||
cacheRead: 0.028,
|
|
||||||
cacheWrite: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
const DEEPSEEK_V4_PRO_COST = {
|
export const DEEPSEEK_MODEL_CATALOG: ModelDefinitionConfig[] = DEEPSEEK_MANIFEST_PROVIDER.models;
|
||||||
input: 1.74,
|
|
||||||
output: 3.48,
|
|
||||||
cacheRead: 0.145,
|
|
||||||
cacheWrite: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
const DEEPSEEK_V4_FLASH_COST = {
|
|
||||||
input: 0.14,
|
|
||||||
output: 0.28,
|
|
||||||
cacheRead: 0.028,
|
|
||||||
cacheWrite: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const DEEPSEEK_MODEL_CATALOG: ModelDefinitionConfig[] = [
|
|
||||||
{
|
|
||||||
id: "deepseek-v4-flash",
|
|
||||||
name: "DeepSeek V4 Flash",
|
|
||||||
reasoning: true,
|
|
||||||
input: ["text"],
|
|
||||||
contextWindow: 1_000_000,
|
|
||||||
maxTokens: 384_000,
|
|
||||||
cost: DEEPSEEK_V4_FLASH_COST,
|
|
||||||
compat: {
|
|
||||||
supportsUsageInStreaming: true,
|
|
||||||
supportsReasoningEffort: true,
|
|
||||||
maxTokensField: "max_tokens",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "deepseek-v4-pro",
|
|
||||||
name: "DeepSeek V4 Pro",
|
|
||||||
reasoning: true,
|
|
||||||
input: ["text"],
|
|
||||||
contextWindow: 1_000_000,
|
|
||||||
maxTokens: 384_000,
|
|
||||||
cost: DEEPSEEK_V4_PRO_COST,
|
|
||||||
compat: {
|
|
||||||
supportsUsageInStreaming: true,
|
|
||||||
supportsReasoningEffort: true,
|
|
||||||
maxTokensField: "max_tokens",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "deepseek-chat",
|
|
||||||
name: "DeepSeek Chat",
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text"],
|
|
||||||
contextWindow: 131072,
|
|
||||||
maxTokens: 8192,
|
|
||||||
cost: DEEPSEEK_V3_2_COST,
|
|
||||||
compat: { supportsUsageInStreaming: true, maxTokensField: "max_tokens" },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "deepseek-reasoner",
|
|
||||||
name: "DeepSeek Reasoner",
|
|
||||||
reasoning: true,
|
|
||||||
input: ["text"],
|
|
||||||
contextWindow: 131072,
|
|
||||||
maxTokens: 65536,
|
|
||||||
cost: DEEPSEEK_V3_2_COST,
|
|
||||||
compat: {
|
|
||||||
supportsUsageInStreaming: true,
|
|
||||||
supportsReasoningEffort: false,
|
|
||||||
maxTokensField: "max_tokens",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export function buildDeepSeekModelDefinition(
|
export function buildDeepSeekModelDefinition(
|
||||||
model: (typeof DEEPSEEK_MODEL_CATALOG)[number],
|
model: (typeof DEEPSEEK_MODEL_CATALOG)[number],
|
||||||
|
|||||||
Reference in New Issue
Block a user