From 40a64a7c9228251cab662c508df5674ffc1d63ba Mon Sep 17 00:00:00 2001 From: MyPrototypeWhat Date: Wed, 19 Nov 2025 16:25:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(options):=20enhance=20provider=20key=20han?= =?UTF-8?q?dling=20for=20cherryin=20in=20buildPro=E2=80=A6=20(#11361)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat(options): enhance provider key handling for cherryin in buildProviderOptions function --- src/renderer/src/aiCore/utils/options.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/aiCore/utils/options.ts b/src/renderer/src/aiCore/utils/options.ts index 128a0f5269..eacb1b9e05 100644 --- a/src/renderer/src/aiCore/utils/options.ts +++ b/src/renderer/src/aiCore/utils/options.ts @@ -162,13 +162,17 @@ export function buildProviderOptions( ...getCustomParameters(assistant) } - const rawProviderKey = + let rawProviderKey = { 'google-vertex': 'google', 'google-vertex-anthropic': 'anthropic', 'ai-gateway': 'gateway' }[rawProviderId] || rawProviderId + if (rawProviderKey === 'cherryin') { + rawProviderKey = { gemini: 'google' }[actualProvider.type] || actualProvider.type + } + // 返回 AI Core SDK 要求的格式:{ 'providerId': providerOptions } return { [rawProviderKey]: providerSpecificOptions