Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -21,14 +21,14 @@ def forward_to_target(subpath):
|
|
21 |
print(f"Request data: {data}") # 调试信息
|
22 |
|
23 |
# 检查是否是特定路径需要特殊处理
|
24 |
-
if
|
25 |
auth_header = request.headers.get('Authorization')
|
26 |
if not auth_header or not auth_header.startswith('Bearer '):
|
27 |
return jsonify({"error": "Unauthorized"}), 401
|
28 |
|
29 |
api_key = auth_header.split(" ")[1]
|
30 |
#target_url = f"https://{subpath.split('/')[0]}"
|
31 |
-
target_url = f"https://{subpath.split('/')[
|
32 |
'''
|
33 |
model = data['model']
|
34 |
messages = data['messages']
|
|
|
21 |
print(f"Request data: {data}") # 调试信息
|
22 |
|
23 |
# 检查是否是特定路径需要特殊处理
|
24 |
+
if True:
|
25 |
auth_header = request.headers.get('Authorization')
|
26 |
if not auth_header or not auth_header.startswith('Bearer '):
|
27 |
return jsonify({"error": "Unauthorized"}), 401
|
28 |
|
29 |
api_key = auth_header.split(" ")[1]
|
30 |
#target_url = f"https://{subpath.split('/')[0]}"
|
31 |
+
target_url = f"https://{subpath.split('/')[1]}/v1"
|
32 |
'''
|
33 |
model = data['model']
|
34 |
messages = data['messages']
|