mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 22:04:31 +00:00
feat(volcengine): integrate Volcengine & Byteplus Provider
This commit is contained in:
committed by
Peter Steinberger
parent
95c14d9b5f
commit
559736a5a0
@@ -55,6 +55,7 @@ import {
|
||||
resolveCustomProviderId,
|
||||
} from "../../onboard-custom.js";
|
||||
import type { AuthChoice, OnboardOptions } from "../../onboard-types.js";
|
||||
import { applyPrimaryModel } from "../../model-picker.js";
|
||||
import { applyOpenAIConfig } from "../../openai-model-default.js";
|
||||
import { detectZaiEndpoint } from "../../zai-endpoint-detect.js";
|
||||
import { resolveNonInteractiveApiKey } from "../api-keys.js";
|
||||
@@ -303,6 +304,52 @@ export async function applyNonInteractiveAuthChoice(params: {
|
||||
return applyXaiConfig(nextConfig);
|
||||
}
|
||||
|
||||
if (authChoice === "volcengine-api-key") {
|
||||
const resolved = await resolveNonInteractiveApiKey({
|
||||
provider: "volcengine",
|
||||
cfg: baseConfig,
|
||||
flagValue: opts.volcengineApiKey,
|
||||
flagName: "--volcengine-api-key",
|
||||
envVar: "VOLCANO_ENGINE_API_KEY",
|
||||
runtime,
|
||||
});
|
||||
if (!resolved) {
|
||||
return null;
|
||||
}
|
||||
if (resolved.source !== "profile") {
|
||||
const result = upsertSharedEnvVar({
|
||||
key: "VOLCANO_ENGINE_API_KEY",
|
||||
value: resolved.key,
|
||||
});
|
||||
process.env.VOLCANO_ENGINE_API_KEY = resolved.key;
|
||||
runtime.log(`Saved VOLCANO_ENGINE_API_KEY to ${shortenHomePath(result.path)}`);
|
||||
}
|
||||
return applyPrimaryModel(nextConfig, "volcengine-plan/ark-code-latest");
|
||||
}
|
||||
|
||||
if (authChoice === "byteplus-api-key") {
|
||||
const resolved = await resolveNonInteractiveApiKey({
|
||||
provider: "byteplus",
|
||||
cfg: baseConfig,
|
||||
flagValue: opts.byteplusApiKey,
|
||||
flagName: "--byteplus-api-key",
|
||||
envVar: "BYTEPLUS_API_KEY",
|
||||
runtime,
|
||||
});
|
||||
if (!resolved) {
|
||||
return null;
|
||||
}
|
||||
if (resolved.source !== "profile") {
|
||||
const result = upsertSharedEnvVar({
|
||||
key: "BYTEPLUS_API_KEY",
|
||||
value: resolved.key,
|
||||
});
|
||||
process.env.BYTEPLUS_API_KEY = resolved.key;
|
||||
runtime.log(`Saved BYTEPLUS_API_KEY to ${shortenHomePath(result.path)}`);
|
||||
}
|
||||
return applyPrimaryModel(nextConfig, "byteplus-plan/ark-code-latest");
|
||||
}
|
||||
|
||||
if (authChoice === "qianfan-api-key") {
|
||||
const resolved = await resolveNonInteractiveApiKey({
|
||||
provider: "qianfan",
|
||||
|
||||
Reference in New Issue
Block a user