Spaces:
Running
Running
Update app.py
#1
by
acecalisto3
- opened
app.py
CHANGED
@@ -222,17 +222,25 @@ class App:
|
|
222 |
else:
|
223 |
return None, f"Error: Failed to parse action from NLP response\n"
|
224 |
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
|
|
229 |
while True:
|
230 |
-
|
|
|
|
|
|
|
|
|
|
|
231 |
output, system_message = self.process_input(input_text)
|
232 |
if output:
|
233 |
print(output)
|
234 |
if system_message:
|
235 |
print(system_message)
|
|
|
|
|
236 |
|
237 |
|
238 |
if __name__ == "__main__":
|
|
|
222 |
else:
|
223 |
return None, f"Error: Failed to parse action from NLP response\n"
|
224 |
|
225 |
+
def run(self):
|
226 |
+
print("Welcome to the Python App Builder!")
|
227 |
+
print("Type 'help' to see the available commands.")
|
228 |
+
print("-" * 50)
|
229 |
+
try:
|
230 |
while True:
|
231 |
+
try:
|
232 |
+
input_text = input("Enter input: ")
|
233 |
+
except EOFError:
|
234 |
+
print("Error: Input reading interrupted. Please provide valid input.")
|
235 |
+
continue
|
236 |
+
|
237 |
output, system_message = self.process_input(input_text)
|
238 |
if output:
|
239 |
print(output)
|
240 |
if system_message:
|
241 |
print(system_message)
|
242 |
+
except KeyboardInterrupt:
|
243 |
+
print("\nApplication stopped by user.")
|
244 |
|
245 |
|
246 |
if __name__ == "__main__":
|