feat: 完成ai网关改造

This commit is contained in:
ccnetcore
2025-06-25 22:41:32 +08:00
parent 695aaedfba
commit c5037ea397
5 changed files with 32 additions and 31 deletions

View File

@@ -25,7 +25,10 @@ public class AzureChatService : IChatService
new AzureKeyCredential(apiKey));
ChatClient chatClient = azureClient.GetChatClient(deploymentName);
var response = chatClient.CompleteChatStreamingAsync(messages, cancellationToken: cancellationToken);
var response = chatClient.CompleteChatStreamingAsync(messages, new ChatCompletionOptions()
{
MaxOutputTokenCount = 2048
}, cancellationToken: cancellationToken);
await foreach (StreamingChatCompletionUpdate update in response)
{