tianlong12 commited on
Commit
33857b1
·
verified ·
1 Parent(s): 351bb63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -21,14 +21,14 @@ def forward_to_target(subpath):
21
  print(f"Request data: {data}") # 调试信息
22
 
23
  # 检查是否是特定路径需要特殊处理
24
- if 'v1/chat/completions' in subpath:
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('/')[0]}/v1"
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']