Skip to content

Commit 53cafa4

Browse files
committed
Don't output newline-only reasoning
1 parent 613255c commit 53cafa4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/api/providers/base-openai-compatible-provider.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ export abstract class BaseOpenAiCompatibleProvider<ModelName extends string>
124124
}
125125
}
126126

127-
if (delta && "reasoning_content" in delta && delta.reasoning_content) {
128-
yield { type: "reasoning", text: (delta.reasoning_content as string | undefined) || "" }
127+
if (delta && "reasoning_content" in delta) {
128+
const reasoning_content = (delta.reasoning_content as string | undefined) || ""
129+
if (reasoning_content?.trim()) {
130+
yield { type: "reasoning", text: reasoning_content }
131+
}
129132
}
130133

131134
if (chunk.usage) {

0 commit comments

Comments
 (0)