Bugfix/increase tokens (#132)
* feat(api.ts): add support for OPENAI_MAX_TOKENS environment variable feat(config.ts): add OPENAI_MAX_TOKENS to CONFIG_KEYS and configValidators * 2.0.2 * 2.0.3 * docs(README.md): add GPT-4 usage instructions and mention the cost difference compared to GPT-3.5-turbo --------- Co-authored-by: di-sukharev <dim.sukharev@gmail.com>
This commit is contained in:
committed by
GitHub
parent
42c26cbaaa
commit
3f5df6ef7c
+2
-1
@@ -13,6 +13,7 @@ const config = getConfig();
|
||||
|
||||
let apiKey = config?.OPENAI_API_KEY;
|
||||
let basePath = config?.OPENAI_BASE_PATH;
|
||||
let maxTokens = config?.OPENAI_MAX_TOKENS;
|
||||
|
||||
const [command, mode] = process.argv.slice(2);
|
||||
|
||||
@@ -53,7 +54,7 @@ class OpenAi {
|
||||
messages,
|
||||
temperature: 0,
|
||||
top_p: 0.1,
|
||||
max_tokens: 196
|
||||
max_tokens: maxTokens ?? 196
|
||||
});
|
||||
|
||||
const message = data.choices[0].message;
|
||||
|
||||
Reference in New Issue
Block a user