Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ def index():
|
|
12 |
def forward_to_target(subpath):
|
13 |
try:
|
14 |
# 构建目标 URL
|
15 |
-
target_url = f'
|
16 |
|
17 |
# 获取请求数据
|
18 |
data = request.json
|
@@ -24,7 +24,7 @@ def forward_to_target(subpath):
|
|
24 |
return jsonify({"error": "Unauthorized"}), 401
|
25 |
|
26 |
api_key = auth_header.split(" ")[1]
|
27 |
-
target_url = f"
|
28 |
|
29 |
model = data['model']
|
30 |
messages = data['messages']
|
|
|
12 |
def forward_to_target(subpath):
|
13 |
try:
|
14 |
# 构建目标 URL
|
15 |
+
target_url = f'https://{subpath}'
|
16 |
|
17 |
# 获取请求数据
|
18 |
data = request.json
|
|
|
24 |
return jsonify({"error": "Unauthorized"}), 401
|
25 |
|
26 |
api_key = auth_header.split(" ")[1]
|
27 |
+
target_url = f"https://{subpath.split('/')[0]}"
|
28 |
|
29 |
model = data['model']
|
30 |
messages = data['messages']
|