mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 17:18:25 +00:00
Merge branch 'main' into qianfan
This commit is contained in:
@@ -11,10 +11,12 @@ import { applyGoogleGeminiModelDefault } from "../../google-gemini-model-default
|
||||
import {
|
||||
applyAuthProfileConfig,
|
||||
applyQianfanConfig,
|
||||
applyCloudflareAiGatewayConfig,
|
||||
applyKimiCodeConfig,
|
||||
applyMinimaxApiConfig,
|
||||
applyMinimaxConfig,
|
||||
applyMoonshotConfig,
|
||||
applyMoonshotConfigCn,
|
||||
applyOpencodeZenConfig,
|
||||
applyOpenrouterConfig,
|
||||
applySyntheticConfig,
|
||||
@@ -24,6 +26,7 @@ import {
|
||||
applyZaiConfig,
|
||||
setAnthropicApiKey,
|
||||
setQianfanApiKey,
|
||||
setCloudflareAiGatewayConfig,
|
||||
setGeminiApiKey,
|
||||
setKimiCodingApiKey,
|
||||
setMinimaxApiKey,
|
||||
@@ -305,6 +308,44 @@ export async function applyNonInteractiveAuthChoice(params: {
|
||||
return applyVercelAiGatewayConfig(nextConfig);
|
||||
}
|
||||
|
||||
if (authChoice === "cloudflare-ai-gateway-api-key") {
|
||||
const accountId = opts.cloudflareAiGatewayAccountId?.trim() ?? "";
|
||||
const gatewayId = opts.cloudflareAiGatewayGatewayId?.trim() ?? "";
|
||||
if (!accountId || !gatewayId) {
|
||||
runtime.error(
|
||||
[
|
||||
'Auth choice "cloudflare-ai-gateway-api-key" requires Account ID and Gateway ID.',
|
||||
"Use --cloudflare-ai-gateway-account-id and --cloudflare-ai-gateway-gateway-id.",
|
||||
].join("\n"),
|
||||
);
|
||||
runtime.exit(1);
|
||||
return null;
|
||||
}
|
||||
const resolved = await resolveNonInteractiveApiKey({
|
||||
provider: "cloudflare-ai-gateway",
|
||||
cfg: baseConfig,
|
||||
flagValue: opts.cloudflareAiGatewayApiKey,
|
||||
flagName: "--cloudflare-ai-gateway-api-key",
|
||||
envVar: "CLOUDFLARE_AI_GATEWAY_API_KEY",
|
||||
runtime,
|
||||
});
|
||||
if (!resolved) {
|
||||
return null;
|
||||
}
|
||||
if (resolved.source !== "profile") {
|
||||
await setCloudflareAiGatewayConfig(accountId, gatewayId, resolved.key);
|
||||
}
|
||||
nextConfig = applyAuthProfileConfig(nextConfig, {
|
||||
profileId: "cloudflare-ai-gateway:default",
|
||||
provider: "cloudflare-ai-gateway",
|
||||
mode: "api_key",
|
||||
});
|
||||
return applyCloudflareAiGatewayConfig(nextConfig, {
|
||||
accountId,
|
||||
gatewayId,
|
||||
});
|
||||
}
|
||||
|
||||
if (authChoice === "moonshot-api-key") {
|
||||
const resolved = await resolveNonInteractiveApiKey({
|
||||
provider: "moonshot",
|
||||
@@ -328,6 +369,29 @@ export async function applyNonInteractiveAuthChoice(params: {
|
||||
return applyMoonshotConfig(nextConfig);
|
||||
}
|
||||
|
||||
if (authChoice === "moonshot-api-key-cn") {
|
||||
const resolved = await resolveNonInteractiveApiKey({
|
||||
provider: "moonshot",
|
||||
cfg: baseConfig,
|
||||
flagValue: opts.moonshotApiKey,
|
||||
flagName: "--moonshot-api-key",
|
||||
envVar: "MOONSHOT_API_KEY",
|
||||
runtime,
|
||||
});
|
||||
if (!resolved) {
|
||||
return null;
|
||||
}
|
||||
if (resolved.source !== "profile") {
|
||||
await setMoonshotApiKey(resolved.key);
|
||||
}
|
||||
nextConfig = applyAuthProfileConfig(nextConfig, {
|
||||
profileId: "moonshot:default",
|
||||
provider: "moonshot",
|
||||
mode: "api_key",
|
||||
});
|
||||
return applyMoonshotConfigCn(nextConfig);
|
||||
}
|
||||
|
||||
if (authChoice === "kimi-code-api-key") {
|
||||
const resolved = await resolveNonInteractiveApiKey({
|
||||
provider: "kimi-coding",
|
||||
|
||||
Reference in New Issue
Block a user