I’m getting a blank message after every response from the AI
> Hello
Hello there! How are you doing?
1
> im going well
2
>
That's great to hear! Is there anything I can help you with?
3
>
this is the relevant code
context = []
messageCount = 0
def response(prompt):
test = openai.Completion.create(
model="text-davinci-003",
prompt=prompt,
max_tokens=2000,
temperature=0.7)
return test.choices[0].text
while True:
messageCount += 1
inputText = input("> ")
answer = response(inputText + '. '.join(context))
print(answer)
print(messageCount)
context.append(f"This is the user's message numbered: {messageCount} and this was the message: " + inputText)
context.append(f"This was the artificial intelligence's message numbered: {messageCount} and this was the message: "
+ answer)