diff --git a/dotnet/src/dotnetcore/Providers/AI/Services/AgentService.cs b/dotnet/src/dotnetcore/Providers/AI/Services/AgentService.cs index 1a2178cb6..8734f1b9b 100644 --- a/dotnet/src/dotnetcore/Providers/AI/Services/AgentService.cs +++ b/dotnet/src/dotnetcore/Providers/AI/Services/AgentService.cs @@ -16,6 +16,7 @@ internal class AgentService { const string SerializedAdditionalRawDataPty = "SerializedAdditionalRawData"; const string VARIABLES = "variables"; + const string SAIA_AGENT = "saia:agent:"; private HttpClient _httpClient; protected string API_KEY; protected OpenAIClient _openAIClient; @@ -59,7 +60,7 @@ internal AgentService() _openAIClient = new OpenAIClient(new ApiKeyCredential(API_KEY), options); } - internal async Task Assistant(string modelId, string userMessage, GXProperties properties) + internal async Task Assistant(string assistant, string userMessage, GXProperties properties) { List messages = new List @@ -78,7 +79,7 @@ internal async Task Assistant(string modelId, string userMessage }; fieldInfo.SetValue(customOptions, SerializedAdditionalRawData); } - ChatClient client = _openAIClient.GetChatClient(modelId); + ChatClient client = _openAIClient.GetChatClient($"{SAIA_AGENT}{assistant}"); ClientResult response = await client.CompleteChatAsync(messages, customOptions); diff --git a/dotnet/test/DotNetCoreUnitTest/Domain/GxEmbeddingTest.cs b/dotnet/test/DotNetCoreUnitTest/Domain/GxEmbeddingTest.cs index eddbda63d..c3e7618a8 100644 --- a/dotnet/test/DotNetCoreUnitTest/Domain/GxEmbeddingTest.cs +++ b/dotnet/test/DotNetCoreUnitTest/Domain/GxEmbeddingTest.cs @@ -21,7 +21,7 @@ public async Task AssistantTest() { AgentService agentService = AgentService.AgentHandlerInstance; string userMessage = "What's the weather like in Buenos Aires today?"; - string modelId = "saia:agent:e4e7a837-b8ad-4d25-b2db-431dda9af0af"; + string modelId = "e4e7a837-b8ad-4d25-b2db-431dda9af0af"; GXProperties properties = new GXProperties(); properties.Set("$context", "context for reference"); ChatCompletion embedding = await agentService.Assistant(modelId, userMessage, properties);