Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing finish_reason to OpenAI output types #766

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-sloths-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"inngest": patch
---

Add missing `finish_reason` to OpenAI output types
10 changes: 10 additions & 0 deletions packages/inngest/src/components/ai/adapters/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,16 @@ export interface OpenAiAiAdapter extends AiAdapter {
* greater than 1.
*/
choices: {
/**
* The reason the model stopped generating tokens. This will be `stop`
* if the model hit a natural stop point or a provided stop sequence,
* `length` if the maximum number of tokens specified in the request was
* reached, `content_filter` if content was omitted due to a flag from
* our content filters, `tool_calls` if the model called a tool, or
* `function_call` (deprecated) if the model called a function.
*/
finish_reason: string;

/**
* The index of the choice in the list of choices.
*/
Expand Down
Loading