We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39f34d9 commit a51e1abCopy full SHA for a51e1ab
service/src/chatgpt/index.ts
@@ -39,6 +39,19 @@ let api: ChatGPTAPI | ChatGPTUnofficialProxyAPI
39
debug: true,
40
}
41
42
+ // increase max token limit if use gpt-4
43
+ if (model.toLowerCase().includes('gpt-4')) {
44
+ // if use 32k model
45
+ if (model.toLowerCase().includes('32k')) {
46
+ options.maxModelTokens = 32768
47
+ options.maxResponseTokens = 8192
48
+ }
49
+ else {
50
+ options.maxModelTokens = 8192
51
+ options.maxResponseTokens = 2048
52
53
54
+
55
if (isNotEmptyString(OPENAI_API_BASE_URL))
56
options.apiBaseUrl = `${OPENAI_API_BASE_URL}/v1`
57
0 commit comments