Spaces:
Running
Running
Update qwen_api.py
Browse files- qwen_api.py +1 -6
qwen_api.py
CHANGED
|
@@ -29,12 +29,7 @@ def call_qwen(prompt: str) -> str:
|
|
| 29 |
}
|
| 30 |
}
|
| 31 |
try:
|
| 32 |
-
resp = requests.post(
|
| 33 |
-
url=PROXY_URL, # 访问代理地址
|
| 34 |
-
# 向代理传递目标URL(通义千问API)和真实请求数据
|
| 35 |
-
json={"target_url": QWEN_API_URL, "data": payload},
|
| 36 |
-
headers=headers,
|
| 37 |
-
timeout=30)
|
| 38 |
resp.raise_for_status() # 触发 HTTP 错误(如 401/500)
|
| 39 |
result = resp.json()
|
| 40 |
|
|
|
|
| 29 |
}
|
| 30 |
}
|
| 31 |
try:
|
| 32 |
+
resp = requests.post(QWEN_API_URL, headers=headers, json=payload, timeout=30)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
resp.raise_for_status() # 触发 HTTP 错误(如 401/500)
|
| 34 |
result = resp.json()
|
| 35 |
|