pub struct Instructions { /* private fields */ }Expand description
Optional root workspace instructions composed into the system prompt once.
Implementations§
Trait Implementations§
Source§impl Middleware for Instructions
impl Middleware for Instructions
Source§fn prompt_fragment(&self, _runtime: &RuntimeContext) -> Result<Option<String>>
fn prompt_fragment(&self, _runtime: &RuntimeContext) -> Result<Option<String>>
Contributes immutable system instructions once while the agent is created.
Source§fn register(
&self,
_catalog: &mut Catalog,
_runtime: &RuntimeContext,
) -> Result<()>
fn register( &self, _catalog: &mut Catalog, _runtime: &RuntimeContext, ) -> Result<()>
Adds tools to the catalog while the agent is created.
Source§fn frontend(&self) -> FrontendContribution
fn frontend(&self) -> FrontendContribution
Declares commands and status data that any frontend may render.
Source§fn render(&self, _event: &EventMsg) -> Option<FrontendBlock>
fn render(&self, _event: &EventMsg) -> Option<FrontendBlock>
Renders an event owned by this capability for thin frontend shells.
Source§fn command<'a>(
&'a self,
context: MiddlewareCommandContext<'a>,
) -> BoxFuture<'a, Result<MiddlewareCommandOutput>>
fn command<'a>( &'a self, context: MiddlewareCommandContext<'a>, ) -> BoxFuture<'a, Result<MiddlewareCommandOutput>>
Handles a command declared by this middleware’s frontend contribution.
Source§fn initialize<'a>(
&'a self,
_context: RuntimeContext,
) -> BoxFuture<'a, Result<()>>
fn initialize<'a>( &'a self, _context: RuntimeContext, ) -> BoxFuture<'a, Result<()>>
Restores middleware-owned durable state for this agent tree.
Source§fn active_operations(&self) -> &'static [&'static str]
fn active_operations(&self) -> &'static [&'static str]
Declares active-turn operations owned by this middleware.
Source§fn active_submission(
&self,
_context: &mut ActiveSubmissionContext<'_>,
) -> Result<ActiveSubmissionResult>
fn active_submission( &self, _context: &mut ActiveSubmissionContext<'_>, ) -> Result<ActiveSubmissionResult>
Handles one declared active-turn operation.
Source§fn active_command(
&self,
_context: &mut ActiveCommandContext<'_>,
) -> Result<Option<ActiveSubmissionResult>>
fn active_command( &self, _context: &mut ActiveCommandContext<'_>, ) -> Result<Option<ActiveSubmissionResult>>
Handles a capability command synchronously while a turn is active.
Source§fn turn_ended(&self, _context: &mut TurnEndContext<'_>) -> Result<()>
fn turn_ended(&self, _context: &mut TurnEndContext<'_>) -> Result<()>
Observes a turn ending and may clear capability-owned transient UI.
Source§fn before_model<'a>(
&'a self,
_context: &'a mut ModelContext<'_>,
) -> BoxFuture<'a, Result<()>>
fn before_model<'a>( &'a self, _context: &'a mut ModelContext<'_>, ) -> BoxFuture<'a, Result<()>>
Mutates durable context before the next model request is assembled.
Source§fn decorate_model_request<'a>(
&'a self,
_context: &'a mut ModelContext<'_>,
) -> BoxFuture<'a, Result<()>>
fn decorate_model_request<'a>( &'a self, _context: &'a mut ModelContext<'_>, ) -> BoxFuture<'a, Result<()>>
Applies request-only context after every durable transform has completed.
Source§fn after_model<'a>(
&'a self,
_context: &'a mut AfterModelContext<'_>,
) -> BoxFuture<'a, Result<()>>
fn after_model<'a>( &'a self, _context: &'a mut AfterModelContext<'_>, ) -> BoxFuture<'a, Result<()>>
Observes one normalized response before it is checkpointed or dispatched. Read more
Auto Trait Implementations§
impl Freeze for Instructions
impl RefUnwindSafe for Instructions
impl Send for Instructions
impl Sync for Instructions
impl Unpin for Instructions
impl UnsafeUnpin for Instructions
impl UnwindSafe for Instructions
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