randydev commited on
Commit
bbc7e16
·
1 Parent(s): e863fc4

Upload main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -1
main.py CHANGED
@@ -557,9 +557,14 @@ def v1beta3_google_ai(query: str, api_key: None = Depends(validate_api_key)):
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"]
 
557
  @app.post("/ryuzaki/gemini-ai-pro")
558
  def gemini_pro(
559
  query: str,
560
+ bard_api_key: str=None,
561
+ is_login: bool=False,
562
  api_key: None = Depends(validate_api_key)
563
  ):
564
+ if is_login:
565
+ token = bard_api_key
566
+ else:
567
+ token = COOKIE_BARD_TOKEN
568
  try:
569
  bard = Bard(token=token)
570
  message = bard.get_answer(query)["content"]