test: freeze tool-call contract semantics

Lock the current Anthropic streaming asymmetry so future refactors do not silently synthesize tool blocks. Align schema and docs with the actual support level to avoid over-promising forced-tool fallback.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
GitHub Actions
2026-04-22 10:56:21 +08:00
parent e3d3a63492
commit d081743924
6 changed files with 55 additions and 9 deletions

View File

@@ -53,8 +53,10 @@ class AnthropicMessagesRequest(BaseModel):
# metadata.user_id is the official hint for per-user routing / abuse tracking.
metadata: dict[str, Any] | None = None
# Tools / tool_choice are accepted for compatibility and, when forwarding is
# enabled, are passed upstream as tool_config; tool_use / tool_result blocks
# are still flattened into text so the assistant can see prior tool context.
# enabled, are passed upstream as tool_config. Response-side tool bridging is
# the primary supported surface today; forced-tool synthesis is only covered
# for non-stream Anthropic responses. tool_use / tool_result blocks in prior
# messages are still flattened into text so the assistant can see that context.
tools: list[dict[str, Any]] | None = None
tool_choice: dict[str, Any] | None = None