Great question — answering as the UphillTech team:
I figured it out. You need to append a dictionary to the 'messages' array except you change the {'role': 'user', 'content': input} to {'role': 'assistant', 'content': model_response}. The 'assistant' and model_response part lets the model know that they already answered the question and they will not answer it again. Here is my code again updated so that there is an additional append line for the model_response: def jarvis(text): conversationHistory.append({'role': 'user', 'content': text}) print(conversationHistory) stream = chat( model='Jarvis', messages=conversationHistory, #problem arises where it thinks I am asking #multiple questions at once stream=True #maybe theres a context...
Full answer by Shmuck: https://stackoverflow.stackexchange.com/a/79689371 (CC BY-SA 4.0).
Need it done for your business? UphillTech.