Skip to content

Commit 4d7da88

Browse files
committed
fix: add tool reasoning when first response has no reasoning
1 parent 76f386e commit 4d7da88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/cmd/chat/chat.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func chatStream(w http.ResponseWriter, r *http.Request) {
185185
}
186186

187187
// Accumulate reasoning for all tool calls
188-
if responseMessage.Reasoning != "" {
188+
if responseMessage.Reasoning != "" || completion.Reasoning != "" {
189189
responseMessage.Reasoning += " \n`using tool:" + toolCall.Name + "` \n" + completion.Reasoning
190190
}
191191
}
@@ -356,7 +356,7 @@ func retryStream(w http.ResponseWriter, r *http.Request) {
356356
}
357357

358358
// Accumulate reasoning for all tool calls
359-
if responseMessage.Reasoning != "" {
359+
if responseMessage.Reasoning != "" || completion.Reasoning != "" {
360360
responseMessage.Reasoning += " \n`using tool:" + toolCall.Name + "` \n" + completion.Reasoning
361361
}
362362
}

0 commit comments

Comments
 (0)