Skip to content

UserTextPrompt

🛈 DocStrings

A text-only user prompt.

Source code in src/clawd_code_sdk/models/prompts.py
@dataclass
class UserTextPrompt:
    """A text-only user prompt."""

    text: str

    def to_content_block(self) -> BetaTextBlockParam:
        """Return the Anthropic API content block dict."""
        return BetaTextBlockParam(type="text", text=self.text)

to_content_block

to_content_block() -> BetaTextBlockParam

Return the Anthropic API content block dict.

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

:fa-brands-github: Show source on GitHub