mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-models";
|
|
|
|
export const QIANFAN_BASE_URL = "https://qianfan.baidubce.com/v2";
|
|
export const QIANFAN_DEFAULT_MODEL_ID = "deepseek-v3.2";
|
|
const QIANFAN_DEFAULT_CONTEXT_WINDOW = 98304;
|
|
const QIANFAN_DEFAULT_MAX_TOKENS = 32768;
|
|
const QIANFAN_DEFAULT_COST = {
|
|
input: 0,
|
|
output: 0,
|
|
cacheRead: 0,
|
|
cacheWrite: 0,
|
|
};
|
|
|
|
export function buildQianfanProvider(): ModelProviderConfig {
|
|
return {
|
|
baseUrl: QIANFAN_BASE_URL,
|
|
api: "openai-completions",
|
|
models: [
|
|
{
|
|
id: QIANFAN_DEFAULT_MODEL_ID,
|
|
name: "DEEPSEEK V3.2",
|
|
reasoning: true,
|
|
input: ["text"],
|
|
cost: QIANFAN_DEFAULT_COST,
|
|
contextWindow: QIANFAN_DEFAULT_CONTEXT_WINDOW,
|
|
maxTokens: QIANFAN_DEFAULT_MAX_TOKENS,
|
|
},
|
|
{
|
|
id: "ernie-5.0-thinking-preview",
|
|
name: "ERNIE-5.0-Thinking-Preview",
|
|
reasoning: true,
|
|
input: ["text", "image"],
|
|
cost: QIANFAN_DEFAULT_COST,
|
|
contextWindow: 119000,
|
|
maxTokens: 64000,
|
|
},
|
|
],
|
|
};
|
|
}
|