We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65efda1 commit 8da0b14Copy full SHA for 8da0b14
1 file changed
src/routes/messages/non-stream-translation.ts
@@ -274,8 +274,9 @@ export function translateToAnthropic(
274
// Merge content from all choices
275
let allTextBlocks: Array<AnthropicTextBlock> = []
276
let allToolUseBlocks: Array<AnthropicToolUseBlock> = []
277
- let stopReason: "stop" | "length" | "tool_calls" | "content_filter" | null = "stop" // default
278
-
+ let stopReason: "stop" | "length" | "tool_calls" | "content_filter" | null = null // default
+ stopReason = response.choices[0]?.finish_reason ?? stopReason;
279
+
280
// Process all choices to extract text and tool use blocks
281
for (const choice of response.choices) {
282
const textBlocks = getAnthropicTextBlocks(choice.message.content)
0 commit comments