Skip to content

Commit 3e59443

Browse files
authored
fix(@effect/ai-openai): map max_output_tokens finish reason to length (#6297)
1 parent cfa2bbf commit 3e59443

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@effect/ai-openai": patch
3+
---
4+
5+
Map the OpenAI Responses `max_output_tokens` finish reason to `length` instead of falling through to `unknown`.

packages/ai/openai/src/internal/utilities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const finishReasonMap: Record<string, Response.FinishReason> = {
1111
content_filter: "content-filter",
1212
function_call: "tool-calls",
1313
length: "length",
14+
max_output_tokens: "length",
1415
stop: "stop",
1516
tool_calls: "tool-calls"
1617
}

0 commit comments

Comments
 (0)