Skip to content

Commit 65efda1

Browse files
hedecaiCopilot
andauthored
Update src/routes/messages/non-stream-translation.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 075ed78 commit 65efda1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export function translateToAnthropic(
285285
allToolUseBlocks.push(...toolUseBlocks)
286286

287287
// Use the finish_reason from the first choice, or prioritize tool_calls
288-
if (choice.finish_reason === "tool_calls" || stopReason === "stop") {
288+
if (choice.finish_reason === "tool_calls" || (stopReason === "stop" && choice.finish_reason !== null)) {
289289
stopReason = choice.finish_reason
290290
}
291291
}

0 commit comments

Comments
 (0)