We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 075ed78 commit 65efda1Copy full SHA for 65efda1
src/routes/messages/non-stream-translation.ts
@@ -285,7 +285,7 @@ export function translateToAnthropic(
285
allToolUseBlocks.push(...toolUseBlocks)
286
287
// Use the finish_reason from the first choice, or prioritize tool_calls
288
- if (choice.finish_reason === "tool_calls" || stopReason === "stop") {
+ if (choice.finish_reason === "tool_calls" || (stopReason === "stop" && choice.finish_reason !== null)) {
289
stopReason = choice.finish_reason
290
}
291
0 commit comments