mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-05-22 19:32:15 +00:00
Renamed Tools to ProviderTools as a preparation for the implementation of local tool calling
This commit is contained in:
parent
6155442039
commit
e5a9b32245
@ -79,9 +79,9 @@ public sealed class ProviderOpenAI() : BaseProvider(LLMProviders.OPEN_AI, "https
|
|||||||
//
|
//
|
||||||
// Prepare the tools we want to use:
|
// Prepare the tools we want to use:
|
||||||
//
|
//
|
||||||
IList<Tool> tools = modelCapabilities.Contains(Capability.WEB_SEARCH) switch
|
IList<ProviderTool> 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,
|
Store = false,
|
||||||
|
|
||||||
// Tools we want to use:
|
// Tools we want to use:
|
||||||
Tools = tools,
|
ProviderTools = providerTools,
|
||||||
|
|
||||||
// Additional API parameters:
|
// Additional API parameters:
|
||||||
AdditionalApiParameters = apiParameters
|
AdditionalApiParameters = apiParameters
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
namespace AIStudio.Provider.OpenAI;
|
namespace AIStudio.Provider.OpenAI;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a tool used by the AI model.
|
/// Represents a tool executed on the provider side.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Right now, only our OpenAI provider is using tools. Thus, this class is located in the
|
/// 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.
|
/// be moved into the provider namespace.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="Type">The type of the tool.</param>
|
/// <param name="Type">The type of the tool.</param>
|
||||||
public record Tool(string Type);
|
public record ProviderTool(string Type);
|
||||||
@ -1,14 +1,14 @@
|
|||||||
namespace AIStudio.Provider.OpenAI;
|
namespace AIStudio.Provider.OpenAI;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Known tools for LLM providers.
|
/// Known provider-side tools for LLM providers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Right now, only our OpenAI provider is using tools. Thus, this class is located in the
|
/// 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
|
/// OpenAI namespace. In the future, when other providers also support tools, this class can
|
||||||
/// be moved into the provider namespace.
|
/// be moved into the provider namespace.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public static class Tools
|
public static class ProviderTools
|
||||||
{
|
{
|
||||||
public static readonly Tool WEB_SEARCH = new("web_search");
|
public static readonly ProviderTool WEB_SEARCH = new("web_search");
|
||||||
}
|
}
|
||||||
@ -9,13 +9,13 @@ namespace AIStudio.Provider.OpenAI;
|
|||||||
/// <param name="Input">The chat messages.</param>
|
/// <param name="Input">The chat messages.</param>
|
||||||
/// <param name="Stream">Whether to stream the response.</param>
|
/// <param name="Stream">Whether to stream the response.</param>
|
||||||
/// <param name="Store">Whether to store the response on the server (usually OpenAI's infrastructure).</param>
|
/// <param name="Store">Whether to store the response on the server (usually OpenAI's infrastructure).</param>
|
||||||
/// <param name="Tools">The tools to use for the request.</param>
|
/// <param name="ProviderTools">The provider-side tools to use for the request.</param>
|
||||||
public record ResponsesAPIRequest(
|
public record ResponsesAPIRequest(
|
||||||
string Model,
|
string Model,
|
||||||
IList<IMessageBase> Input,
|
IList<IMessageBase> Input,
|
||||||
bool Stream,
|
bool Stream,
|
||||||
bool Store,
|
bool Store,
|
||||||
IList<Tool> Tools)
|
[property: JsonPropertyName("tools")] IList<ProviderTool> ProviderTools)
|
||||||
{
|
{
|
||||||
public ResponsesAPIRequest() : this(string.Empty, [], true, false, [])
|
public ResponsesAPIRequest() : this(string.Empty, [], true, false, [])
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user