Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -24,6 +24,7 @@ secret_api_endpoint = os.getenv('SECRET_API_ENDPOINT')
|
|
24 |
secret_api_endpoint_2 = os.getenv('SECRET_API_ENDPOINT_2')
|
25 |
secret_api_endpoint_3 = os.getenv('SECRET_API_ENDPOINT_3') # New endpoint for searchgpt
|
26 |
image_endpoint = os.getenv("IMAGE_ENDPOINT")
|
|
|
27 |
|
28 |
# Validate if the main secret API endpoints are set
|
29 |
if not secret_api_endpoint or not secret_api_endpoint_2 or not secret_api_endpoint_3:
|
@@ -142,9 +143,7 @@ async def get_models():
|
|
142 |
@app.get("/models")
|
143 |
async def fetch_models():
|
144 |
return await get_models()
|
145 |
-
|
146 |
-
ENDPOINT_ORIGIN = os.getenv('ENDPOINT_ORIGIN', 'https://default-endpoint.com')
|
147 |
-
|
148 |
@app.post("/chat/completions")
|
149 |
@app.post("api/v1/chat/completions")
|
150 |
async def get_completion(payload: Payload, request: Request):
|
|
|
24 |
secret_api_endpoint_2 = os.getenv('SECRET_API_ENDPOINT_2')
|
25 |
secret_api_endpoint_3 = os.getenv('SECRET_API_ENDPOINT_3') # New endpoint for searchgpt
|
26 |
image_endpoint = os.getenv("IMAGE_ENDPOINT")
|
27 |
+
ENDPOINT_ORIGIN = os.getenv('ENDPOINT_ORIGIN')
|
28 |
|
29 |
# Validate if the main secret API endpoints are set
|
30 |
if not secret_api_endpoint or not secret_api_endpoint_2 or not secret_api_endpoint_3:
|
|
|
143 |
@app.get("/models")
|
144 |
async def fetch_models():
|
145 |
return await get_models()
|
146 |
+
server_status = True #working
|
|
|
|
|
147 |
@app.post("/chat/completions")
|
148 |
@app.post("api/v1/chat/completions")
|
149 |
async def get_completion(payload: Payload, request: Request):
|