refactor(ThinkChunkMiddleware): remove reasoning check for improved logic clarity (#8505)

- Removed the reasoning check from the ThinkChunkMiddleware to streamline the processing logic.
- This change enhances the middleware's efficiency by focusing on handling streams directly without the reasoning condition.
This commit is contained in:
SuYao 2025-07-25 11:52:34 +08:00 committed by GitHub
parent baad783d64
commit f87975f49f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,12 +34,6 @@ export const ThinkChunkMiddleware: CompletionsMiddleware =
if (result.stream) {
const resultFromUpstream = result.stream as ReadableStream<GenericChunk>
// 检查是否启用reasoning
const enableReasoning = params.enableReasoning || false
if (!enableReasoning) {
return result
}
// 检查是否有流需要处理
if (resultFromUpstream && resultFromUpstream instanceof ReadableStream) {
// thinking 处理状态