added an if-statement for ending loop

Instead of pressing Ctrl+c to end program. It is easier and less messy for ending chatbot
このコミットが含まれているのは:
naa 2023-04-27 23:48:55 -04:00 committed by GitHub
コミット 81480d0c7e
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更3行の追加2行の削除

ファイルの表示

@ -25,7 +25,8 @@ chat = []
while True:
prompt = input("You: ")
if prompt == 'q':
break
response = you.Completion.create(
prompt=prompt,
chat=chat)
@ -33,4 +34,4 @@ while True:
print("Bot:", response["response"])
chat.append({"question": prompt, "answer": response["response"]})
```
```