logankilpatrick / ChatGPT-Simple

Build a simple locally hosted version of ChatGPT in less than 100 lines of code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

You’re going to want to add chat history to OpenAI call

yisding opened this issue · comments

~2 more lines of python + post from client

Maybe GPT 4 can do it based on this description?

More detailed instructions you can try feeding to GPT:

In JavaScript, store entire chat history as an array of objects with fields for user or agent and utterance text. POST entire history with new utterance to API.

In Python, take inputs from request.json. Send chat history and new text to openai.