mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 17:08:27 +00:00
Add baidu qianfan model provider
This commit is contained in:
@@ -10,6 +10,7 @@ import { buildTokenProfileId, validateAnthropicSetupToken } from "../../auth-tok
|
||||
import { applyGoogleGeminiModelDefault } from "../../google-gemini-model-default.js";
|
||||
import {
|
||||
applyAuthProfileConfig,
|
||||
applyQianfanConfig,
|
||||
applyKimiCodeConfig,
|
||||
applyMinimaxApiConfig,
|
||||
applyMinimaxConfig,
|
||||
@@ -22,6 +23,7 @@ import {
|
||||
applyXiaomiConfig,
|
||||
applyZaiConfig,
|
||||
setAnthropicApiKey,
|
||||
setQianfanApiKey,
|
||||
setGeminiApiKey,
|
||||
setKimiCodingApiKey,
|
||||
setMinimaxApiKey,
|
||||
@@ -214,6 +216,29 @@ export async function applyNonInteractiveAuthChoice(params: {
|
||||
return applyXiaomiConfig(nextConfig);
|
||||
}
|
||||
|
||||
if (authChoice === "qianfan-api-key") {
|
||||
const resolved = await resolveNonInteractiveApiKey({
|
||||
provider: "qianfan",
|
||||
cfg: baseConfig,
|
||||
flagValue: opts.qianfanApiKey,
|
||||
flagName: "--qianfan-api-key",
|
||||
envVar: "QIANFAN_API_KEY",
|
||||
runtime,
|
||||
});
|
||||
if (!resolved) {
|
||||
return null;
|
||||
}
|
||||
if (resolved.source !== "profile") {
|
||||
setQianfanApiKey(resolved.key);
|
||||
}
|
||||
nextConfig = applyAuthProfileConfig(nextConfig, {
|
||||
profileId: "qianfan:default",
|
||||
provider: "qianfan",
|
||||
mode: "api_key",
|
||||
});
|
||||
return applyQianfanConfig(nextConfig);
|
||||
}
|
||||
|
||||
if (authChoice === "openai-api-key") {
|
||||
const resolved = await resolveNonInteractiveApiKey({
|
||||
provider: "openai",
|
||||
|
||||
Reference in New Issue
Block a user