randydev commited on
Commit
e863fc4
1 Parent(s): dafb62e

Upload main.py

Browse files
Files changed (1) hide show
  1. main.py +21 -0
main.py CHANGED
@@ -65,6 +65,8 @@ from RyuzakiLib.hackertools.chatgpt import RendyDevChat
65
  from RyuzakiLib.hackertools.openai import OpenAiToken
66
  from RyuzakiLib.mental import BadWordsList
67
 
 
 
68
  import logging
69
  import functions as code
70
 
@@ -87,6 +89,7 @@ SOURCE_CALLI_GRAPHY_URL = os.environ["SOURCE_CALLI_GRAPHY_URL"]
87
  SOURCE_WHAT_GAY_URL = os.environ["SOURCE_WHAT_GAY_URL"]
88
  SOURCE_ASSISTANT_GOOGLE_AI = os.environ["SOURCE_ASSISTANT_GOOGLE_AI"]
89
  ASSISTANT_GOOGLE_API_KEYS = os.environ["ASSISTANT_GOOGLE_API_KEYS"]
 
90
 
91
  client_mongo = MongoClient(MONGO_URL)
92
  db = client_mongo["tiktokbot"]
@@ -551,6 +554,24 @@ def v1beta3_google_ai(query: str, api_key: None = Depends(validate_api_key)):
551
  except:
552
  return {"status": "false", "message": "Error response."}
553
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  @app.post("/ryuzaki/v1beta2-google-ai")
555
  def v1beta2_google_ai(
556
  query: str,
 
65
  from RyuzakiLib.hackertools.openai import OpenAiToken
66
  from RyuzakiLib.mental import BadWordsList
67
 
68
+ from bardapi import Bard
69
+
70
  import logging
71
  import functions as code
72
 
 
89
  SOURCE_WHAT_GAY_URL = os.environ["SOURCE_WHAT_GAY_URL"]
90
  SOURCE_ASSISTANT_GOOGLE_AI = os.environ["SOURCE_ASSISTANT_GOOGLE_AI"]
91
  ASSISTANT_GOOGLE_API_KEYS = os.environ["ASSISTANT_GOOGLE_API_KEYS"]
92
+ COOKIE_BARD_TOKEN = os.environ["COOKIE_BARD_TOKEN"]
93
 
94
  client_mongo = MongoClient(MONGO_URL)
95
  db = client_mongo["tiktokbot"]
 
554
  except:
555
  return {"status": "false", "message": "Error response."}
556
 
557
+ @app.post("/ryuzaki/gemini-ai-pro")
558
+ def gemini_pro(
559
+ query: str,
560
+ api_key: None = Depends(validate_api_key)
561
+ ):
562
+ token = COOKIE_BARD_TOKEN
563
+ try:
564
+ bard = Bard(token=token)
565
+ message = bard.get_answer(query)["content"]
566
+ return {
567
+ "status": "true",
568
+ "randydev":{
569
+ "message": message
570
+ }
571
+ }
572
+ except:
573
+ return {"status": "false", "message": "Error response."}
574
+
575
  @app.post("/ryuzaki/v1beta2-google-ai")
576
  def v1beta2_google_ai(
577
  query: str,