Adri6336 / gpt-voice-conversation-chatbot

Allows you to have an engaging and safely emotive spoken / CLI conversation with the AI ChatGPT / GPT-4 while giving you the option to let it remember things discussed.
GNU General Public License v3.0
298 stars 50 forks source link

response always got interrupted #14

Closed wyhauyeung closed 1 year ago

wyhauyeung commented 1 year ago

I am not sure if thats chatgpt API problems? for example if I asked to tell a story, the results are always broken, as if there is a limit of words in reply.. and I have to type "continue" to resume the chat..

Adri6336 commented 1 year ago

This has to do with the token limit per reply, it works similarly with the ChatGPT web app (tho idk what they set their limit to be). You can set the reply token maximum with the command "please set tokens to ". I find that setting it to 500 tokens usually gets everything almost every time.

The current default starts off at 150 tokens. I chose this default value so that more exchanges could be had before token recycling gets triggered. The recycling system is triggered whenever a request has more tokens in it than you are allowed, regardless of how many tokens are actually available (e.g. if max is 4000 and current is 3250, the system will get triggered if a request is made with a maximum of 760 tokens in the reply).

I noticed that I don't include the spelled out commands in the gptcli.py help section, only the functional ones (e.g. ones like !recycle()). I'll go about adding them in a bit