diff --git a/app/MindWork AI Studio/Provider/BaseProvider.cs b/app/MindWork AI Studio/Provider/BaseProvider.cs
index 88d8d949..325b4ce2 100644
--- a/app/MindWork AI Studio/Provider/BaseProvider.cs
+++ b/app/MindWork AI Studio/Provider/BaseProvider.cs
@@ -1244,6 +1244,7 @@ public abstract class BaseProvider : IProvider, ISecretId
/// The system prompt role to use.
/// The request path, relative to the provider base URL.
/// Optional additional headers to add.
+ /// Whether a request which offers tools may ask for one call at a time. False for a provider which rejects the parallel_tool_calls parameter.
/// The cancellation token.
/// The request DTO type.
/// The delta stream line type.
@@ -1260,6 +1261,7 @@ public abstract class BaseProvider : IProvider, ISecretId
string systemPromptRole = "system",
string requestPath = "chat/completions",
Action? headersAction = null,
+ bool mayAskForSequentialToolCalls = true,
[EnumeratorCancellation] CancellationToken token = default)
where TRequest : ChatCompletionAPIRequest
where TDelta : IResponseStreamLine
@@ -1298,7 +1300,7 @@ public abstract class BaseProvider : IProvider, ISecretId
if (runnableTools.Count > 0)
{
var adapter = new ChatCompletionToolCallingAdapter(requestFactory, systemPrompt, apiParameters,
- runnableTools.Select(x => ProviderToolAdapters.ToChatCompletionTool(x.Definition)).ToList(), runnableTools,
+ runnableTools.Select(x => ProviderToolAdapters.ToChatCompletionTool(x.Definition)).ToList(), mayAskForSequentialToolCalls, runnableTools,
(requestDto, requestToken) => this.StreamChatCompletionRequest(requestDto, providerName, requestPath, requestedSecret, headersAction, requestToken),
ChatCompletionSourceReader.Read,
this.logger);
diff --git a/app/MindWork AI Studio/Provider/HuggingFace/ProviderHuggingFace.cs b/app/MindWork AI Studio/Provider/HuggingFace/ProviderHuggingFace.cs
index 2a225ae8..a50a23c5 100644
--- a/app/MindWork AI Studio/Provider/HuggingFace/ProviderHuggingFace.cs
+++ b/app/MindWork AI Studio/Provider/HuggingFace/ProviderHuggingFace.cs
@@ -184,6 +184,15 @@ public sealed class ProviderHuggingFace : BaseProvider
AdditionalApiParameters = apiParameters
};
},
+
+ //
+ // Hugging Face answers parallel_tool_calls=false with a bad request, "feature
+ // not currently supported", and its specification of the chat completion does
+ // not list the parameter at all -- read on 2026-09-23 at
+ // https://huggingface.co/docs/inference-providers/tasks/chat-completion. Asking
+ // for it would cost every chat which offers tools its answer:
+ //
+ mayAskForSequentialToolCalls: false,
token: token))
yield return content;
}
diff --git a/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionToolCallingAdapter.cs b/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionToolCallingAdapter.cs
index 1925b1bd..2d425622 100644
--- a/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionToolCallingAdapter.cs
+++ b/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionToolCallingAdapter.cs
@@ -16,7 +16,7 @@ namespace AIStudio.Provider.OpenAI;
public sealed class ChatCompletionToolCallingAdapter(
Func, IList