fix: 限制 Azure OpenAI 请求最大 tokens 并优化响应处理空行格式
This commit is contained in:
@@ -26,7 +26,7 @@ public class AzureOpenAiChatCompletionCompletionsService(ILogger<AzureOpenAiChat
|
||||
|
||||
openai?.SetTag("Model", chatCompletionCreate.Model);
|
||||
openai?.SetTag("Response", response.StatusCode.ToString());
|
||||
|
||||
|
||||
if (response.StatusCode >= HttpStatusCode.BadRequest)
|
||||
{
|
||||
var error = await response.Content.ReadAsStringAsync();
|
||||
|
||||
@@ -75,6 +75,13 @@ namespace Yi.Framework.AiHub.Domain
|
||||
};
|
||||
}
|
||||
});
|
||||
options.Handles.Add(request =>
|
||||
{
|
||||
if (request.MaxTokens >= 16384)
|
||||
{
|
||||
request.MaxTokens = 16384;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//配置支付宝支付
|
||||
|
||||
Reference in New Issue
Block a user