Spaces:
Running
Running
Upload main.py
Browse files
main.py
CHANGED
@@ -25,7 +25,6 @@ import uvicorn
|
|
25 |
import os
|
26 |
import shutil
|
27 |
import random
|
28 |
-
import g4f
|
29 |
import tempfile
|
30 |
import io
|
31 |
from io import BytesIO
|
@@ -470,25 +469,6 @@ def ocr_space_url(
|
|
470 |
except (json.JSONDecodeError, KeyError):
|
471 |
return "Error parsing the OCR response."
|
472 |
|
473 |
-
@app.get("/ryuzaki/chatgpt4")
|
474 |
-
def chatgpt4_support(
|
475 |
-
query: str=None,
|
476 |
-
api_key: None = Depends(validate_api_key)
|
477 |
-
):
|
478 |
-
try:
|
479 |
-
response = g4f.ChatCompletion.create(
|
480 |
-
model=g4f.models.gpt_4,
|
481 |
-
messages=[{"role": "user", "content": query}],
|
482 |
-
)
|
483 |
-
return {
|
484 |
-
"status": "true",
|
485 |
-
"randydev":{
|
486 |
-
"message": response
|
487 |
-
}
|
488 |
-
}
|
489 |
-
except:
|
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"
|
|
|
25 |
import os
|
26 |
import shutil
|
27 |
import random
|
|
|
28 |
import tempfile
|
29 |
import io
|
30 |
from io import BytesIO
|
|
|
469 |
except (json.JSONDecodeError, KeyError):
|
470 |
return "Error parsing the OCR response."
|
471 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
472 |
@app.post("/ryuzaki/chatgpt-model")
|
473 |
def chatgpt_model(query: str=None, model_id: int=None, is_models: bool=False):
|
474 |
url = "https://lexica.qewertyy.me/models"
|