#[non_exhaustive]pub struct SystemPrompt {
pub mode: SystemPromptMode,
pub content: Vec<ContentBlock>,
pub meta: Option<Meta>,
}unstable_protocol_v2 only.Expand description
UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
Client-provided system-level instructions for a session.
Clients MUST only send this when the Agent advertises
session.systemPrompt. Agents that cannot apply it, for example because of
an unadvertised mode or an unsupported content block type, MUST return an
error instead of creating, resuming, or forking the session.
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.mode: SystemPromptModeHow the Agent combines content with its own instructions.
Required on the wire, so every request states its mode. In Rust,
SystemPrompt::new starts it as SystemPromptMode::Append. Unknown
values parse as SystemPromptMode::Other; Agents MUST return an error
for modes they do not support.
content: Vec<ContentBlock>The system prompt content.
Agents advertising the capability MUST accept ContentBlock::Text.
Clients MUST NOT send other content block types until a future
capability allows them, and Agents MUST return an error for content
blocks they do not support, including unknown types preserved as
ContentBlock::Other.
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 SystemPrompt
impl SystemPrompt
Sourcepub fn new(content: Vec<ContentBlock>) -> Self
Available on crate feature unstable_session_system_prompt only.
pub fn new(content: Vec<ContentBlock>) -> Self
unstable_session_system_prompt only.Builds SystemPrompt with the required fields set; optional fields start unset or empty.
mode starts as SystemPromptMode::Append; use SystemPrompt::mode
to request another mode.
Sourcepub fn mode(self, mode: SystemPromptMode) -> Self
Available on crate feature unstable_session_system_prompt only.
pub fn mode(self, mode: SystemPromptMode) -> Self
unstable_session_system_prompt only.How the Agent combines content with its own instructions.
Sourcepub fn meta(self, meta: impl IntoOption<Meta>) -> Self
Available on crate feature unstable_session_system_prompt only.
pub fn meta(self, meta: impl IntoOption<Meta>) -> Self
unstable_session_system_prompt only.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 SystemPrompt
impl Clone for SystemPrompt
Source§impl Debug for SystemPrompt
impl Debug for SystemPrompt
Source§impl<'de> Deserialize<'de> for SystemPrompt
impl<'de> Deserialize<'de> for SystemPrompt
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>,
impl Eq for SystemPrompt
Source§impl JsonSchema for SystemPrompt
impl JsonSchema for SystemPrompt
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 moreSource§impl PartialEq for SystemPrompt
impl PartialEq for SystemPrompt
Source§impl Serialize for SystemPrompt
impl Serialize for SystemPrompt
impl StructuralPartialEq for SystemPrompt
Auto Trait Implementations§
impl Freeze for SystemPrompt
impl RefUnwindSafe for SystemPrompt
impl Send for SystemPrompt
impl Sync for SystemPrompt
impl Unpin for SystemPrompt
impl UnsafeUnpin for SystemPrompt
impl UnwindSafe for SystemPrompt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.