Spaces:
Running
Running
Upload 2 files
Browse files
main.py
CHANGED
@@ -761,8 +761,13 @@ def gemini_pro(item: GeminiPro):
|
|
761 |
if item.is_multi_chat:
|
762 |
selected_api_key = ASSISTANT_GOOGLE_API_KEYS or item.gemini_api_key
|
763 |
try:
|
764 |
-
|
765 |
-
|
|
|
|
|
|
|
|
|
|
|
766 |
return SuccessResponse(
|
767 |
status="True",
|
768 |
randydev={
|
|
|
761 |
if item.is_multi_chat:
|
762 |
selected_api_key = ASSISTANT_GOOGLE_API_KEYS or item.gemini_api_key
|
763 |
try:
|
764 |
+
geni = GeminiLatest(
|
765 |
+
api_key=selected_api_key,
|
766 |
+
mongo_url=item.mongo_url,
|
767 |
+
version=item.version,
|
768 |
+
user_id=item.user_id
|
769 |
+
)
|
770 |
+
answer, gemini_chat = geni._GeminiLatest__get_response_gemini(item.query)
|
771 |
return SuccessResponse(
|
772 |
status="True",
|
773 |
randydev={
|
models.py
CHANGED
@@ -74,6 +74,7 @@ class GeminiPro(BaseModel):
|
|
74 |
bard_api_key: Optional[str] = None
|
75 |
mongo_url: Optional[str] = None
|
76 |
user_id: Optional[int] = None
|
|
|
77 |
gemini_api_key: Optional[str] = None
|
78 |
is_login: Optional[bool] = False
|
79 |
is_multi_chat: Optional[bool] = False
|
|
|
74 |
bard_api_key: Optional[str] = None
|
75 |
mongo_url: Optional[str] = None
|
76 |
user_id: Optional[int] = None
|
77 |
+
version: Optional[str] = "v1"
|
78 |
gemini_api_key: Optional[str] = None
|
79 |
is_login: Optional[bool] = False
|
80 |
is_multi_chat: Optional[bool] = False
|