Skip to content

UserImageURLPrompt

🛈 DocStrings

A user prompt containing an image referenced by URL.

Source code in src/clawd_code_sdk/models/prompts.py
@dataclass
class UserImageURLPrompt:
    """A user prompt containing an image referenced by URL."""

    url: str
    """Public URL of the image."""

    def to_content_block(self) -> BetaImageBlockParam:
        """Return the Anthropic API content block dict."""
        return BetaImageBlockParam(
            type="image",
            source=BetaURLImageSourceParam(type="url", url=self.url),
        )

url instance-attribute

url: str

Public URL of the image.

to_content_block

to_content_block() -> BetaImageBlockParam

Return the Anthropic API content block dict.

Source code in src/clawd_code_sdk/models/prompts.py
def to_content_block(self) -> BetaImageBlockParam:
    """Return the Anthropic API content block dict."""
    return BetaImageBlockParam(
        type="image",
        source=BetaURLImageSourceParam(type="url", url=self.url),
    )

:fa-brands-github: Show source on GitHub