Skip to content

PromptRequest

Base classes

Name Children Inherits
AnnotatedObject
aclientp.schema.v2.base
A v2 object with the ``_meta`` extension point.

⋔ Inheritance diagram

graph TD
  95970869395312["prompt.PromptRequest"]
  95970868359040["base.AnnotatedObject"]
  95970855946400["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970868359040 --> 95970869395312
  95970855946400 --> 95970868359040
  95970851503232 --> 95970855946400
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: AnnotatedObject

Parameters of session/prompt: a user message for the session.

Agents MUST support text and resource_link content; other block types need the matching prompt capability.

Source code in src/aclientp/schema/v2/prompt.py
class PromptRequest(AnnotatedObject):
    """Parameters of ``session/prompt``: a user message for the session.

    Agents MUST support ``text`` and ``resource_link`` content; other block types
    need the matching prompt capability.
    """

    session_id: SessionId
    """The session to send the message to."""

    prompt: Sequence[ContentBlock] = Field(min_length=1)
    """The content of the user message; at least one block."""

    idempotency_key: IdempotencyKey | MISSING | None = MISSING
    """Identifies this submission, so a retry does not insert the message twice."""

idempotency_key class-attribute instance-attribute

idempotency_key: IdempotencyKey | MISSING | None = MISSING

Identifies this submission, so a retry does not insert the message twice.

prompt class-attribute instance-attribute

prompt: Sequence[ContentBlock] = Field(min_length=1)

The content of the user message; at least one block.

session_id instance-attribute

session_id: SessionId

The session to send the message to.

:fa-brands-github: Show source on GitHub