From 396fbbbddbf9de58d9ba82b3d538ff5527c72623 Mon Sep 17 00:00:00 2001 From: kylebunting Date: Wed, 7 Aug 2024 15:41:52 -0600 Subject: [PATCH] Adding capabilities property to agent, with single value of OpenAIAssistants --- .../AgentResourceProviderService.cs | 1 + .../Models/ResourceProviders/Agent/AgentBase.cs | 6 ++++++ .../ResourceProviders/Agent/AgentCapabilities.cs | 13 +++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 src/dotnet/Common/Models/ResourceProviders/Agent/AgentCapabilities.cs diff --git a/src/dotnet/Agent/ResourceProviders/AgentResourceProviderService.cs b/src/dotnet/Agent/ResourceProviders/AgentResourceProviderService.cs index 05f923b2d5..b7a2b87a19 100644 --- a/src/dotnet/Agent/ResourceProviders/AgentResourceProviderService.cs +++ b/src/dotnet/Agent/ResourceProviders/AgentResourceProviderService.cs @@ -234,6 +234,7 @@ private async Task UpdateAgent(ResourcePath resour }; agent.ObjectId = resourcePath.GetObjectId(_instanceSettings.Id, _name); + agent.Capabilities ??= [AgentCapabilities.OpenAIAssistants]; if ((agent is KnowledgeManagementAgent {Vectorization.DedicatedPipeline: true, InlineContext: false} kmAgent)) { diff --git a/src/dotnet/Common/Models/ResourceProviders/Agent/AgentBase.cs b/src/dotnet/Common/Models/ResourceProviders/Agent/AgentBase.cs index 380ec7391a..7a5c697d58 100644 --- a/src/dotnet/Common/Models/ResourceProviders/Agent/AgentBase.cs +++ b/src/dotnet/Common/Models/ResourceProviders/Agent/AgentBase.cs @@ -56,6 +56,12 @@ public class AgentBase : ResourceBase [JsonPropertyName("long_running")] public bool LongRunning { get; set; } = false; + /// + /// List of capabilities that the agent supports. + /// + [JsonPropertyName("capabilities")] + public string[]? Capabilities { get; set; } + /// /// The object type of the agent. /// diff --git a/src/dotnet/Common/Models/ResourceProviders/Agent/AgentCapabilities.cs b/src/dotnet/Common/Models/ResourceProviders/Agent/AgentCapabilities.cs new file mode 100644 index 0000000000..6777fd2e82 --- /dev/null +++ b/src/dotnet/Common/Models/ResourceProviders/Agent/AgentCapabilities.cs @@ -0,0 +1,13 @@ +namespace FoundationaLLM.Common.Models.ResourceProviders.Agent +{ + /// + /// Contains constants for the capabilities of agents. + /// + public static class AgentCapabilities + { + /// + /// Indicated the agent supports the OpenAI Assistants API capability. + /// + public const string OpenAIAssistants = "OpenAIAssistants"; + } +}