We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8eb9e50 commit 0ffdfddCopy full SHA for 0ffdfdd
service/src/chatgpt/index.ts
@@ -43,9 +43,20 @@ export async function initApi() {
43
debug: true,
44
}
45
46
- if (isNotEmptyString(config.apiBaseUrl))
47
- options.apiBaseUrl = config.apiBaseUrl
+ if (model.toLowerCase().includes('gpt-4')) {
+ // if use 32k model
48
+ if (model.toLowerCase().includes('32k')) {
49
+ options.maxModelTokens = 32768
50
+ options.maxResponseTokens = 8192
51
+ }
52
+ else {
53
+ options.maxModelTokens = 8192
54
+ options.maxResponseTokens = 2048
55
56
57
58
+ if (isNotEmptyString(config.apiBaseUrl))
59
+ options.apiBaseUrl = `${config.apiBaseUrl}/v1`
60
await setupProxy(options)
61
62
api = new ChatGPTAPI({ ...options })
0 commit comments