#[non_exhaustive]pub struct PromptRequest {
pub session_id: SessionId,
pub prompt: Vec<ContentBlock>,
pub meta: Option<Meta>,
}Expand description
Request parameters for sending a user prompt to the agent.
Contains the user’s message and any additional context.
See protocol docs: User Message
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.session_id: SessionIdThe ID of the session to send this user message to
prompt: Vec<ContentBlock>The blocks of content that compose the user’s message.
As a baseline, the Agent MUST support ContentBlock::Text and ContentBlock::ResourceLink,
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::ResourceLink.
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.
meta: Option<Meta>The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Implementations§
Source§impl PromptRequest
impl PromptRequest
pub fn new(session_id: impl Into<SessionId>, prompt: Vec<ContentBlock>) -> Self
Sourcepub fn meta(self, meta: Meta) -> Self
pub fn meta(self, meta: Meta) -> Self
The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Trait Implementations§
Source§impl Clone for PromptRequest
impl Clone for PromptRequest
Source§fn clone(&self) -> PromptRequest
fn clone(&self) -> PromptRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PromptRequest
impl Debug for PromptRequest
Source§impl<'de> Deserialize<'de> for PromptRequest
impl<'de> Deserialize<'de> for PromptRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for PromptRequest
impl JsonSchema for PromptRequest
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more