#[non_exhaustive]pub struct SystemPrompt {
pub mode: SystemPromptMode,
pub content: Vec<ContentBlock>,
pub meta: Option<Map<String, Value>>,
}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
sessionCapabilities.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, loading, 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.
meta: Option<Map<String, Value>>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>) -> SystemPrompt
Available on crate feature unstable_session_system_prompt only.
pub fn new(content: Vec<ContentBlock>) -> SystemPrompt
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) -> SystemPrompt
Available on crate feature unstable_session_system_prompt only.
pub fn mode(self, mode: SystemPromptMode) -> SystemPrompt
unstable_session_system_prompt only.How the Agent combines content with its own instructions.
Sourcepub fn meta(self, meta: impl IntoOption<Map<String, Value>>) -> SystemPrompt
Available on crate feature unstable_session_system_prompt only.
pub fn meta(self, meta: impl IntoOption<Map<String, Value>>) -> SystemPrompt
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§fn clone(&self) -> SystemPrompt
fn clone(&self) -> SystemPrompt
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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<SystemPrompt, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SystemPrompt, <__D as Deserializer<'de>>::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
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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.