This repository was archived by the owner on Mar 6, 2024. It is now read-only.
File tree 2 files changed +44
-27
lines changed
2 files changed +44
-27
lines changed Original file line number Diff line number Diff line change @@ -6,18 +6,28 @@ export class TokenLimits {
6
6
7
7
constructor ( model = 'gpt-3.5-turbo' ) {
8
8
this . knowledgeCutOff = '2021-09-01'
9
- if ( model === 'gpt-4-32k' ) {
10
- this . maxTokens = 32600
11
- this . responseTokens = 4000
12
- } else if ( model === 'gpt-3.5-turbo-16k' ) {
13
- this . maxTokens = 16300
14
- this . responseTokens = 3000
15
- } else if ( model === 'gpt-4' ) {
16
- this . maxTokens = 8000
17
- this . responseTokens = 2000
18
- } else {
19
- this . maxTokens = 4000
20
- this . responseTokens = 1000
9
+ switch ( model ) {
10
+ case 'gpt-4-1106-preview' :
11
+ this . maxTokens = 128000
12
+ this . responseTokens = 4000
13
+ this . knowledgeCutOff = '2023-04-01'
14
+ break
15
+ case 'gpt-4' :
16
+ this . maxTokens = 8000
17
+ this . responseTokens = 2000
18
+ break
19
+ case 'gpt-4-32k' :
20
+ this . maxTokens = 32600
21
+ this . responseTokens = 4000
22
+ break
23
+ case 'gpt-3.5-turbo-16k' :
24
+ this . maxTokens = 16300
25
+ this . responseTokens = 3000
26
+ break
27
+ default :
28
+ this . maxTokens = 4000
29
+ this . responseTokens = 1000
30
+ break
21
31
}
22
32
// provide some margin for the request tokens
23
33
this . requestTokens = this . maxTokens - this . responseTokens - 100
You can’t perform that action at this time.
0 commit comments