docs: reference the source union by type instead of a line number

The line number went stale when the base moved.
This commit is contained in:
feng.tsai 2026-08-31 12:21:24 +08:00
parent 0e7562dbc6
commit bb51c121cf
2 changed files with 2 additions and 2 deletions

View file

@ -861,7 +861,7 @@ class AnthropicMessagesHandler(BaseTranslation):
def _image_sources(block: Mapping[str, object]) -> tuple[str, ...]:
"""Normalize an Anthropic image block into strings a guardrail can read.
`source` is one of three shapes (types/llms/anthropic.py:259):
`source` is one of three shapes (`AnthropicMessagesImageParam.source`):
{"type": "base64", "media_type": "image/png", "data": "<b64>"}
{"type": "url", "url": "https://..."}

View file

@ -1491,7 +1491,7 @@ class MockCanaryMaskingGuardrail(CustomGuardrail):
class TestAnthropicMessagesImageSources:
"""An Anthropic image block has three source shapes (types/llms/anthropic.py:259).
"""An Anthropic image block has three source shapes (`AnthropicMessagesImageParam.source`).
Only the base64 one carries "data", so reading that key alone drops url images
entirely -- for every guardrail consuming GenericGuardrailAPIInputs["images"],