File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,8 +56,6 @@ async def run(
5656 "latency_ms": 123,
5757 }
5858 """
59- opts = options or {}
60-
6159 # 构建输入文本
6260 errors_text = "\n " .join ([
6361 f"【错误 #{ i + 1 } 】\n 正确答案:{ e ['correctAnswer' ]} \n 用户回答:{ e ['userAnswer' ]} \n ---"
Original file line number Diff line number Diff line change 1414
1515import base64
1616import logging
17+ import os
1718import time
1819import warnings
1920from typing import Optional
@@ -49,8 +50,7 @@ def _jwt_verification_configured() -> bool:
4950
5051# 启动时检查密钥配置
5152# Phase1 安全加固:生产环境缺少密钥材料时拒绝启动(而非降级放行)
52- import os as _os
53- _ALLOW_DEV_AUTH = _os .getenv ("GATEWAY_ALLOW_DEV_AUTH" , "false" ).lower () == "true"
53+ _ALLOW_DEV_AUTH = os .getenv ("GATEWAY_ALLOW_DEV_AUTH" , "false" ).lower () == "true"
5454
5555if not _jwt_verification_configured ():
5656 if APP_CONFIG .get ("app_env" ) == "production" and not _ALLOW_DEV_AUTH :
Original file line number Diff line number Diff line change 99"""
1010
1111import logging
12- import time
1312from collections import defaultdict
1413
1514logger = logging .getLogger (__name__ )
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ def _make_failing_stream_fn(error_msg="模拟故障"):
7070 def fn (provider , model_name ):
7171 async def _gen ():
7272 raise RuntimeError (error_msg )
73- yield "unreachable" # noqa: 使 _gen 成为异步生成器
73+ yield "unreachable" # 使 _gen 成为异步生成器(此句不可达,仅为语法需要)
7474 return _gen ()
7575 return fn
7676
You can’t perform that action at this time.
0 commit comments