mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 04:37:31 +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 {
|
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{
|
baseMessage := chatCompletionResponse{
|
||||||
Id: qwenResponse.RequestId,
|
Id: qwenResponse.RequestId,
|
||||||
Created: time.Now().UnixMilli() / 1000,
|
Created: time.Now().UnixMilli() / 1000,
|
||||||
|
|||||||
Reference in New Issue
Block a user