Update app.py
Browse files
app.py
CHANGED
|
@@ -180,12 +180,9 @@ async def embeddings(request: Request):
|
|
| 180 |
async def models(request: Request):
|
| 181 |
"""转发 models 请求."""
|
| 182 |
"""通用的请求转发函数."""
|
| 183 |
-
|
| 184 |
-
key = get_api_key()
|
| 185 |
-
if not key:
|
| 186 |
-
raise HTTPException(status_code=400, detail="No valid API key available.")
|
| 187 |
headers = {"Authorization": f"Bearer {key}"}
|
| 188 |
-
async with httpx.AsyncClient(
|
| 189 |
response = await client.get(
|
| 190 |
"https://api.siliconflow.cn/v1/models", headers=headers
|
| 191 |
)
|
|
|
|
| 180 |
async def models(request: Request):
|
| 181 |
"""转发 models 请求."""
|
| 182 |
"""通用的请求转发函数."""
|
| 183 |
+
key="sk-aastfpzsnogprzmmbbxompjaukefeotxrrkcrztiyocrosqa"
|
|
|
|
|
|
|
|
|
|
| 184 |
headers = {"Authorization": f"Bearer {key}"}
|
| 185 |
+
async with httpx.AsyncClient() as client:
|
| 186 |
response = await client.get(
|
| 187 |
"https://api.siliconflow.cn/v1/models", headers=headers
|
| 188 |
)
|