Skip to content

Commit

Permalink
feat: openai new model (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
okisdev authored Nov 7, 2023
1 parent 8de4445 commit 243c1ce
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
32 changes: 31 additions & 1 deletion config/provider/openai.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,49 @@ export const openAIModelConfig: openAIModelConfig[] = [
maxTokens: 8192,
price: 0.06 / 1000,
},
{
model: 'gpt-4-0613',
maxTokens: 8192,
price: 0.06 / 1000,
},
{
model: 'gpt-4-1106-preview',
maxTokens: 128000,
price: 0.04 / 1000,
},
{
model: 'gpt-4-vision-preview',
maxTokens: 128000,
price: 0.04 / 1000,
},
{
model: 'gpt-4-32k',
maxTokens: 32768,
price: 0.12 / 1000,
},
{
model: 'gpt-4-32k-0613',
maxTokens: 32768,
price: 0.12 / 1000,
},
{
model: 'gpt-3.5-turbo',
maxTokens: 4096,
price: 0.002 / 1000,
},
{
model: 'gpt-3.5-turbo-16k',
maxTokens: 16384,
maxTokens: 16385,
price: 0.004 / 1000,
},
{
model: 'gpt-3.5-turbo-1106',
maxTokens: 16385,
price: 0.003 / 1000,
},
{
model: 'gpt-3.5-turbo-instruct',
maxTokens: 4096,
price: 0.0035 / 1000,
},
];
12 changes: 11 additions & 1 deletion types/openai.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
type OpenAIModel = 'gpt-4' | 'gpt-4-32k' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k';
type OpenAIModel =
| 'gpt-4'
| 'gpt-4-0613'
| 'gpt-4-1106-preview'
| 'gpt-4-vision-preview'
| 'gpt-4-32k'
| 'gpt-4-32k-0613'
| 'gpt-3.5-turbo'
| 'gpt-3.5-turbo-16k'
| 'gpt-3.5-turbo-1106'
| 'gpt-3.5-turbo-instruct';
type OpenAIMessageRole = 'user' | 'system' | 'assistant';

interface OpenAIMessage {
Expand Down

1 comment on commit 243c1ce

@vercel
Copy link

@vercel vercel bot commented on 243c1ce Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

chat-chat – ./

chat-chat-okisdev.vercel.app
chatchat-main.vercel.app
chat-chat-git-main-okisdev.vercel.app

Please sign in to comment.