revert: use blank User-Agent header when communicating with open-ai compatible service

This reverts commit 26ab0a7529.

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2026-04-13 17:28:55 +08:00
parent f8e8dcab56
commit c4c75c32c7

View File

@@ -84,8 +84,8 @@ namespace SourceGit.AI
{
var credential = new ApiKeyCredential(ReadApiKeyFromEnv ? Environment.GetEnvironmentVariable(ApiKey) : ApiKey);
return Server.Contains("openai.azure.com/", StringComparison.Ordinal)
? new AzureOpenAIClient(new Uri(Server), credential, new AzureOpenAIClientOptions() { UserAgentApplicationId = string.Empty })
: new OpenAIClient(credential, new() { Endpoint = new Uri(Server), UserAgentApplicationId = string.Empty });
? new AzureOpenAIClient(new Uri(Server), credential)
: new OpenAIClient(credential, new() { Endpoint = new Uri(Server) });
}
private string _name = string.Empty;