randydev commited on
Commit
f3d65c2
·
1 Parent(s): 9ecb143

Upload main.py

Browse files
Files changed (1) hide show
  1. main.py +30 -19
main.py CHANGED
@@ -65,6 +65,7 @@ from pymongo import MongoClient
65
  from RyuzakiLib.hackertools.chatgpt import RendyDevChat
66
  from RyuzakiLib.hackertools.openai_api import OpenAiToken
67
  from RyuzakiLib.mental import BadWordsList
 
68
 
69
  from bardapi import Bard
70
 
@@ -370,6 +371,22 @@ def sibyl_system(
370
  }
371
  )
372
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  @app.get("/ryuzaki/translate", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
374
  def get_translate(
375
  item: TranslateCustom,
@@ -523,12 +540,10 @@ def open_dalle(
523
  status_code=500,
524
  detail=CustomErrorResponseModel(detail=[{}])
525
  )
526
- headers = {"Content-Type": "image/jpeg"}
527
- return Response(
528
- content=encoded_string,
529
- media_type="image/jpeg",
530
- headers=headers
531
- )
532
 
533
  @app.post("/ryuzaki/anime-styled")
534
  def Anime_Styled(
@@ -553,12 +568,11 @@ def Anime_Styled(
553
  status_code=500,
554
  detail=CustomErrorResponseModel(detail=[{}])
555
  )
556
- headers = {"Content-Type": "image/jpeg"}
557
- return Response(
558
- content=encoded_string,
559
- media_type="image/jpeg",
560
- headers=headers
561
- )
562
 
563
  @app.post("/ryuzaki/unsplash")
564
  def image_unsplash(item: GetImageUnsplash):
@@ -579,13 +593,10 @@ def image_unsplash(item: GetImageUnsplash):
579
  status_code=500,
580
  detail=CustomErrorResponseModel(detail=[{}])
581
  )
582
- headers = {"Content-Type": "image/jpeg"}
583
- return Response(
584
- content=encoded_string,
585
- media_type="image/jpeg",
586
- headers=headers
587
- )
588
-
589
 
590
  @app.post("/ryuzaki/chatgpt-model", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
591
  def chatgpt_model(item: ChatgptModel):
 
65
  from RyuzakiLib.hackertools.chatgpt import RendyDevChat
66
  from RyuzakiLib.hackertools.openai_api import OpenAiToken
67
  from RyuzakiLib.mental import BadWordsList
68
+ from RyuzakiLib.system import OpenReadSystem
69
 
70
  from bardapi import Bard
71
 
 
371
  }
372
  )
373
 
374
+ @app.get("/ryuzaki/translate", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
375
+ def pypi_search(
376
+ item: TextCustom,
377
+ ):
378
+ try:
379
+ response = OpenReadSystem()
380
+ response.code_system = f"pip3 show {item.query}"
381
+ hack = response.show(read_system=True)
382
+ return SuccessResponse(
383
+ status="True",
384
+ randydev={"results": hack})
385
+ except:
386
+ return SuccessResponse(
387
+ status="True",
388
+ randydev={"message": "Error not responding"})
389
+
390
  @app.get("/ryuzaki/translate", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
391
  def get_translate(
392
  item: TranslateCustom,
 
540
  status_code=500,
541
  detail=CustomErrorResponseModel(detail=[{}])
542
  )
543
+ if encoded_string:
544
+ return SuccessResponse(status="True", randydev={"data": encoded_string})
545
+ else:
546
+ return SuccessResponse(status="False", randydev={"data": "Not found image data"})
 
 
547
 
548
  @app.post("/ryuzaki/anime-styled")
549
  def Anime_Styled(
 
568
  status_code=500,
569
  detail=CustomErrorResponseModel(detail=[{}])
570
  )
571
+ if encoded_string:
572
+ return SuccessResponse(status="True", randydev={"data": encoded_string})
573
+ else:
574
+ return SuccessResponse(status="False", randydev={"data": "Not found image data"})
575
+
 
576
 
577
  @app.post("/ryuzaki/unsplash")
578
  def image_unsplash(item: GetImageUnsplash):
 
593
  status_code=500,
594
  detail=CustomErrorResponseModel(detail=[{}])
595
  )
596
+ if encoded_string:
597
+ return SuccessResponse(status="True", randydev={"data": encoded_string})
598
+ else:
599
+ return SuccessResponse(status="False", randydev={"data": "Not found image data"})
 
 
 
600
 
601
  @app.post("/ryuzaki/chatgpt-model", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
602
  def chatgpt_model(item: ChatgptModel):