fix code to adjust max_tokens according to model selection (#263)

This commit is contained in:
Pawan Kumar 2023-05-14 21:46:38 +05:30 committed by GitHub
parent 56ea9563b8
commit 262b402606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,12 +23,13 @@ const askClient = async ({
};
const azure = process.env.AZURE_OPENAI_API_KEY ? true : false;
const max_tokens = (model === "gpt-4") ? 7200 : (model === "gpt-4-32k") ? 31000 : 3071;
const clientOptions = {
reverseProxyUrl: process.env.OPENAI_REVERSE_PROXY || null,
azure,
modelOptions: {
model: model,
max_tokens: max_tokens,
temperature,
top_p,
presence_penalty,