For suggestions, we could use input to do back & forth between the user and ChatGPT.
# Assume messages is all the messages we sent prior as well as "assistant responses"
messages.append(completion["choices"][0]["message"])
user_input = input("chat> ")
while user_input is not "":
user_message = {"role": "user", "content": user_input}
messages.append(user_message)
completion = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=messages,
)
assistant_message = completion["choices"][0]["message"]
messages.append(assistant_message)
display(
{
"text/plain": assistant_message["content"],
"text/markdown": assistant_message["content"],
},
raw=True,
)
user_input = input("chat> ")
It's not the best user experience. However, it'll work across all the jupyter platforms, even ipython at the command line.
For suggestions, we could use
input
to do back & forth between the user and ChatGPT.It's not the best user experience. However, it'll work across all the jupyter platforms, even
ipython
at the command line.