pub struct Block { /* private fields */ }Expand description
A single piece of rendered context, identified by its tag.
The tag is both the delimiter the model sees and the identity the agent uses to replace a block it rendered earlier, so it must be stable for a given source.
Implementations§
Source§impl Block
impl Block
Sourcepub fn new(tag: impl Into<String>, content: impl Into<String>) -> Self
pub fn new(tag: impl Into<String>, content: impl Into<String>) -> Self
Creates a block whose content is already rendered.
Sourcepub fn external(tag: impl Into<String>, content: &ExternalContent) -> Self
pub fn external(tag: impl Into<String>, content: &ExternalContent) -> Self
Creates a block, typically a durable alert, that carries external
content: text the host did not write as instructions, such as a diff
of a memory file or of a repository’s AGENTS.md.
The content renders inside the same provenance-labelled boundary the
system prompt gives ExternalContent, preceded by the notice that
it is data, so nothing inside it can close the block or pose as an
instruction.
Trait Implementations§
impl Eq for Block
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl Forget for Block
impl Freeze for Block
impl Move 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.