feat: 补充 OpenAI 枚举参数和边界越界测试
- service_tier: 补充 flex, priority 测试 - reasoning_effort: 补充 none, minimal 测试 - verbosity: 补充 medium, high 测试 - 边界越界测试: frequency_penalty, presence_penalty, top_p, n - core.py: http_stream_request 支持 method 参数 - Anthropic: 补充 content_block_start 事件验证
This commit is contained in:
@@ -262,6 +262,18 @@ def validate_anthropic_streaming_response(response_text: str) -> Tuple[bool, Lis
|
||||
elif event_type == "message_stop":
|
||||
has_message_stop = True
|
||||
|
||||
elif event_type == "content_block_start":
|
||||
if "index" not in event:
|
||||
errors.append(f"content_block_start 事件缺少 index 字段")
|
||||
if "content_block" not in event:
|
||||
errors.append(f"content_block_start 事件缺少 content_block 字段")
|
||||
elif not isinstance(event["content_block"], dict):
|
||||
errors.append(f"content_block_start 事件的 content_block 不是对象")
|
||||
else:
|
||||
cb = event["content_block"]
|
||||
if "type" not in cb:
|
||||
errors.append(f"content_block_start.content_block 缺少 type 字段")
|
||||
|
||||
elif event_type == "content_block_delta":
|
||||
if "delta" not in event:
|
||||
errors.append(f"content_block_delta 事件缺少 delta 字段")
|
||||
|
||||
Reference in New Issue
Block a user