-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsecgpt_main.py
33 lines (25 loc) · 989 Bytes
/
secgpt_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from helpers.utilities.setup_environment import setup_environment
from helpers.configs.configuration import Configs
def main(user_id, debug=True, functionalities_path=None, test_queries=None):
# Get the mode from the configuration file
Configs.set_debug_mode(debug)
Configs.set_user_id(user_id)
if functionalities_path:
Configs.set_functionalities_path(functionalities_path)
# Set up all necessary environment variables and perform initializations
setup_environment()
# Initialize Hub
from hub.hub import Hub
hub = Hub()
if debug:
for query in test_queries:
hub.query_process(query)
else:
print("Message SecGPT (enter '/exit' to end the conversation)...")
while True:
query = input("You: ")
if query.lower() == "/exit":
break
hub.query_process(query)
if __name__=='__main__':
main('0', debug=False)