mirror of
https://github.com/alibaba/higress.git
synced 2026-02-06 23:21:08 +08:00
fix(ai-proxy): 处理 Qwen 响应无选择项的情况 (#3448)
This commit is contained in:
@@ -334,6 +334,11 @@ func (m *qwenProvider) buildChatCompletionResponse(ctx wrapper.HttpContext, qwen
|
||||
}
|
||||
|
||||
func (m *qwenProvider) buildChatCompletionStreamingResponse(ctx wrapper.HttpContext, qwenResponse *qwenTextGenResponse, incrementalStreaming bool) []*chatCompletionResponse {
|
||||
if len(qwenResponse.Output.Choices) == 0 {
|
||||
log.Warnf("qwen response has no choices, request_id: %s", qwenResponse.RequestId)
|
||||
return nil
|
||||
}
|
||||
|
||||
baseMessage := chatCompletionResponse{
|
||||
Id: qwenResponse.RequestId,
|
||||
Created: time.Now().UnixMilli() / 1000,
|
||||
|
||||
Reference in New Issue
Block a user