From 81480d0c7ea8f68e206258e3ccd1d36149faf861 Mon Sep 17 00:00:00 2001 From: naa <44613678+naa7@users.noreply.github.com> Date: Thu, 27 Apr 2023 23:48:55 -0400 Subject: added an if-statement for ending loop Instead of pressing Ctrl+c to end program. It is easier and less messy for ending chatbot --- you/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/you/README.md b/you/README.md index dbce37a5..25c20085 100644 --- a/you/README.md +++ b/you/README.md @@ -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"]}) -``` \ No newline at end of file +``` -- cgit v1.2.3