revert open ai client

This commit is contained in:
Jicheng Lu 2025-01-03 09:59:59 -06:00
parent b959508410
commit 72851d3c1e

View file

@ -9,8 +9,9 @@ public class ProviderHelper
{
var settingsService = services.GetRequiredService<ILlmProviderService>();
var settings = settingsService.GetSetting(provider, model);
var client = new OpenAIClient(new ApiKeyCredential(settings.ApiKey));
return client;
var options = !string.IsNullOrEmpty(settings.Endpoint) ?
new OpenAIClientOptions { Endpoint = new Uri(settings.Endpoint) } : null;
return new OpenAIClient(new ApiKeyCredential(settings.ApiKey), options);
}
public static List<RoleDialogModel> GetChatSamples(List<string> lines)