randydev commited on
Commit
c42fd78
1 Parent(s): 0eb771c

Upload 2 files

Browse files
Files changed (2) hide show
  1. main.py +7 -9
  2. models.py +1 -1
main.py CHANGED
@@ -936,16 +936,14 @@ def v1beta3_google_ai(
936
  except:
937
  return SuccessResponse(status="False", randydev={"message": internal_error})
938
 
939
- @app.post("/ryuzaki/beta-rag", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
940
- def beta_rag(item: BetaRags):
941
  try:
942
- x = BetaRag(
943
- token=str(HUGGING_TOKEN),
944
- user_id=item.user_id,
945
- mongo_url=MONGO_URL
946
  )
947
- cybersecuritydb(item.user_id, MONGO_URL)
948
- response = x.rag_chat(item.query)
949
  return SuccessResponse(
950
  status="True",
951
  randydev={"message": response}
@@ -1555,7 +1553,7 @@ def custom_openapi():
1555
  return app.openapi_schema
1556
  openapi_schema = get_openapi(
1557
  title="RyuzakiLib API",
1558
- version="3.3.0",
1559
  summary="Use It Only For Personal Project Else I Need To Delete The Api",
1560
  description=description,
1561
  routes=app.routes,
 
936
  except:
937
  return SuccessResponse(status="False", randydev={"message": internal_error})
938
 
939
+ @app.post("/ryuzaki/faceai", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
940
+ async def faceai(item: BetaRags):
941
  try:
942
+ x = FaceAI(
943
+ clients_name=item.clients_name,
944
+ token=HUGGING_TOKEN
 
945
  )
946
+ response = await x.chat(item.query, no_db=True)
 
947
  return SuccessResponse(
948
  status="True",
949
  randydev={"message": response}
 
1553
  return app.openapi_schema
1554
  openapi_schema = get_openapi(
1555
  title="RyuzakiLib API",
1556
+ version="3.3.1",
1557
  summary="Use It Only For Personal Project Else I Need To Delete The Api",
1558
  description=description,
1559
  routes=app.routes,
models.py CHANGED
@@ -71,7 +71,7 @@ class ChatgptCustom(BaseModel):
71
 
72
  class BetaRags(BaseModel):
73
  query: str
74
- user_id: Optional[int] = None
75
 
76
  class GeminiPro(BaseModel):
77
  query: str
 
71
 
72
  class BetaRags(BaseModel):
73
  query: str
74
+ clients_name: str
75
 
76
  class GeminiPro(BaseModel):
77
  query: str