File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ const askClient = async ({
23
23
} ;
24
24
25
25
const azure = process . env . AZURE_OPENAI_API_KEY ? true : false ;
26
- const max_tokens = ( model === " gpt-4" ) ? 7200 : ( model === " gpt-4-32k" ) ? 31000 : 3071 ;
26
+ const maxContextTokens = model === ' gpt-4' ? 8191 : model === ' gpt-4-32k' ? 32767 : 4095 ; // 1 less than maximum
27
27
const clientOptions = {
28
28
reverseProxyUrl : process . env . OPENAI_REVERSE_PROXY || null ,
29
29
azure,
30
+ maxContextTokens,
30
31
modelOptions : {
31
- model : model ,
32
- max_tokens : max_tokens ,
32
+ model,
33
33
temperature,
34
34
top_p,
35
35
presence_penalty,
@@ -38,22 +38,22 @@ const askClient = async ({
38
38
chatGptLabel,
39
39
promptPrefix,
40
40
proxy : process . env . PROXY || null ,
41
- debug : false
41
+ // debug: true
42
42
} ;
43
43
44
44
let apiKey = process . env . OPENAI_KEY ;
45
45
46
46
if ( azure ) {
47
47
apiKey = process . env . AZURE_OPENAI_API_KEY ;
48
- clientOptions . reverseProxyUrl = genAzureEndpoint ( {
49
- azureOpenAIApiInstanceName : process . env . AZURE_OPENAI_API_INSTANCE_NAME ,
50
- azureOpenAIApiDeploymentName : process . env . AZURE_OPENAI_API_DEPLOYMENT_NAME ,
48
+ clientOptions . reverseProxyUrl = genAzureEndpoint ( {
49
+ azureOpenAIApiInstanceName : process . env . AZURE_OPENAI_API_INSTANCE_NAME ,
50
+ azureOpenAIApiDeploymentName : process . env . AZURE_OPENAI_API_DEPLOYMENT_NAME ,
51
51
azureOpenAIApiVersion : process . env . AZURE_OPENAI_API_VERSION
52
52
} ) ;
53
53
}
54
54
55
55
const client = new ChatGPTClient ( apiKey , clientOptions , store ) ;
56
-
56
+
57
57
const options = {
58
58
onProgress,
59
59
abortController,
You can’t perform that action at this time.
0 commit comments