diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index 0f63c32d..fbf478f4 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -5929,15 +5929,15 @@ UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T1999987800"] = "We tried to -- We tried to communicate with the LLM provider '{0}' (type={1}). You might not be able to use this provider from your location. The provider message is: '{2}' UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T2107463087"] = "We tried to communicate with the LLM provider '{0}' (type={1}). You might not be able to use this provider from your location. The provider message is: '{2}'" --- The tool calling request failed with status code {0}. The provider message is: '{1}' -UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T2584985559"] = "The tool calling request failed with status code {0}. The provider message is: '{1}'" - -- We tried to communicate with the LLM provider '{0}' (type={1}). Something was not found. The provider message is: '{2}' UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T3014737766"] = "We tried to communicate with the LLM provider '{0}' (type={1}). Something was not found. The provider message is: '{2}'" -- We tried to communicate with the LLM provider '{0}' (type={1}). Even after {2} retries, there were some problems with the request. The provider message is: '{3}'. UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T3049689432"] = "We tried to communicate with the LLM provider '{0}' (type={1}). Even after {2} retries, there were some problems with the request. The provider message is: '{3}'." +-- The tool calling request failed with status code {0}. See the logs for details. +UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T3117779001"] = "The tool calling request failed with status code {0}. See the logs for details." + -- Tried to communicate with the LLM provider '{0}'. There were some problems with the request. The provider message is: '{1}' UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T3573577433"] = "Tried to communicate with the LLM provider '{0}'. There were some problems with the request. The provider message is: '{1}'" diff --git a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua index 2dfbb4ec..f1430425 100644 --- a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua +++ b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua @@ -5934,6 +5934,9 @@ UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T2107463087"] = "Wir haben ve -- The tool calling request failed with status code {0}. The provider message is: '{1}' UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T2584985559"] = "Die Tool-Aufrufanfrage ist mit dem Statuscode {0} fehlgeschlagen. Die Meldung des Anbieters lautet: „{1}“" +-- The tool calling request failed with status code {0}. See the logs for details. +UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T3117779001"] = "Die Tool-Aufrufanfrage ist mit dem Statuscode {0} fehlgeschlagen. Details finden Sie in den Logs." + -- We tried to communicate with the LLM provider '{0}' (type={1}). Something was not found. The provider message is: '{2}' UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T3014737766"] = "Wir haben versucht, mit dem LLM-Anbieter „{0}“ (Typ={1}) zu kommunizieren. Etwas wurde nicht gefunden. Die Nachricht des Anbieters lautet: „{2}“" diff --git a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua index 9c780ab2..28fe8a07 100644 --- a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua +++ b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua @@ -5934,6 +5934,9 @@ UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T2107463087"] = "We tried to -- The tool calling request failed with status code {0}. The provider message is: '{1}' UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T2584985559"] = "The tool calling request failed with status code {0}. The provider message is: '{1}'" +-- The tool calling request failed with status code {0}. See the logs for details. +UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T3117779001"] = "The tool calling request failed with status code {0}. See the logs for details." + -- We tried to communicate with the LLM provider '{0}' (type={1}). Something was not found. The provider message is: '{2}' UI_TEXT_CONTENT["AISTUDIO::PROVIDER::BASEPROVIDER::T3014737766"] = "We tried to communicate with the LLM provider '{0}' (type={1}). Something was not found. The provider message is: '{2}'" diff --git a/app/MindWork AI Studio/Provider/BaseProvider.cs b/app/MindWork AI Studio/Provider/BaseProvider.cs index f4b36f00..de8091a6 100644 --- a/app/MindWork AI Studio/Provider/BaseProvider.cs +++ b/app/MindWork AI Studio/Provider/BaseProvider.cs @@ -629,6 +629,7 @@ public abstract class BaseProvider : IProvider, ISecretId chatThread.RuntimeComponent, chatThread.RuntimeSelectedToolIds, this.Provider.GetModelCapabilities(chatModel), + this.Provider.GetConfidence(settingsManager).Level, settingsManager.IsToolSelectionVisible(chatThread.RuntimeComponent)); if (runnableTools.Count > 0) @@ -653,13 +654,19 @@ public abstract class BaseProvider : IProvider, ISecretId var response = await this.ExecuteChatCompletionRequest(requestDto, requestPath, requestedSecret, headersAction, token); var responseMessage = response?.Choices.FirstOrDefault()?.Message; if (responseMessage is null) + { + currentAssistantContent!.ToolRuntimeStatus = new(); + await currentAssistantContent.StreamingEvent(); yield break; + } if (responseMessage.ToolCalls.Count == 0) { currentAssistantContent!.ToolRuntimeStatus = new(); if (!string.IsNullOrWhiteSpace(responseMessage.Content)) yield return new ContentStreamChunk(responseMessage.Content, []); + else if (toolCallCount > 0) + yield return new ContentStreamChunk("The model completed the tool call but did not return a final answer.", []); yield break; } @@ -763,7 +770,14 @@ public abstract class BaseProvider : IProvider, ISecretId using var response = await this.httpClient.SendAsync(request, token); if (!response.IsSuccessStatusCode) + { + var responseBody = await response.Content.ReadAsStringAsync(token); + this.logger.LogError("Tool calling chat completion request failed with status code {ResponseStatusCode} and body: '{ResponseBody}'.", response.StatusCode, responseBody); + await MessageBus.INSTANCE.SendError(new( + Icons.Material.Filled.Build, + string.Format(TB("The tool calling request failed with status code {0}. See the logs for details."), (int)response.StatusCode))); return null; + } return await response.Content.ReadFromJsonAsync(JSON_SERIALIZER_OPTIONS, token); } @@ -1077,4 +1091,3 @@ public abstract class BaseProvider : IProvider, ISecretId _ => string.Empty, }; } -