mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 19:38:28 +00:00
Add Synthetic provider support
This commit is contained in:
committed by
Peter Steinberger
parent
25297ce3f5
commit
8b5cd97ceb
@@ -43,14 +43,18 @@ import {
|
||||
applyMinimaxHostedConfig,
|
||||
applyMinimaxHostedProviderConfig,
|
||||
applyMinimaxProviderConfig,
|
||||
applySyntheticConfig,
|
||||
applySyntheticProviderConfig,
|
||||
applyOpencodeZenConfig,
|
||||
applyOpencodeZenProviderConfig,
|
||||
applyZaiConfig,
|
||||
MINIMAX_HOSTED_MODEL_REF,
|
||||
SYNTHETIC_DEFAULT_MODEL_REF,
|
||||
setAnthropicApiKey,
|
||||
setGeminiApiKey,
|
||||
setMinimaxApiKey,
|
||||
setOpencodeZenApiKey,
|
||||
setSyntheticApiKey,
|
||||
setZaiApiKey,
|
||||
writeOAuthCredentials,
|
||||
ZAI_DEFAULT_MODEL_REF,
|
||||
@@ -641,6 +645,28 @@ export async function applyAuthChoice(params: {
|
||||
agentModelOverride = ZAI_DEFAULT_MODEL_REF;
|
||||
await noteAgentModel(ZAI_DEFAULT_MODEL_REF);
|
||||
}
|
||||
} else if (params.authChoice === "synthetic-api-key") {
|
||||
const key = await params.prompter.text({
|
||||
message: "Enter Synthetic API key",
|
||||
validate: (value) => (value?.trim() ? undefined : "Required"),
|
||||
});
|
||||
await setSyntheticApiKey(String(key).trim(), params.agentDir);
|
||||
nextConfig = applyAuthProfileConfig(nextConfig, {
|
||||
profileId: "synthetic:default",
|
||||
provider: "synthetic",
|
||||
mode: "api_key",
|
||||
});
|
||||
if (params.setDefaultModel) {
|
||||
nextConfig = applySyntheticConfig(nextConfig);
|
||||
await params.prompter.note(
|
||||
`Default model set to ${SYNTHETIC_DEFAULT_MODEL_REF}`,
|
||||
"Model configured",
|
||||
);
|
||||
} else {
|
||||
nextConfig = applySyntheticProviderConfig(nextConfig);
|
||||
agentModelOverride = SYNTHETIC_DEFAULT_MODEL_REF;
|
||||
await noteAgentModel(SYNTHETIC_DEFAULT_MODEL_REF);
|
||||
}
|
||||
} else if (params.authChoice === "apiKey") {
|
||||
const key = await params.prompter.text({
|
||||
message: "Enter Anthropic API key",
|
||||
@@ -805,6 +831,8 @@ export function resolvePreferredProviderForAuthChoice(
|
||||
return "google";
|
||||
case "antigravity":
|
||||
return "google-antigravity";
|
||||
case "synthetic-api-key":
|
||||
return "synthetic";
|
||||
case "minimax-cloud":
|
||||
case "minimax-api":
|
||||
return "minimax";
|
||||
|
||||
Reference in New Issue
Block a user