From 5e366a312d816866820f8ee531b5968037ea6ea9 Mon Sep 17 00:00:00 2001 From: tutor-temple Date: Sat, 11 Feb 2023 15:22:59 +0000 Subject: [PATCH] further integration to chatgpt --- alpha_main.py | 68 +++++++++--------- modules/__pycache__/chatgpt.cpython-37.pyc | Bin 645 -> 662 bytes modules/__pycache__/mainsystem.cpython-37.pyc | Bin 0 -> 1924 bytes modules/chatgpt.py | 2 +- modules/mainsystem.py | 2 +- test.py | 3 - 6 files changed, 34 insertions(+), 41 deletions(-) create mode 100644 modules/__pycache__/mainsystem.cpython-37.pyc delete mode 100644 test.py diff --git a/alpha_main.py b/alpha_main.py index 5d68c1f..001471a 100644 --- a/alpha_main.py +++ b/alpha_main.py @@ -30,51 +30,47 @@ def alpha_main(): res=re.findall(r'\".*?\"', test) input = res[1] input =input.strip('\"') - if input.startswith("alpha"): + print(input) + if input.startswith("hello"): + input = input.replace("hello","") if input=="alpha": speak("How can I help you?") + else: if input == "": continue else: print("USER INPUTL: "+ input) - if mute == 1: - if "unmute" in input: - mute = 0 - continue + print("Output: ") #comment this line + #### continue all your shit below + if input.startswith("mute"): + mute =1 + continue + if "weather" in input: + if "in " in input: + input_city= re.search("^in: (\w+)",input) + target=input_city.groups() + weathermain(target) else: - continue - elif mute ==0: - print("Output: ") #comment this line - #### continue all your shit below - if input.startswith("mute"): - mute =1 - continue - if "weather" in input: - if "in " in input: - input_city= re.search("^in: (\w+)",input) - target=input_city.groups() - weathermain(target) - else: - weathermain(checkuserdata()[1]) - elif "check" and "memory" in input: - checkram() - elif "check" and "cpu" in input: - checkcpu() - elif "check" and "battery" in input: - checkbattery() - elif "check" and "system" in input: - systemstats() - elif "flush" and "dns" in input: - flushdns() - elif input.startswith("shutdown"): - speak("Shutdown protocol has been executed") - shutdown_s() - elif "kill program" in input: - kill() + weathermain(checkuserdata()[1]) + elif "check" and "memory" in input: + checkram() + elif "check" and "cpu" in input: + checkcpu() + elif "check" and "battery" in input: + checkbattery() + elif "check" and "system" in input: + systemstats() + elif "flush" and "dns" in input: + flushdns() + elif input.startswith("shut down"): + speak("Shutdown protocol has been executed") + shutdown_s() + elif "kill program" in input: + kill() - else: - chatgpt(input) + else: + chatgpt(input) else: continue diff --git a/modules/__pycache__/chatgpt.cpython-37.pyc b/modules/__pycache__/chatgpt.cpython-37.pyc index 2932c41b5b8bc7e048ac76a4b795c8f706d88853..89df4bc5e162f4723a161ebf8b3d9cf2668cbe17 100644 GIT binary patch delta 125 zcmZo=oyN-R#LLUY00eh0-%0*HkvE6YYhslnQwhh!tqU1BCxG-o_w3p sT}}d|mXVE-g^`1ajgbisIhc4Div%Y-F)51*0#y`&^dJ!eldG6y0EOZdp8x;= diff --git a/modules/__pycache__/mainsystem.cpython-37.pyc b/modules/__pycache__/mainsystem.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d410bc0b14b328b01715590fc9a019173c7cefff GIT binary patch literal 1924 zcmaJ?OOM+&5T>5i`k77Ari(tJ9C|QN*a&(kkUr2h0eUkEq`3$N46R7p+?6bqq|(^% z9*WHmNsc}A2UXXe`WJfYM@oJyVAKLM%-gFC5{xsluGyvQ?We&kb^dT&Y8qCRbb2Q;8(;AgZ=JK$~F zr9JQt?b88xm)@i2;5~YuJ^=4i`z0AZ{0E-N(5l)p5sa?wY5wM+&GiX#V<=1CZ!N;r9u&BVJYJU z3%LxdR>4F9_0X&QLY9iBRsS^?s*KZF#j0Ez8U44{5QCr&&(Rl*wrp^Oamn#j;Vc zu7YIAl52$6fiY>SX9ZRpE3iZtx;-owggq=@Ksbg4pb+IWpg3D%z;XTul;=OcI)Gx5 z9lFAU)vA*e<*Wfow4kX`u$oYDY7(!Bj#~6V?qlu4*TExvtv?<9p{iH54qOKeeyD1l zfO|KAC&yL2jFnO=+-EtU&8YhJBOdX!N#XioO&YWxq0Rb5k@=B0~6 zhIM(6;l1Mwu_wAnrf)yQMv+@6lx3)`sp(H^GIUI74M4`m5uzpp4Qth@yF{v3$q)*O ziG~Lsk2uF}53Nqg!7`31Ho7yY_1@CpQVh)_O!gy!v4MUI{f)h~-#Hj5XX{Y+g50>^ z9=HeYgZmgPw;3?6;lAcuck6Baxq~rlO*S7al`7=3@i;E{h!=dm9_3=OdAw6Em>Mlu zekDgdAHRM&=EWG|c;k((WWK80gsXMr3%1~pT1j56lvrah1HpbRnN+fJV4`vrdjo2| z@e08)ysgOR#Vn?@a!Qd#U6`HiK8gY@(OAVocO|YDAjrf6?2mA+AXxqfXAx$g5F$FyR0rYI?cX2FXy~S^3|L##`Cn4OS+Pq&Wp**&`6A; z3qOHn@u?;{nUgUEyKle38&cnj1lWkj;CEu$Uricwg})cmHm3JY*K0(sd7ARoA}mC{ zz?C<&joZp)Z@4!kJLw#!U u)VJx;$mtO>MK$=EgpBc%fdt>wroYq9b literal 0 HcmV?d00001 diff --git a/modules/chatgpt.py b/modules/chatgpt.py index 6d52e71..27284d1 100644 --- a/modules/chatgpt.py +++ b/modules/chatgpt.py @@ -16,4 +16,4 @@ def chatgpt(prompt): ) response = completion.choices[0].text speak(response) - print(response) \ No newline at end of file + print(response) diff --git a/modules/mainsystem.py b/modules/mainsystem.py index 5fe13b0..0daad73 100644 --- a/modules/mainsystem.py +++ b/modules/mainsystem.py @@ -1,7 +1,7 @@ #this file is code for any functions related to the windows operating system from pyautogui import screenshot import psutil -from sense import speak +from modules.sense import speak import requests import os #this program defines all possible ways to access computer statistic diff --git a/test.py b/test.py deleted file mode 100644 index 1a54ac6..0000000 --- a/test.py +++ /dev/null @@ -1,3 +0,0 @@ -from modules.bootloader import checkuserdata -username = checkuserdata()[1] -print(username) \ No newline at end of file