Update app.py
Browse files
app.py
CHANGED
@@ -78,8 +78,30 @@ def main(user):
|
|
78 |
# Initialize chatbot
|
79 |
chatbot = Chatbot(api_key=os.environ.get("test2"))
|
80 |
# Start chat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
while True:
|
82 |
-
PROMPT =
|
83 |
# if PROMPT.startswith("!"):
|
84 |
# if chatbot_commands(PROMPT):
|
85 |
# continue
|
|
|
78 |
# Initialize chatbot
|
79 |
chatbot = Chatbot(api_key=os.environ.get("test2"))
|
80 |
# Start chat
|
81 |
+
def get_input(var1):
|
82 |
+
"""
|
83 |
+
Multi-line input function
|
84 |
+
"""
|
85 |
+
# Display the prompt
|
86 |
+
print(user, end="")
|
87 |
+
|
88 |
+
# Initialize an empty list to store the input lines
|
89 |
+
lines = []
|
90 |
+
|
91 |
+
# Read lines of input until the user enters an empty line
|
92 |
+
while True:
|
93 |
+
line = input()
|
94 |
+
if line == "":
|
95 |
+
break
|
96 |
+
lines.append(line)
|
97 |
+
|
98 |
+
# Join the lines, separated by newlines, and store the result
|
99 |
+
user_input = "\n".join(lines)
|
100 |
+
|
101 |
+
# Return the input
|
102 |
+
return user_input
|
103 |
while True:
|
104 |
+
PROMPT = get_input("\nUser:\n")
|
105 |
# if PROMPT.startswith("!"):
|
106 |
# if chatbot_commands(PROMPT):
|
107 |
# continue
|