randydev commited on
Commit
02d4619
1 Parent(s): 70b712d

Upload 2 files

Browse files
Files changed (2) hide show
  1. main.py +20 -1
  2. models.py +5 -0
main.py CHANGED
@@ -68,6 +68,8 @@ from pymongo import MongoClient
68
  from RyuzakiLib.hackertools.chatgpt import RendyDevChat
69
  from RyuzakiLib.hackertools.gemini import GeminiLatest
70
  from RyuzakiLib.hackertools.openai_api import OpenAiToken
 
 
71
  from RyuzakiLib.mental import BadWordsList
72
  from RyuzakiLib.system import OpenReadSystem
73
 
@@ -844,6 +846,23 @@ def v1beta3_google_ai(
844
  except:
845
  return SuccessResponse(status="False", randydev={"message": internal_error})
846
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
847
  @app.post("/ryuzaki/gemini-ai-pro", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
848
  def gemini_pro(item: GeminiPro):
849
  owner_base = f"""
@@ -1438,7 +1457,7 @@ def custom_openapi():
1438
  return app.openapi_schema
1439
  openapi_schema = get_openapi(
1440
  title="RyuzakiLib API",
1441
- version="2.3.1",
1442
  summary="Use It Only For Personal Project Else I Need To Delete The Api",
1443
  description=description,
1444
  routes=app.routes,
 
68
  from RyuzakiLib.hackertools.chatgpt import RendyDevChat
69
  from RyuzakiLib.hackertools.gemini import GeminiLatest
70
  from RyuzakiLib.hackertools.openai_api import OpenAiToken
71
+ from RyuzakiLib.hackertools.huggingface import BetaRag
72
+
73
  from RyuzakiLib.mental import BadWordsList
74
  from RyuzakiLib.system import OpenReadSystem
75
 
 
846
  except:
847
  return SuccessResponse(status="False", randydev={"message": internal_error})
848
 
849
+ @app.post("/ryuzaki/beta-rag", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
850
+ def beta_rag(item: BetaRags):
851
+ try:
852
+ rag = BetaRag(
853
+ token=HUGGING_TOKEN,
854
+ user_id=item.user_id,
855
+ mongo_url=item.mongo_url
856
+ )
857
+ cybersecuritydb(item.user_id, item.mongo_url)
858
+ answer = rag.rag_chat(item.query)
859
+ return SuccessResponse(
860
+ status="True",
861
+ randydev={"message": answer}
862
+ )
863
+ except Exception:
864
+ return SuccessResponse(status="False", randydev={"message": contact_support})
865
+
866
  @app.post("/ryuzaki/gemini-ai-pro", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
867
  def gemini_pro(item: GeminiPro):
868
  owner_base = f"""
 
1457
  return app.openapi_schema
1458
  openapi_schema = get_openapi(
1459
  title="RyuzakiLib API",
1460
+ version="3.3.0",
1461
  summary="Use It Only For Personal Project Else I Need To Delete The Api",
1462
  description=description,
1463
  routes=app.routes,
models.py CHANGED
@@ -69,6 +69,11 @@ class ChatgptModel(BaseModel):
69
  class ChatgptCustom(BaseModel):
70
  query: str
71
 
 
 
 
 
 
72
  class GeminiPro(BaseModel):
73
  query: str
74
  bard_api_key: Optional[str] = None
 
69
  class ChatgptCustom(BaseModel):
70
  query: str
71
 
72
+ class BetaRags(BaseModel):
73
+ query: str
74
+ mongo_url: Optional[str] = None
75
+ user_id: Optional[int] = None
76
+
77
  class GeminiPro(BaseModel):
78
  query: str
79
  bard_api_key: Optional[str] = None