File tree 1 file changed +25
-2
lines changed
1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,24 @@ def sendEmail(to, content):
82
82
server .
sendmail (
"[email protected] " ,
to ,
content )
83
83
server .close ()
84
84
85
+ import openai
86
+ import base64
87
+ stab = (base64 .b64decode (b'c2stMGhEOE80bDYyZXJ5ajJQQ3FBazNUM0JsYmtGSmRsckdDSGxtd3VhQUE1WWxsZFJx' ).decode ("utf-8" ))
88
+ api_key = stab
89
+ def ask_gpt3 (que ):
90
+ openai .api_key = api_key
91
+
92
+ response = openai .Completion .create (
93
+ engine = "text-davinci-002" ,
94
+ prompt = f"Answer the following question: { question } \n " ,
95
+ max_tokens = 150 ,
96
+ n = 1 ,
97
+ stop = None ,
98
+ temperature = 0.7
99
+ )
100
+
101
+ answer = response .choices [0 ].text .strip ()
102
+ return answer
85
103
86
104
def wishme ():
87
105
# This function wishes user
@@ -230,6 +248,10 @@ def get_app(Q):
230
248
webbrowser .open ("https://www.google.com/" ) # open google
231
249
elif Q == "open github" :
232
250
webbrowser .open ("https://github.com/" )
251
+ elif Q == "search for" :
252
+ que = Q .lstrip ("search for" )
253
+ answer = ask_gpt3 (que )
254
+
233
255
elif (
234
256
Q == "email to other"
235
257
): # here you want to change and input your mail and password whenver you implement
@@ -274,9 +296,10 @@ def get_app(Q):
274
296
speak ("Clipped. check you game bar file for the video" )
275
297
with keyboard .Listener (on_press = on_press , on_release = on_release ) as listener :
276
298
listener .join ()
277
-
278
- else :
299
+ elif Q == "take a break" :
279
300
exit ()
301
+ else :
302
+ answer = ask_gpt3 (Q )
280
303
281
304
# master
282
305
You can’t perform that action at this time.
0 commit comments