From 6fe9a9eb4f96f2043736b358488a1b8cf27abee1 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Sat, 31 Jan 2026 04:45:58 +0000 Subject: [PATCH] feat(litellm): add flatten content option for auto_router compatibility LiteLLM's auto_router feature passes user content to embedding models for semantic routing. However, embedding models expect plain strings, not arrays of content blocks. This causes errors when Roo Code sends messages with array content format. This commit adds a new `litellmFlattenContent` option (enabled by default) that flattens array content to simple string format before sending to LiteLLM. Changes: - Add litellmFlattenContent option to provider-settings.ts schema - Add flattenMessageContent method to LiteLLMHandler - Apply flattening in createMessage when option is enabled (default: true) - Add UI checkbox in LiteLLM settings component - Add translations for all supported languages - Add comprehensive tests for the flattening logic Users who need multimodal content (images) can disable this option. Fixes #11132 --- packages/types/src/provider-settings.ts | 1 + src/api/providers/__tests__/lite-llm.spec.ts | 202 ++++++++++++++++++ src/api/providers/lite-llm.ts | 47 +++- .../components/settings/providers/LiteLLM.tsx | 14 ++ webview-ui/src/i18n/locales/ca/settings.json | 2 + webview-ui/src/i18n/locales/de/settings.json | 2 + webview-ui/src/i18n/locales/en/settings.json | 2 + webview-ui/src/i18n/locales/es/settings.json | 2 + webview-ui/src/i18n/locales/fr/settings.json | 2 + webview-ui/src/i18n/locales/hi/settings.json | 2 + webview-ui/src/i18n/locales/id/settings.json | 2 + webview-ui/src/i18n/locales/it/settings.json | 2 + webview-ui/src/i18n/locales/ja/settings.json | 2 + webview-ui/src/i18n/locales/ko/settings.json | 2 + webview-ui/src/i18n/locales/nl/settings.json | 2 + webview-ui/src/i18n/locales/pl/settings.json | 2 + .../src/i18n/locales/pt-BR/settings.json | 2 + webview-ui/src/i18n/locales/ru/settings.json | 2 + webview-ui/src/i18n/locales/tr/settings.json | 2 + webview-ui/src/i18n/locales/vi/settings.json | 2 + .../src/i18n/locales/zh-CN/settings.json | 2 + .../src/i18n/locales/zh-TW/settings.json | 2 + 22 files changed, 299 insertions(+), 1 deletion(-) diff --git a/packages/types/src/provider-settings.ts b/packages/types/src/provider-settings.ts index 0c5965f7ff6..f30634e5f10 100644 --- a/packages/types/src/provider-settings.ts +++ b/packages/types/src/provider-settings.ts @@ -367,6 +367,7 @@ const litellmSchema = baseProviderSettingsSchema.extend({ litellmApiKey: z.string().optional(), litellmModelId: z.string().optional(), litellmUsePromptCache: z.boolean().optional(), + litellmFlattenContent: z.boolean().optional(), }) const cerebrasSchema = apiModelIdProviderModelSchema.extend({ diff --git a/src/api/providers/__tests__/lite-llm.spec.ts b/src/api/providers/__tests__/lite-llm.spec.ts index 9f3a641cb3b..562ad119659 100644 --- a/src/api/providers/__tests__/lite-llm.spec.ts +++ b/src/api/providers/__tests__/lite-llm.spec.ts @@ -920,4 +920,206 @@ describe("LiteLLMHandler", () => { expect(id1).not.toBe(id2) }) }) + + describe("content flattening for auto_router compatibility", () => { + it("should flatten array content to string by default (when litellmFlattenContent is undefined)", async () => { + const systemPrompt = "You are a helpful assistant" + const messages: Anthropic.Messages.MessageParam[] = [ + { + role: "user", + content: [ + { type: "text", text: "Hello" }, + { type: "text", text: "World" }, + ], + }, + ] + + const mockStream = { + async *[Symbol.asyncIterator]() { + yield { + choices: [{ delta: { content: "Hi!" } }], + usage: { prompt_tokens: 10, completion_tokens: 5 }, + } + }, + } + + mockCreate.mockReturnValue({ + withResponse: vi.fn().mockResolvedValue({ data: mockStream }), + }) + + const generator = handler.createMessage(systemPrompt, messages) + for await (const _chunk of generator) { + // Consume + } + + const createCall = mockCreate.mock.calls[0][0] + const userMessage = createCall.messages.find((msg: any) => msg.role === "user") + + // Content should be flattened to a string + expect(typeof userMessage.content).toBe("string") + expect(userMessage.content).toBe("Hello\n\nWorld") + }) + + it("should flatten array content to string when litellmFlattenContent is true", async () => { + const optionsWithFlatten: ApiHandlerOptions = { + ...mockOptions, + litellmFlattenContent: true, + } + handler = new LiteLLMHandler(optionsWithFlatten) + + const systemPrompt = "You are a helpful assistant" + const messages: Anthropic.Messages.MessageParam[] = [ + { + role: "user", + content: [{ type: "text", text: "Single block" }], + }, + ] + + const mockStream = { + async *[Symbol.asyncIterator]() { + yield { + choices: [{ delta: { content: "Response" } }], + usage: { prompt_tokens: 10, completion_tokens: 5 }, + } + }, + } + + mockCreate.mockReturnValue({ + withResponse: vi.fn().mockResolvedValue({ data: mockStream }), + }) + + const generator = handler.createMessage(systemPrompt, messages) + for await (const _chunk of generator) { + // Consume + } + + const createCall = mockCreate.mock.calls[0][0] + const userMessage = createCall.messages.find((msg: any) => msg.role === "user") + + expect(typeof userMessage.content).toBe("string") + expect(userMessage.content).toBe("Single block") + }) + + it("should NOT flatten array content when litellmFlattenContent is false", async () => { + const optionsWithoutFlatten: ApiHandlerOptions = { + ...mockOptions, + litellmFlattenContent: false, + } + handler = new LiteLLMHandler(optionsWithoutFlatten) + + const systemPrompt = "You are a helpful assistant" + const messages: Anthropic.Messages.MessageParam[] = [ + { + role: "user", + content: [ + { type: "text", text: "Hello" }, + { type: "text", text: "World" }, + ], + }, + ] + + const mockStream = { + async *[Symbol.asyncIterator]() { + yield { + choices: [{ delta: { content: "Hi!" } }], + usage: { prompt_tokens: 10, completion_tokens: 5 }, + } + }, + } + + mockCreate.mockReturnValue({ + withResponse: vi.fn().mockResolvedValue({ data: mockStream }), + }) + + const generator = handler.createMessage(systemPrompt, messages) + for await (const _chunk of generator) { + // Consume + } + + const createCall = mockCreate.mock.calls[0][0] + const userMessage = createCall.messages.find((msg: any) => msg.role === "user") + + // Content should remain as array + expect(Array.isArray(userMessage.content)).toBe(true) + expect(userMessage.content).toHaveLength(2) + }) + + it("should preserve string content unchanged regardless of flatten setting", async () => { + const systemPrompt = "You are a helpful assistant" + const messages: Anthropic.Messages.MessageParam[] = [ + { + role: "user", + content: "Simple string message", + }, + ] + + const mockStream = { + async *[Symbol.asyncIterator]() { + yield { + choices: [{ delta: { content: "Response" } }], + usage: { prompt_tokens: 10, completion_tokens: 5 }, + } + }, + } + + mockCreate.mockReturnValue({ + withResponse: vi.fn().mockResolvedValue({ data: mockStream }), + }) + + const generator = handler.createMessage(systemPrompt, messages) + for await (const _chunk of generator) { + // Consume + } + + const createCall = mockCreate.mock.calls[0][0] + const userMessage = createCall.messages.find((msg: any) => msg.role === "user") + + expect(typeof userMessage.content).toBe("string") + expect(userMessage.content).toBe("Simple string message") + }) + + it("should NOT flatten array content if it contains non-text blocks (images)", async () => { + const systemPrompt = "You are a helpful assistant" + const messages: Anthropic.Messages.MessageParam[] = [ + { + role: "user", + content: [ + { type: "text", text: "Look at this image:" }, + { + type: "image", + source: { + type: "base64", + media_type: "image/png", + data: "iVBORw0KGgo=", + }, + }, + ], + }, + ] + + const mockStream = { + async *[Symbol.asyncIterator]() { + yield { + choices: [{ delta: { content: "I see..." } }], + usage: { prompt_tokens: 10, completion_tokens: 5 }, + } + }, + } + + mockCreate.mockReturnValue({ + withResponse: vi.fn().mockResolvedValue({ data: mockStream }), + }) + + const generator = handler.createMessage(systemPrompt, messages) + for await (const _chunk of generator) { + // Consume + } + + const createCall = mockCreate.mock.calls[0][0] + const userMessage = createCall.messages.find((msg: any) => msg.role === "user") + + // Content should remain as array since it contains image + expect(Array.isArray(userMessage.content)).toBe(true) + }) + }) }) diff --git a/src/api/providers/lite-llm.ts b/src/api/providers/lite-llm.ts index cf8d16a1129..a860a6e4477 100644 --- a/src/api/providers/lite-llm.ts +++ b/src/api/providers/lite-llm.ts @@ -109,6 +109,45 @@ export class LiteLLMHandler extends RouterProvider implements SingleCompletionHa }) } + /** + * Flatten array content in messages to simple string format. + * + * LiteLLM's auto_router feature passes user content to embedding models for semantic routing. + * However, embedding models expect plain strings, not arrays of content blocks. + * When Roo Code sends messages with array content like: + * {"role": "user", "content": [{"type": "text", "text": "..."}]} + * + * The auto_router fails because it passes this array directly to embeddings. + * This method flattens such content to simple strings: + * {"role": "user", "content": "..."} + * + * This is enabled by default via litellmFlattenContent option. + * Users who need multimodal content (images) can disable this. + */ + private flattenMessageContent( + messages: OpenAI.Chat.ChatCompletionMessageParam[], + ): OpenAI.Chat.ChatCompletionMessageParam[] { + return messages.map((msg) => { + // Only flatten user and system messages with array content + if ((msg.role === "user" || msg.role === "system") && Array.isArray(msg.content)) { + // Check if all content blocks are text type + const allText = msg.content.every( + (part) => typeof part === "object" && "type" in part && part.type === "text", + ) + + // Only flatten if all content is text (no images) + if (allText) { + const textParts = msg.content.map((part) => (part as { type: "text"; text: string }).text) + return { + ...msg, + content: textParts.join("\n\n"), + } + } + } + return msg + }) + } + override async *createMessage( systemPrompt: string, messages: Anthropic.Messages.MessageParam[], @@ -116,10 +155,16 @@ export class LiteLLMHandler extends RouterProvider implements SingleCompletionHa ): ApiStream { const { id: modelId, info } = await this.fetchModel() - const openAiMessages = convertToOpenAiMessages(messages, { + let openAiMessages = convertToOpenAiMessages(messages, { normalizeToolCallId: sanitizeOpenAiCallId, }) + // Flatten array content to string for compatibility with LiteLLM's auto_router + // This is enabled by default (when litellmFlattenContent is undefined or true) + if (this.options.litellmFlattenContent !== false) { + openAiMessages = this.flattenMessageContent(openAiMessages) + } + // Prepare messages with cache control if enabled and supported let systemMessage: OpenAI.Chat.ChatCompletionMessageParam let enhancedMessages: OpenAI.Chat.ChatCompletionMessageParam[] diff --git a/webview-ui/src/components/settings/providers/LiteLLM.tsx b/webview-ui/src/components/settings/providers/LiteLLM.tsx index 38ae1f3a96a..6ee65c178b1 100644 --- a/webview-ui/src/components/settings/providers/LiteLLM.tsx +++ b/webview-ui/src/components/settings/providers/LiteLLM.tsx @@ -182,6 +182,20 @@ export const LiteLLM = ({ } return null })()} + + {/* Flatten content option for auto_router compatibility */} +
+ { + setApiConfigurationField("litellmFlattenContent", e.target.checked) + }}> + {t("settings:providers.litellmFlattenContent")} + +
+ {t("settings:providers.litellmFlattenContentDescription")} +
+
) } diff --git a/webview-ui/src/i18n/locales/ca/settings.json b/webview-ui/src/i18n/locales/ca/settings.json index 85e4abadcc5..c31b307fc12 100644 --- a/webview-ui/src/i18n/locales/ca/settings.json +++ b/webview-ui/src/i18n/locales/ca/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "Obtenir clau API de xAI", "litellmApiKey": "Clau API de LiteLLM", "litellmBaseUrl": "URL base de LiteLLM", + "litellmFlattenContent": "Aplanar contingut dels missatges", + "litellmFlattenContentDescription": "Converteix el contingut dels missatges en format matriu a cadenes de text simples. Activeu aquesta opció per a la compatibilitat amb auto_router de LiteLLM i les funcions d'encaminament basades en incrustacions. Desactiveu només si necessiteu contingut multimodal (imatges).", "awsCredentials": "Credencials d'AWS", "awsProfile": "Perfil d'AWS", "awsApiKey": "Clau d'API d'Amazon Bedrock", diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index ff7e7b3ea0c..481f65de244 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "xAI API-Schlüssel erhalten", "litellmApiKey": "LiteLLM API-Schlüssel", "litellmBaseUrl": "LiteLLM Basis-URL", + "litellmFlattenContent": "Nachrichteninhalt abflachen", + "litellmFlattenContentDescription": "Konvertiert Array-formatierten Nachrichteninhalt in einfache Zeichenketten. Aktivieren Sie dies für die Kompatibilität mit LiteLLMs auto_router und Embedding-basierten Routing-Funktionen. Deaktivieren Sie es nur, wenn Sie multimodale Inhalte (Bilder) benötigen.", "awsCredentials": "AWS Anmeldedaten", "awsProfile": "AWS Profil", "awsApiKey": "Amazon Bedrock API-Schlüssel", diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index 3230c4f93f8..f11e9a61002 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -456,6 +456,8 @@ "getXaiApiKey": "Get xAI API Key", "litellmApiKey": "LiteLLM API Key", "litellmBaseUrl": "LiteLLM Base URL", + "litellmFlattenContent": "Flatten message content", + "litellmFlattenContentDescription": "Convert array-formatted message content to plain strings. Enable this for compatibility with LiteLLM's auto_router and embedding-based routing features. Disable only if you need multimodal content (images).", "awsCredentials": "AWS Credentials", "awsProfile": "AWS Profile", "awsApiKey": "Amazon Bedrock API Key", diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index d02b5d05a76..235b2f6e033 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "Obtener clave API de xAI", "litellmApiKey": "Clave API de LiteLLM", "litellmBaseUrl": "URL base de LiteLLM", + "litellmFlattenContent": "Aplanar contenido del mensaje", + "litellmFlattenContentDescription": "Convierte el contenido del mensaje en formato de matriz a cadenas de texto simples. Habilite esto para compatibilidad con auto_router de LiteLLM y funciones de enrutamiento basadas en embeddings. Deshabilite solo si necesita contenido multimodal (imágenes).", "awsCredentials": "Credenciales de AWS", "awsProfile": "Perfil de AWS", "awsApiKey": "Clave de API de Amazon Bedrock", diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index d86c1652bc2..e6a5183fd0d 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "Obtenir la clé API xAI", "litellmApiKey": "Clé API LiteLLM", "litellmBaseUrl": "URL de base LiteLLM", + "litellmFlattenContent": "Aplatir le contenu des messages", + "litellmFlattenContentDescription": "Convertit le contenu des messages au format tableau en chaînes de caractères simples. Activez cette option pour la compatibilité avec auto_router de LiteLLM et les fonctionnalités de routage basées sur les embeddings. Désactivez uniquement si vous avez besoin de contenu multimodal (images).", "awsCredentials": "Identifiants AWS", "awsProfile": "Profil AWS", "awsApiKey": "Clé API Amazon Bedrock", diff --git a/webview-ui/src/i18n/locales/hi/settings.json b/webview-ui/src/i18n/locales/hi/settings.json index 6200d228499..7014ad98f41 100644 --- a/webview-ui/src/i18n/locales/hi/settings.json +++ b/webview-ui/src/i18n/locales/hi/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "xAI API कुंजी प्राप्त करें", "litellmApiKey": "LiteLLM API कुंजी", "litellmBaseUrl": "LiteLLM आधार URL", + "litellmFlattenContent": "संदेश सामग्री को सपाट करें", + "litellmFlattenContentDescription": "ऐरे प्रारूप में संदेश सामग्री को सादा स्ट्रिंग में बदलें। LiteLLM के auto_router और एम्बेडिंग-आधारित रूटिंग सुविधाओं के साथ संगतता के लिए इसे सक्षम करें। केवल तभी अक्षम करें जब आपको मल्टीमॉडल सामग्री (छवियां) की आवश्यकता हो।", "awsCredentials": "AWS क्रेडेंशियल्स", "awsProfile": "AWS प्रोफाइल", "awsApiKey": "Amazon बेडरॉक API कुंजी", diff --git a/webview-ui/src/i18n/locales/id/settings.json b/webview-ui/src/i18n/locales/id/settings.json index 39e0eccb7f8..a3541eae0eb 100644 --- a/webview-ui/src/i18n/locales/id/settings.json +++ b/webview-ui/src/i18n/locales/id/settings.json @@ -406,6 +406,8 @@ "getXaiApiKey": "Dapatkan xAI API Key", "litellmApiKey": "LiteLLM API Key", "litellmBaseUrl": "LiteLLM Base URL", + "litellmFlattenContent": "Ratakan konten pesan", + "litellmFlattenContentDescription": "Mengubah konten pesan berformat array menjadi string teks biasa. Aktifkan untuk kompatibilitas dengan auto_router LiteLLM dan fitur routing berbasis embedding. Nonaktifkan hanya jika Anda memerlukan konten multimodal (gambar).", "awsCredentials": "AWS Credentials", "awsProfile": "AWS Profile", "awsApiKey": "Kunci API Amazon Bedrock", diff --git a/webview-ui/src/i18n/locales/it/settings.json b/webview-ui/src/i18n/locales/it/settings.json index 74c3da5757d..0dfbcd9f489 100644 --- a/webview-ui/src/i18n/locales/it/settings.json +++ b/webview-ui/src/i18n/locales/it/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "Ottieni chiave API xAI", "litellmApiKey": "Chiave API LiteLLM", "litellmBaseUrl": "URL base LiteLLM", + "litellmFlattenContent": "Appiattisci contenuto messaggi", + "litellmFlattenContentDescription": "Converte il contenuto dei messaggi in formato array in stringhe semplici. Abilita questa opzione per la compatibilità con auto_router di LiteLLM e le funzionalità di routing basate su embedding. Disabilita solo se hai bisogno di contenuti multimodali (immagini).", "awsCredentials": "Credenziali AWS", "awsProfile": "Profilo AWS", "awsApiKey": "Chiave API Amazon Bedrock", diff --git a/webview-ui/src/i18n/locales/ja/settings.json b/webview-ui/src/i18n/locales/ja/settings.json index ae98a2b01b1..c0d809c6f87 100644 --- a/webview-ui/src/i18n/locales/ja/settings.json +++ b/webview-ui/src/i18n/locales/ja/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "xAI APIキーを取得", "litellmApiKey": "LiteLLM APIキー", "litellmBaseUrl": "LiteLLM ベースURL", + "litellmFlattenContent": "メッセージコンテンツをフラット化", + "litellmFlattenContentDescription": "配列形式のメッセージコンテンツをプレーンな文字列に変換します。LiteLLMのauto_routerおよび埋め込みベースのルーティング機能との互換性のために有効にしてください。マルチモーダルコンテンツ(画像)が必要な場合のみ無効にしてください。", "awsCredentials": "AWS認証情報", "awsProfile": "AWSプロファイル", "awsApiKey": "Amazon Bedrock APIキー", diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index db6ba45dbc5..b655c1a2ba0 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "xAI API 키 받기", "litellmApiKey": "LiteLLM API 키", "litellmBaseUrl": "LiteLLM 기본 URL", + "litellmFlattenContent": "메시지 콘텐츠 평탄화", + "litellmFlattenContentDescription": "배열 형식의 메시지 콘텐츠를 일반 문자열로 변환합니다. LiteLLM의 auto_router 및 임베딩 기반 라우팅 기능과의 호환성을 위해 활성화하세요. 멀티모달 콘텐츠(이미지)가 필요한 경우에만 비활성화하세요.", "awsCredentials": "AWS 자격 증명", "awsProfile": "AWS 프로필", "awsApiKey": "Amazon Bedrock API 키", diff --git a/webview-ui/src/i18n/locales/nl/settings.json b/webview-ui/src/i18n/locales/nl/settings.json index 49d02217db2..b7b8f2c4190 100644 --- a/webview-ui/src/i18n/locales/nl/settings.json +++ b/webview-ui/src/i18n/locales/nl/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "xAI API-sleutel ophalen", "litellmApiKey": "LiteLLM API-sleutel", "litellmBaseUrl": "LiteLLM basis-URL", + "litellmFlattenContent": "Berichtinhoud afvlakken", + "litellmFlattenContentDescription": "Converteert berichtinhoud in array-formaat naar platte tekst. Schakel dit in voor compatibiliteit met LiteLLM's auto_router en op embedding gebaseerde routeringsfuncties. Schakel alleen uit als u multimodale inhoud (afbeeldingen) nodig heeft.", "awsCredentials": "AWS-inloggegevens", "awsProfile": "AWS-profiel", "awsApiKey": "Amazon Bedrock API-sleutel", diff --git a/webview-ui/src/i18n/locales/pl/settings.json b/webview-ui/src/i18n/locales/pl/settings.json index a20c9f56e14..337b73b47e0 100644 --- a/webview-ui/src/i18n/locales/pl/settings.json +++ b/webview-ui/src/i18n/locales/pl/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "Uzyskaj klucz API xAI", "litellmApiKey": "Klucz API LiteLLM", "litellmBaseUrl": "URL bazowy LiteLLM", + "litellmFlattenContent": "Spłaszcz zawartość wiadomości", + "litellmFlattenContentDescription": "Konwertuje zawartość wiadomości w formacie tablicy na zwykłe ciągi znaków. Włącz dla kompatybilności z auto_router LiteLLM i funkcjami routingu opartymi na osadzeniach. Wyłącz tylko jeśli potrzebujesz treści multimodalnych (obrazów).", "awsCredentials": "Poświadczenia AWS", "awsProfile": "Profil AWS", "awsApiKey": "Klucz API Amazon Bedrock", diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index e96cbb0e743..2f78b0bdd90 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "Obter chave de API xAI", "litellmApiKey": "Chave API LiteLLM", "litellmBaseUrl": "URL base LiteLLM", + "litellmFlattenContent": "Achatar conteúdo das mensagens", + "litellmFlattenContentDescription": "Converte o conteúdo das mensagens em formato de array para strings simples. Habilite para compatibilidade com o auto_router do LiteLLM e recursos de roteamento baseados em embeddings. Desabilite apenas se precisar de conteúdo multimodal (imagens).", "awsCredentials": "Credenciais AWS", "awsProfile": "Perfil AWS", "awsApiKey": "Chave de API Amazon Bedrock", diff --git a/webview-ui/src/i18n/locales/ru/settings.json b/webview-ui/src/i18n/locales/ru/settings.json index a746f1e29ae..cd8eb952174 100644 --- a/webview-ui/src/i18n/locales/ru/settings.json +++ b/webview-ui/src/i18n/locales/ru/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "Получить xAI API-ключ", "litellmApiKey": "API-ключ LiteLLM", "litellmBaseUrl": "Базовый URL LiteLLM", + "litellmFlattenContent": "Выровнять содержимое сообщений", + "litellmFlattenContentDescription": "Преобразует содержимое сообщений в формате массива в простые строки. Включите для совместимости с auto_router LiteLLM и функциями маршрутизации на основе эмбеддингов. Отключайте только при необходимости мультимодального контента (изображений).", "awsCredentials": "AWS-учётные данные", "awsProfile": "Профиль AWS", "awsApiKey": "Ключ API Amazon Bedrock", diff --git a/webview-ui/src/i18n/locales/tr/settings.json b/webview-ui/src/i18n/locales/tr/settings.json index cbbbb673cc2..8d67b044e33 100644 --- a/webview-ui/src/i18n/locales/tr/settings.json +++ b/webview-ui/src/i18n/locales/tr/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "xAI API Anahtarı Al", "litellmApiKey": "LiteLLM API Anahtarı", "litellmBaseUrl": "LiteLLM Temel URL", + "litellmFlattenContent": "Mesaj içeriğini düzleştir", + "litellmFlattenContentDescription": "Dizi formatındaki mesaj içeriğini düz metin dizelerine dönüştürür. LiteLLM'in auto_router ve gömme tabanlı yönlendirme özellikleriyle uyumluluk için etkinleştirin. Yalnızca çok modlu içeriğe (görüntüler) ihtiyacınız varsa devre dışı bırakın.", "awsCredentials": "AWS Kimlik Bilgileri", "awsProfile": "AWS Profili", "awsApiKey": "Amazon Bedrock API Anahtarı", diff --git a/webview-ui/src/i18n/locales/vi/settings.json b/webview-ui/src/i18n/locales/vi/settings.json index acbbea3688e..90a0eddc62b 100644 --- a/webview-ui/src/i18n/locales/vi/settings.json +++ b/webview-ui/src/i18n/locales/vi/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "Lấy khóa API xAI", "litellmApiKey": "Khóa API LiteLLM", "litellmBaseUrl": "URL cơ sở LiteLLM", + "litellmFlattenContent": "Làm phẳng nội dung tin nhắn", + "litellmFlattenContentDescription": "Chuyển đổi nội dung tin nhắn định dạng mảng thành chuỗi văn bản thuần. Bật tùy chọn này để tương thích với auto_router của LiteLLM và các tính năng định tuyến dựa trên embedding. Chỉ tắt nếu bạn cần nội dung đa phương thức (hình ảnh).", "awsCredentials": "Thông tin xác thực AWS", "awsProfile": "Hồ sơ AWS", "awsApiKey": "Khóa API Amazon Bedrock", diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index 57b1b7795c5..8c386495bce 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -402,6 +402,8 @@ "getXaiApiKey": "获取 xAI API 密钥", "litellmApiKey": "LiteLLM API 密钥", "litellmBaseUrl": "LiteLLM 基础 URL", + "litellmFlattenContent": "展平消息内容", + "litellmFlattenContentDescription": "将数组格式的消息内容转换为纯字符串。启用此选项以兼容 LiteLLM 的 auto_router 和基于嵌入的路由功能。仅在需要多模态内容(图像)时禁用。", "awsCredentials": "AWS 凭证", "awsProfile": "AWS 配置文件", "awsApiKey": "Amazon Bedrock API 密钥", diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index 04eb9970f23..5dee613741a 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -411,6 +411,8 @@ "getXaiApiKey": "取得 xAI API 金鑰", "litellmApiKey": "LiteLLM API 金鑰", "litellmBaseUrl": "LiteLLM 基礎 URL", + "litellmFlattenContent": "展平訊息內容", + "litellmFlattenContentDescription": "將陣列格式的訊息內容轉換為純字串。啟用此選項以相容 LiteLLM 的 auto_router 和基於嵌入的路由功能。僅在需要多模態內容(圖像)時停用。", "awsCredentials": "AWS 認證", "awsProfile": "AWS Profile", "awsApiKey": "Amazon Bedrock API 金鑰",