Spaces:
Running
Running
Upload main.py
Browse files
main.py
CHANGED
@@ -490,21 +490,34 @@ def chatgpt4_support(
|
|
490 |
return {"status": "false", "message": "Error response."}
|
491 |
|
492 |
@app.post("/ryuzaki/chatgpt-model")
|
493 |
-
def chatgpt_model(
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
)
|
498 |
-
|
499 |
-
|
|
|
|
|
500 |
return {
|
501 |
"status": "true",
|
502 |
"randydev":{
|
503 |
-
"message":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
504 |
}
|
505 |
}
|
506 |
-
except:
|
507 |
-
return {"status": "false", "message": "Error response."}
|
508 |
|
509 |
@app.get("/ryuzaki/freechatgpt-beta")
|
510 |
def free_chatgpt4_beta(query: str):
|
|
|
490 |
return {"status": "false", "message": "Error response."}
|
491 |
|
492 |
@app.post("/ryuzaki/chatgpt-model")
|
493 |
+
def chatgpt_model(query: str=None, model_id: int=None, is_models: bool=False):
|
494 |
+
url = "https://lexica.qewertyy.me/models"
|
495 |
+
if is_models:
|
496 |
+
params = {"model_id": model_id, "prompt": query}
|
497 |
+
response = requests.post(url, params=params)
|
498 |
+
if response.status_code != 200:
|
499 |
+
return f"Error status: {response.status_code}"
|
500 |
+
check_response = response.json()
|
501 |
+
answer = check_response.get("content")
|
502 |
return {
|
503 |
"status": "true",
|
504 |
"randydev":{
|
505 |
+
"message": answer
|
506 |
+
}
|
507 |
+
}
|
508 |
+
else:
|
509 |
+
params = {"model_id": 5, "prompt": query}
|
510 |
+
response = requests.post(url, params=params)
|
511 |
+
if response.status_code != 200:
|
512 |
+
return f"Error status: {response.status_code}"
|
513 |
+
check_response = response.json()
|
514 |
+
answer = check_response.get("content")
|
515 |
+
return {
|
516 |
+
"status": "true",
|
517 |
+
"randydev":{
|
518 |
+
"message": answer
|
519 |
}
|
520 |
}
|
|
|
|
|
521 |
|
522 |
@app.get("/ryuzaki/freechatgpt-beta")
|
523 |
def free_chatgpt4_beta(query: str):
|