#[non_exhaustive]pub enum Block {
Text(String),
FileRef {
path: String,
hash: Option<String>,
excerpt: Option<String>,
},
Skill {
name: String,
body: String,
},
ToolCall {
call_id: String,
name: String,
args: Value,
},
ToolResult {
call_id: String,
content: Value,
},
Feedback(Vec<Signal>),
Reasoning(String),
}Expand description
A single block of content within the assembled prompt.
Blocks are grouped so that long-stable prefixes (system + guides) stay cacheable across turns (“prompt caching” pattern).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Text(String)
Plain prompt text.
FileRef
Reference to a file in the world. The runtime decides whether to inline contents or hand the agent a tool call to read it.
Skill
Reference to an activated SKILL.md body.
ToolCall
A tool call the assistant requested.
ToolResult
The result of a previous tool call.
Feedback(Vec<Signal>)
Feedback signals from sensors, rendered for the model.
Reasoning(String)
Provider-specific reasoning trace (DeepSeek reasoning_content,
Anthropic thinking blocks). Must be echoed back to the provider on
subsequent calls or the API rejects the request.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Block
impl<'de> Deserialize<'de> for Block
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Block, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Block, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Block
impl Serialize for Block
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,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnsafeUnpin for Block
impl UnwindSafe for Block
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
Mutably borrows from an owned value. Read more