diff --git a/src/renderer/src/aiCore/legacy/clients/openai/OpenAIApiClient.ts b/src/renderer/src/aiCore/legacy/clients/openai/OpenAIApiClient.ts index 239890c7a7..8ff25e356d 100644 --- a/src/renderer/src/aiCore/legacy/clients/openai/OpenAIApiClient.ts +++ b/src/renderer/src/aiCore/legacy/clients/openai/OpenAIApiClient.ts @@ -192,7 +192,7 @@ export class OpenAIAPIClient extends OpenAIBaseClient< extra_body: { google: { thinking_config: { - thinkingBudget: 0 + thinking_budget: 0 } } } @@ -327,8 +327,8 @@ export class OpenAIAPIClient extends OpenAIBaseClient< extra_body: { google: { thinking_config: { - thinkingBudget: -1, - includeThoughts: true + thinking_budget: -1, + include_thoughts: true } } } @@ -338,8 +338,8 @@ export class OpenAIAPIClient extends OpenAIBaseClient< extra_body: { google: { thinking_config: { - thinkingBudget: budgetTokens, - includeThoughts: true + thinking_budget: budgetTokens, + include_thoughts: true } } } @@ -670,7 +670,7 @@ export class OpenAIAPIClient extends OpenAIBaseClient< } else if (isClaudeReasoningModel(model) && reasoningEffort.thinking?.budget_tokens) { suffix = ` --thinking_budget ${reasoningEffort.thinking.budget_tokens}` } else if (isGeminiReasoningModel(model) && reasoningEffort.extra_body?.google?.thinking_config) { - suffix = ` --thinking_budget ${reasoningEffort.extra_body.google.thinking_config.thinkingBudget}` + suffix = ` --thinking_budget ${reasoningEffort.extra_body.google.thinking_config.thinking_budget}` } // FIXME: poe 不支持多个text part,上传文本文件的时候用的不是file part而是text part,因此会出问题 // 临时解决方案是强制poe用string content,但是其实poe部分支持array diff --git a/src/renderer/src/aiCore/utils/reasoning.ts b/src/renderer/src/aiCore/utils/reasoning.ts index 0246ac31cb..7b5a6890d7 100644 --- a/src/renderer/src/aiCore/utils/reasoning.ts +++ b/src/renderer/src/aiCore/utils/reasoning.ts @@ -98,7 +98,7 @@ export function getReasoningEffort(assistant: Assistant, model: Model): Reasonin extra_body: { google: { thinking_config: { - thinkingBudget: 0 + thinking_budget: 0 } } } @@ -259,8 +259,8 @@ export function getReasoningEffort(assistant: Assistant, model: Model): Reasonin extra_body: { google: { thinking_config: { - thinkingBudget: -1, - includeThoughts: true + thinking_budget: -1, + include_thoughts: true } } } @@ -270,8 +270,8 @@ export function getReasoningEffort(assistant: Assistant, model: Model): Reasonin extra_body: { google: { thinking_config: { - thinkingBudget: budgetTokens, - includeThoughts: true + thinking_budget: budgetTokens ?? -1, + include_thoughts: true } } } @@ -431,8 +431,8 @@ export function getGeminiReasoningParams(assistant: Assistant, model: Model): Re if (reasoningEffort === undefined) { return { thinkingConfig: { - includeThoughts: false, - ...(GEMINI_FLASH_MODEL_REGEX.test(model.id) ? { thinkingBudget: 0 } : {}) + include_thoughts: false, + ...(GEMINI_FLASH_MODEL_REGEX.test(model.id) ? { thinking_budget: 0 } : {}) } } } @@ -442,7 +442,7 @@ export function getGeminiReasoningParams(assistant: Assistant, model: Model): Re if (effortRatio > 1) { return { thinkingConfig: { - includeThoughts: true + include_thoughts: true } } } @@ -452,8 +452,8 @@ export function getGeminiReasoningParams(assistant: Assistant, model: Model): Re return { thinkingConfig: { - ...(budget > 0 ? { thinkingBudget: budget } : {}), - includeThoughts: true + ...(budget > 0 ? { thinking_budget: budget } : {}), + include_thoughts: true } } } diff --git a/src/renderer/src/i18n/translate/de-de.json b/src/renderer/src/i18n/translate/de-de.json index 2e86111da1..68e491ecb3 100644 --- a/src/renderer/src/i18n/translate/de-de.json +++ b/src/renderer/src/i18n/translate/de-de.json @@ -1,6 +1,7 @@ { "agent": { "add": { + "description": "Bewältigen Sie komplexe Aufgaben mit verschiedenen Werkzeugen", "error": { "failed": "Agent hinzufügen fehlgeschlagen", "invalid_agent": "Ungültiger Agent" @@ -547,8 +548,12 @@ "chat": { "add": { "assistant": { + "description": "Tägliche Gespräche und schnelle Fragen & Antworten", "title": "Assistent hinzufügen" }, + "option": { + "title": "Typ auswählen" + }, "topic": { "title": "Neues Thema erstellen" } diff --git a/src/renderer/src/i18n/translate/el-gr.json b/src/renderer/src/i18n/translate/el-gr.json index a793d9ddf0..35d61b1a1c 100644 --- a/src/renderer/src/i18n/translate/el-gr.json +++ b/src/renderer/src/i18n/translate/el-gr.json @@ -1,6 +1,7 @@ { "agent": { "add": { + "description": "Χειριστείτε πολύπλοκες εργασίες με διάφορα εργαλεία", "error": { "failed": "Αποτυχία προσθήκης πράκτορα", "invalid_agent": "Μη έγκυρος Agent" @@ -547,8 +548,12 @@ "chat": { "add": { "assistant": { + "description": "Καθημερινές συνομιλίες και γρήγορες ερωταπαντήσεις", "title": "Προσθήκη βοηθού" }, + "option": { + "title": "Επιλέξτε Τύπο" + }, "topic": { "title": "Δημιουργία νέου θέματος" } diff --git a/src/renderer/src/i18n/translate/es-es.json b/src/renderer/src/i18n/translate/es-es.json index 27b46ce3b3..75475fef3f 100644 --- a/src/renderer/src/i18n/translate/es-es.json +++ b/src/renderer/src/i18n/translate/es-es.json @@ -1,6 +1,7 @@ { "agent": { "add": { + "description": "Maneja tareas complejas con varias herramientas", "error": { "failed": "Error al añadir agente", "invalid_agent": "Agent inválido" @@ -547,8 +548,12 @@ "chat": { "add": { "assistant": { + "description": "Conversaciones diarias y preguntas y respuestas rápidas", "title": "Agregar asistente" }, + "option": { + "title": "Seleccionar Tipo" + }, "topic": { "title": "Crear nuevo tema" } diff --git a/src/renderer/src/i18n/translate/fr-fr.json b/src/renderer/src/i18n/translate/fr-fr.json index b710e40b1e..2076b9a841 100644 --- a/src/renderer/src/i18n/translate/fr-fr.json +++ b/src/renderer/src/i18n/translate/fr-fr.json @@ -1,6 +1,7 @@ { "agent": { "add": { + "description": "Gérez des tâches complexes avec divers outils", "error": { "failed": "Échec de l'ajout de l'agent", "invalid_agent": "Agent invalide" @@ -547,8 +548,12 @@ "chat": { "add": { "assistant": { + "description": "Conversations quotidiennes et Q&R rapides", "title": "Ajouter un assistant" }, + "option": { + "title": "Sélectionner le type" + }, "topic": { "title": "Nouveau sujet" } diff --git a/src/renderer/src/i18n/translate/ja-jp.json b/src/renderer/src/i18n/translate/ja-jp.json index 449e6bad29..c8e6da0d04 100644 --- a/src/renderer/src/i18n/translate/ja-jp.json +++ b/src/renderer/src/i18n/translate/ja-jp.json @@ -1,6 +1,7 @@ { "agent": { "add": { + "description": "さまざまなツールを使って複雑なタスクを処理する", "error": { "failed": "エージェントの追加に失敗しました", "invalid_agent": "無効なエージェント" @@ -547,8 +548,12 @@ "chat": { "add": { "assistant": { + "description": "日常会話と簡単なQ&A", "title": "アシスタントを追加" }, + "option": { + "title": "種類を選択" + }, "topic": { "title": "新しいトピック" } diff --git a/src/renderer/src/i18n/translate/pt-pt.json b/src/renderer/src/i18n/translate/pt-pt.json index 5ac0f082c1..f75a164a9d 100644 --- a/src/renderer/src/i18n/translate/pt-pt.json +++ b/src/renderer/src/i18n/translate/pt-pt.json @@ -1,6 +1,7 @@ { "agent": { "add": { + "description": "Lide com tarefas complexas usando várias ferramentas", "error": { "failed": "Falha ao adicionar agente", "invalid_agent": "Agent inválido" @@ -547,8 +548,12 @@ "chat": { "add": { "assistant": { + "description": "Conversas diárias e perguntas e respostas rápidas", "title": "Adicionar assistente" }, + "option": { + "title": "Selecionar Tipo" + }, "topic": { "title": "Novo Tópico" } diff --git a/src/renderer/src/i18n/translate/ru-ru.json b/src/renderer/src/i18n/translate/ru-ru.json index 64a6453115..de63d96ff3 100644 --- a/src/renderer/src/i18n/translate/ru-ru.json +++ b/src/renderer/src/i18n/translate/ru-ru.json @@ -1,6 +1,7 @@ { "agent": { "add": { + "description": "Справляйтесь со сложными задачами с помощью различных инструментов", "error": { "failed": "Не удалось добавить агента", "invalid_agent": "Недействительный агент" @@ -547,8 +548,12 @@ "chat": { "add": { "assistant": { + "description": "Ежедневные разговоры и быстрые вопросы и ответы", "title": "Добавить ассистента" }, + "option": { + "title": "Выберите тип" + }, "topic": { "title": "Новый топик" } diff --git a/src/renderer/src/types/sdk.ts b/src/renderer/src/types/sdk.ts index f0ea796932..90a0101563 100644 --- a/src/renderer/src/types/sdk.ts +++ b/src/renderer/src/types/sdk.ts @@ -23,7 +23,6 @@ import type { GoogleGenAI, Model as GeminiModel, SendMessageParameters, - ThinkingConfig, Tool } from '@google/genai' @@ -92,7 +91,10 @@ export type ReasoningEffortOptionalParams = { } extra_body?: { google?: { - thinking_config: ThinkingConfig + thinking_config: { + thinking_budget: number + include_thoughts?: boolean + } } } // Add any other potential reasoning-related keys here if they exist