Skip to content

Commit f16e50c

Browse files
committed
Remove version in Azure ChatCompletionProvider
1 parent a740129 commit f16e50c

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/Plugins/BotSharp.Plugin.AzureOpenAI/Providers/ChatCompletionProvider.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class ChatCompletionProvider : IChatCompletion
2222
private readonly IServiceProvider _services;
2323
private readonly ILogger _logger;
2424

25-
private string _model, _version;
25+
private string _model;
2626

2727
public string Provider => "azure-openai";
2828

@@ -231,13 +231,10 @@ public async Task<bool> GetChatCompletionsStreamingAsync(Agent agent, List<RoleD
231231
{
232232
if (message.Role == ChatRole.Function)
233233
{
234-
if (_version == "0125-Preview")
234+
chatCompletionsOptions.Messages.Add(new ChatRequestAssistantMessage(string.Empty)
235235
{
236-
chatCompletionsOptions.Messages.Add(new ChatRequestAssistantMessage(string.Empty)
237-
{
238-
FunctionCall = new FunctionCall(message.FunctionName, message.FunctionArgs),
239-
});
240-
}
236+
FunctionCall = new FunctionCall(message.FunctionName, message.FunctionArgs ?? String.Empty),
237+
});
241238

242239
chatCompletionsOptions.Messages.Add(new ChatRequestFunctionMessage(message.FunctionName, message.Content));
243240
}
@@ -334,9 +331,5 @@ private string GetPrompt(ChatCompletionsOptions chatCompletionsOptions)
334331
public void SetModelName(string model)
335332
{
336333
_model = model;
337-
338-
var settingsService = _services.GetRequiredService<ILlmProviderService>();
339-
var settings = settingsService.GetSetting(Provider, model);
340-
_version = settings.Version;
341334
}
342335
}

0 commit comments

Comments
 (0)