Spaces:
Running
Running
Upload main.py
Browse files
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 |
-
|
|
|
|
|
|
|
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"]
|