Skip to content

Commit

Permalink
ai/core: update OpenAI models for autocompletion. Fix gpt-4-turbo-cal…
Browse files Browse the repository at this point in the history
…ls (#1317)
  • Loading branch information
lgrammel authored Apr 10, 2024
1 parent 5cd29bd commit 8c40f8c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/great-students-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'ai': patch
---

ai/core: Fix openai provider streamObject for gpt-4-turbo
11 changes: 10 additions & 1 deletion packages/core/openai/openai-chat-language-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,16 @@ export class OpenAIChatLanguageModel implements LanguageModelV1 {
return {
...baseArgs,
tool_choice: { type: 'function', function: { name: mode.tool.name } },
tools: [{ type: 'function', function: mode.tool }],
tools: [
{
type: 'function',
function: {
name: mode.tool.name,
description: mode.tool.description,
parameters: mode.tool.parameters,
},
},
],
};
}

Expand Down
15 changes: 7 additions & 8 deletions packages/core/openai/openai-chat-settings.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
// https://platform.openai.com/docs/models
export type OpenAIChatModelId =
| 'gpt-4'
| 'gpt-4-0314'
| 'gpt-4-0613'
| 'gpt-4-turbo'
| 'gpt-4-turbo-2024-04-09'
| 'gpt-4-turbo-preview'
| 'gpt-4-1106-preview'
| 'gpt-4-0125-preview'
| 'gpt-4-1106-preview'
| 'gpt-4-vision-preview'
| 'gpt-4'
| 'gpt-4-0613'
| 'gpt-4-32k'
| 'gpt-4-32k-0314'
| 'gpt-4-32k-0613'
| 'gpt-3.5-turbo'
| 'gpt-3.5-turbo-0125'
| 'gpt-3.5-turbo'
| 'gpt-3.5-turbo-1106'
| 'gpt-3.5-turbo-0301'
| 'gpt-3.5-turbo-0613'
| 'gpt-3.5-turbo-16k'
| 'gpt-3.5-turbo-0613'
| 'gpt-3.5-turbo-16k-0613'
| (string & {});

Expand Down

0 comments on commit 8c40f8c

Please sign in to comment.