补全注释

This commit is contained in:
h88782481 2026-03-10 08:43:07 +08:00
parent 96fbc4da80
commit f193c48ce1
13 changed files with 115 additions and 14 deletions

View file

@ -16,7 +16,7 @@ logger = logging.getLogger(__name__)
def gen_id(prefix: str = '') -> str:
"""生成唯一 ID"""
"""生成带可选前缀的短随机 ID用于请求和工具调用标识。"""
return f'{prefix}{uuid.uuid4().hex[:24]}'
@ -57,7 +57,7 @@ def sse_response(generator):
def error_json(message, error_type='proxy_error', status=502):
"""建 JSON 错误响应"""
"""造统一的 JSON 错误响应,供非流式链路直接返回。"""
return jsonify({'error': {'message': str(message), 'type': error_type}}), status

View file

@ -33,6 +33,7 @@ class ThinkTagExtractor:
"""
def __init__(self):
"""初始化跨 chunk 的 thinking 状态跟踪。"""
self._in_thinking = False
def process_chunk(self, chunk):