From e5a9b322450d3ae0732054e74134a5809a61f532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peer=20Sch=C3=BCtt?= <20603780+peerschuett@users.noreply.github.com> Date: Wed, 8 Apr 2026 09:21:38 +0200 Subject: [PATCH] Renamed Tools to ProviderTools as a preparation for the implementation of local tool calling --- app/MindWork AI Studio/Provider/OpenAI/ProviderOpenAI.cs | 8 ++++---- .../Provider/OpenAI/{Tool.cs => ProviderTool.cs} | 4 ++-- .../Provider/OpenAI/{Tools.cs => ProviderTools.cs} | 8 ++++---- .../Provider/OpenAI/ResponsesAPIRequest.cs | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) rename app/MindWork AI Studio/Provider/OpenAI/{Tool.cs => ProviderTool.cs} (79%) rename app/MindWork AI Studio/Provider/OpenAI/{Tools.cs => ProviderTools.cs} (67%) diff --git a/app/MindWork AI Studio/Provider/OpenAI/ProviderOpenAI.cs b/app/MindWork AI Studio/Provider/OpenAI/ProviderOpenAI.cs index e5b6ebfd..d0c211bb 100644 --- a/app/MindWork AI Studio/Provider/OpenAI/ProviderOpenAI.cs +++ b/app/MindWork AI Studio/Provider/OpenAI/ProviderOpenAI.cs @@ -79,9 +79,9 @@ public sealed class ProviderOpenAI() : BaseProvider(LLMProviders.OPEN_AI, "https // // Prepare the tools we want to use: // - IList tools = modelCapabilities.Contains(Capability.WEB_SEARCH) switch + IList providerTools = modelCapabilities.Contains(Capability.WEB_SEARCH) switch { - true => [ Tools.WEB_SEARCH ], + true => [ ProviderTools.WEB_SEARCH ], _ => [] }; @@ -178,7 +178,7 @@ public sealed class ProviderOpenAI() : BaseProvider(LLMProviders.OPEN_AI, "https Store = false, // Tools we want to use: - Tools = tools, + ProviderTools = providerTools, // Additional API parameters: AdditionalApiParameters = apiParameters @@ -290,4 +290,4 @@ public sealed class ProviderOpenAI() : BaseProvider(LLMProviders.OPEN_AI, "https var modelResponse = await response.Content.ReadFromJsonAsync(token); return modelResponse.Data.Where(model => prefixes.Any(prefix => model.Id.StartsWith(prefix, StringComparison.InvariantCulture))); } -} \ No newline at end of file +} diff --git a/app/MindWork AI Studio/Provider/OpenAI/Tool.cs b/app/MindWork AI Studio/Provider/OpenAI/ProviderTool.cs similarity index 79% rename from app/MindWork AI Studio/Provider/OpenAI/Tool.cs rename to app/MindWork AI Studio/Provider/OpenAI/ProviderTool.cs index 782e6b60..61170af3 100644 --- a/app/MindWork AI Studio/Provider/OpenAI/Tool.cs +++ b/app/MindWork AI Studio/Provider/OpenAI/ProviderTool.cs @@ -1,7 +1,7 @@ namespace AIStudio.Provider.OpenAI; /// -/// Represents a tool used by the AI model. +/// Represents a tool executed on the provider side. /// /// /// Right now, only our OpenAI provider is using tools. Thus, this class is located in the @@ -9,4 +9,4 @@ namespace AIStudio.Provider.OpenAI; /// be moved into the provider namespace. /// /// The type of the tool. -public record Tool(string Type); \ No newline at end of file +public record ProviderTool(string Type); diff --git a/app/MindWork AI Studio/Provider/OpenAI/Tools.cs b/app/MindWork AI Studio/Provider/OpenAI/ProviderTools.cs similarity index 67% rename from app/MindWork AI Studio/Provider/OpenAI/Tools.cs rename to app/MindWork AI Studio/Provider/OpenAI/ProviderTools.cs index 50d2b836..359c781b 100644 --- a/app/MindWork AI Studio/Provider/OpenAI/Tools.cs +++ b/app/MindWork AI Studio/Provider/OpenAI/ProviderTools.cs @@ -1,14 +1,14 @@ namespace AIStudio.Provider.OpenAI; /// -/// Known tools for LLM providers. +/// Known provider-side tools for LLM providers. /// /// /// Right now, only our OpenAI provider is using tools. Thus, this class is located in the /// OpenAI namespace. In the future, when other providers also support tools, this class can /// be moved into the provider namespace. /// -public static class Tools +public static class ProviderTools { - public static readonly Tool WEB_SEARCH = new("web_search"); -} \ No newline at end of file + public static readonly ProviderTool WEB_SEARCH = new("web_search"); +} diff --git a/app/MindWork AI Studio/Provider/OpenAI/ResponsesAPIRequest.cs b/app/MindWork AI Studio/Provider/OpenAI/ResponsesAPIRequest.cs index deb315d6..739ad7ad 100644 --- a/app/MindWork AI Studio/Provider/OpenAI/ResponsesAPIRequest.cs +++ b/app/MindWork AI Studio/Provider/OpenAI/ResponsesAPIRequest.cs @@ -9,13 +9,13 @@ namespace AIStudio.Provider.OpenAI; /// The chat messages. /// Whether to stream the response. /// Whether to store the response on the server (usually OpenAI's infrastructure). -/// The tools to use for the request. +/// The provider-side tools to use for the request. public record ResponsesAPIRequest( string Model, IList Input, bool Stream, bool Store, - IList Tools) + [property: JsonPropertyName("tools")] IList ProviderTools) { public ResponsesAPIRequest() : this(string.Empty, [], true, false, []) { @@ -24,4 +24,4 @@ public record ResponsesAPIRequest( // Attention: The "required" modifier is not supported for [JsonExtensionData]. [JsonExtensionData] public IDictionary AdditionalApiParameters { get; init; } = new Dictionary(); -} \ No newline at end of file +}