Skip to content

PromptRequest

Base classes

Name Children Inherits
Request
aclientp.schema.base
Base request model.

⋔ Inheritance diagram

graph TD
  95970860848768["client_requests.PromptRequest"]
  95970858197488["base.Request"]
  95970862258240["base.AnnotatedObject"]
  95970862254416["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970858197488 --> 95970860848768
  95970862258240 --> 95970858197488
  95970862254416 --> 95970862258240
  95970851503232 --> 95970862254416
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: Request

Request parameters for sending a user prompt to the agent.

Contains the user's message and any additional context.

See protocol docs: User Message

Source code in src/aclientp/schema/client_requests.py
class PromptRequest(Request):
    """Request parameters for sending a user prompt to the agent.

    Contains the user's message and any additional context.

    See protocol docs: [User Message](https://agentclientprotocol.com/protocol/prompt-turn#1-user-message)
    """

    prompt: Sequence[ContentBlock]
    """The blocks of content that compose the user's message.

    As a baseline, the Agent MUST support [`ContentBlock::Text`] and
    [`ContentBlock::ResourceContentBlock`],
    while other variants are optionally enabled via [`PromptCapabilities`].

    The Client MUST adapt its interface according to [`PromptCapabilities`].

    The client MAY include referenced pieces of context as either
    [`ContentBlock::Resource`] or [`ContentBlock::ResourceContentBlock`].

    When available, [`ContentBlock::Resource`] is preferred
    as it avoids extra round-trips and allows the message to include
    pieces of context from sources the agent may not have access to.
    """

    session_id: str
    """The ID of the session to send this user message to."""

prompt instance-attribute

prompt: Sequence[ContentBlock]

The blocks of content that compose the user's message.

As a baseline, the Agent MUST support [ContentBlock::Text] and [ContentBlock::ResourceContentBlock], while other variants are optionally enabled via [PromptCapabilities].

The Client MUST adapt its interface according to [PromptCapabilities].

The client MAY include referenced pieces of context as either [ContentBlock::Resource] or [ContentBlock::ResourceContentBlock].

When available, [ContentBlock::Resource] is preferred as it avoids extra round-trips and allows the message to include pieces of context from sources the agent may not have access to.

session_id instance-attribute

session_id: str

The ID of the session to send this user message to.

:fa-brands-github: Show source on GitHub