acheong08 / ChatGPT

Reverse engineered ChatGPT API
GNU General Public License v2.0
28k stars 4.48k forks source link

Support set max_tokens in the V3 ask api #1445

Closed gchust closed 1 year ago

gchust commented 1 year ago

I want to limit the response of openai api. Currently in revChatGPT, the max_tokens was calculated automatically.

Commit messages generated by chatgpt: feat(V3.py): add support for max_tokens parameter in Chatbot class to limit the number of tokens in a response refactor(V3.py): use min function to choose the smaller value between the current max_tokens and the new max_tokens parameter to ensure the response does not exceed the desired length