fix(chat): support reasoning content in streaming responses for vLLM models

- Parse reasoning field together with standard stream response using local struct
- Unify reasoning content extraction from standard and vLLM response paths
- Adapt processStreamDelta to accept reasoning content as a separate parameter
- Send reasoning content as thinking response in the stream when available
- Ensure compatibility with existing SDK logic by constructing standard choice object
This commit is contained in:
Andy Yang
2026-03-23 14:20:31 +08:00
committed by lyingbug
parent 5b43d04d6b
commit 62e6ae960f
2 changed files with 33 additions and 7 deletions
+2 -1
View File
@@ -78,5 +78,6 @@ func (c *GenericChat) customizeRequest(req *openai.ChatCompletionRequest, opts *
req.ChatTemplateKwargs = map[string]interface{}{
"enable_thinking": thinking,
}
return nil, false // 使用标准请求(已修改)
return req, true
}