Skip to content

Commit 6c385b7

Browse files
committed
fix: improve checks for reasoningText and reasoningOpaque in getAnthropicThinkBlocks
1 parent 58f7a45 commit 6c385b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/routes/messages/non-stream-translation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ function getAnthropicThinkBlocks(
337337
reasoningText: string | null | undefined,
338338
reasoningOpaque: string | null | undefined,
339339
): Array<AnthropicThinkingBlock> {
340-
if (reasoningText) {
340+
if (reasoningText && reasoningText.length > 0) {
341341
return [
342342
{
343343
type: "thinking",
@@ -346,7 +346,7 @@ function getAnthropicThinkBlocks(
346346
},
347347
]
348348
}
349-
if (reasoningOpaque) {
349+
if (reasoningOpaque && reasoningOpaque.length > 0) {
350350
return [
351351
{
352352
type: "thinking",

0 commit comments

Comments
 (0)