#So i used ChatGPT to make a chatbot using GPT API key, and results are bad....
8 messages · Page 1 of 1 (latest)
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!
You need to feed the chat history inside the prompt call. This is how I did it in my project:
I determine the most relevant parts of the conversation using embeddings.
i managed to make it consider chat history
check out the script on github
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.