Skip to content

Commit 8fe48f6

Browse files
committed
fix: handle empty reasoning_content from non-standard APIs
Some non-standard APIs may return an empty string for `reasoning_content` even when the model does not support deep reasoning. This change improves compatibility by tolerating that response shape.
1 parent 6a8bf29 commit 8fe48f6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/components/src/bubble/renderers/defaultRenderers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const defaultContentRendererMatches: Array<BubbleContentRendererMatch> =
2525
priority: BubbleRendererMatchPriority.LOADING,
2626
},
2727
{
28-
find: (message) => typeof message.reasoning_content === 'string',
28+
find: (message) => typeof message.reasoning_content === 'string' && message.reasoning_content.trim() !== '',
2929
renderer: markRaw(Reasoning),
3030
priority: BubbleRendererMatchPriority.NORMAL,
3131
},

0 commit comments

Comments
 (0)