Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
feat: add gpt-4-1106-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-omori committed Dec 13, 2023
1 parent 64b97c4 commit 74cfc67
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 27 deletions.
37 changes: 22 additions & 15 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 22 additions & 12 deletions src/limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,28 @@ export class TokenLimits {

constructor(model = 'gpt-3.5-turbo') {
this.knowledgeCutOff = '2021-09-01'
if (model === 'gpt-4-32k') {
this.maxTokens = 32600
this.responseTokens = 4000
} else if (model === 'gpt-3.5-turbo-16k') {
this.maxTokens = 16300
this.responseTokens = 3000
} else if (model === 'gpt-4') {
this.maxTokens = 8000
this.responseTokens = 2000
} else {
this.maxTokens = 4000
this.responseTokens = 1000
switch (model) {
case 'gpt-4-1106-preview':
this.maxTokens = 128000
this.responseTokens = 4000
this.knowledgeCutOff = '2023-04-01'
break
case 'gpt-4':
this.maxTokens = 8000
this.responseTokens = 2000
break
case 'gpt-4-32k':
this.maxTokens = 32600
this.responseTokens = 4000
break
case 'gpt-3.5-turbo-16k':
this.maxTokens = 16300
this.responseTokens = 3000
break
default:
this.maxTokens = 4000
this.responseTokens = 1000
break
}
// provide some margin for the request tokens
this.requestTokens = this.maxTokens - this.responseTokens - 100
Expand Down

0 comments on commit 74cfc67

Please sign in to comment.