-
Notifications
You must be signed in to change notification settings - Fork 0
/
askwolf.py
73 lines (72 loc) · 2.57 KB
/
askwolf.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from backend.console_manager import manageconsole as mc
from backend.console_manager.menus import MunuPicker
from backend.connectwolf import WolfConnect
from backend.regiman import RegiMan
from resources import statics
from time import sleep
import sys
if __name__ == "__main__":
regmanager = RegiMan(
regpath=statics.RegVariables.HKEYPATH,
appname=statics.RegVariables.APPNAME
)
applist = regmanager.enum_reg()
regstatus = regmanager.check_regkey(
apps=applist
)
while regstatus == True:
appkey = regmanager.read_regkey()
mc.clear_console()
mainmenu = MunuPicker(title="Main Menu").show_mainmenu()
menu_choice = input("Enter an option: ").strip()
match menu_choice:
case "1":
query_input = input("Query: ")
ask_simple = WolfConnect(
appid=appkey,
query=query_input
)
mc.space(1)
print(f"Short Answer: {ask_simple.short_query()}")
mc.space(1)
print(f"Long Answer:\n{ask_simple.spoken_query()}")
mc.space(1)
simplecont_input = input(statics.SysResponses.CONT)
case "2":
comp_query = input("Query: ").strip()
ask_comp = WolfConnect(
appid=appkey,
query=comp_query
)
mc.space(1)
print(ask_comp.llm())
mc.space(1)
compcont_input = input(statics.SysResponses.CONT)
case "3": sys.exit(
statics.SysResponses.EXIT
)
else:
while True:
mc.clear_console()
mc.space(1)
setup_input = input(
statics.SetupResponses.QUESTION).upper().strip()
match setup_input:
case "Y":
print(statics.SetupResponses.WELCOME)
appid_input = input("Enter your APPID: ").strip()
regmanager.create_regkey(
appid=appid_input
)
print(statics.SetupResponses.APPID_SUCCESS)
mc.space(1)
sleep(5)
break
case "N":
print(statics.SetupResponses.REGKEY_STATUS_ERROR)
mc.space(1)
sleep(5)
break
case _:
print(statics.SetupResponses.INPUT_ERROR)
mc.space(1)