I have created a basic ChatBot using OpenAI with the following code:
import openai
openai.api_key = "sk-xxx"
while True:
prompt = input("User:")
response = openai.Completion.create(
model="text-davinci-003",
prompt=prompt,
max_tokens=50,
temperature=0,
)
print(response.choices[0].text)
This is the input and output:
And in text form:
User:What is python
Python is a high-level, interpreted, general-purpose programming language. It is a powerful and versatile language that is used for a wide range of applications, from web development and software development to data science and machine learning.`
User:What is the Latest Version of it?
The latest version of Microsoft Office is Microsoft Office 2019.
As you can see i am asking questions related to python and asking version of it gives answer related to Microsoft Office, whereas when asking the same question to ChatGpt it remembers the previous conservation and acts according to it.
Is there any solution for remembering the conversation?