change max_tokens from null to undefined

issue #248
This commit is contained in:
Jing Hua 2023-05-03 13:53:05 +08:00
parent c0d402d469
commit d2d14876c1

View file

@ -22,7 +22,7 @@ export const getChatCompletion = async (
body: JSON.stringify({ body: JSON.stringify({
messages, messages,
...config, ...config,
max_tokens: null, max_tokens: undefined,
}), }),
}); });
if (!response.ok) throw new Error(await response.text()); if (!response.ok) throw new Error(await response.text());
@ -51,7 +51,7 @@ export const getChatCompletionStream = async (
body: JSON.stringify({ body: JSON.stringify({
messages, messages,
...config, ...config,
max_tokens: null, max_tokens: undefined,
stream: true, stream: true,
}), }),
}); });