-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathterminal.py
More file actions
24 lines (21 loc) · 817 Bytes
/
Copy pathterminal.py
File metadata and controls
24 lines (21 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import logging
from controller import Controller
# Configure the logging settings
logging.basicConfig(filename='debug.log', filemode='a', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
def main():
print("Ask any question about the data. Enter 'q' to quit. Enter 'r' to reset ChatGPT.")
controller = Controller()
while True:
user_input = input("Question: ")
if user_input.lower() == 'q':
break
if user_input == "r":
controller.chatModel.reset()
continue
try:
result = controller.run(message=user_input, sender="USER")
print(f"ChatGPT: {result}")
except ValueError:
print("Invalid input. Please enter a number or 'q' to quit.")
if __name__ == "__main__":
main()