#So i used ChatGPT to make a chatbot using GPT API key, and results are bad....

8 messages · Page 1 of 1 (latest)

fickle creek
#

it's almost as if it can't reply based on chat history. but it replies right when i ask directly

spring urchin
#

you can use concat method. connect the last question and answer to the next prompt. When sencondly asking. AI will know the context. Sorry for my poor English. Hope you can get it!

hidden cypress
#

I determine the most relevant parts of the conversation using embeddings.

fickle creek
#

check out the script on github

hidden cypress
#

Yeah, the way you are doing it, eventually the script will break because chat_history will be larger than the token limit. You can get the number of tokens of a string using tiktoken if you want to dynamically change the prompt and max_tokens.