mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-05 00:01:00 +00:00
added an if-statement for ending loop
Instead of pressing Ctrl+c to end program. It is easier and less messy for ending chatbot
This commit is contained in:
parent
25428d58d5
commit
81480d0c7e
@ -25,7 +25,8 @@ chat = []
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
prompt = input("You: ")
|
prompt = input("You: ")
|
||||||
|
if prompt == 'q':
|
||||||
|
break
|
||||||
response = you.Completion.create(
|
response = you.Completion.create(
|
||||||
prompt=prompt,
|
prompt=prompt,
|
||||||
chat=chat)
|
chat=chat)
|
||||||
@ -33,4 +34,4 @@ while True:
|
|||||||
print("Bot:", response["response"])
|
print("Bot:", response["response"])
|
||||||
|
|
||||||
chat.append({"question": prompt, "answer": response["response"]})
|
chat.append({"question": prompt, "answer": response["response"]})
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user