pub struct ToolContext<'run> { /* private fields */ }Expand description
Per-call environment for ToolProvider::execute. Fields are sealed so
the runtime can add capabilities without breaking tool authors.
Implementations§
Source§impl<'run> ToolContext<'run>
impl<'run> ToolContext<'run>
pub fn session_id(&self) -> &str
pub fn agent_frame_id(&self) -> &str
pub fn sessions(&self) -> ToolSessionControl<'run>
pub fn dispatch(&self) -> ToolDispatchControl<'run>
pub fn host_events(&self) -> ToolHostEventControl<'run>
pub fn processes(&self) -> ToolProcessControl<'run>
pub fn emit_lashlang_child_process_started( &self, process_id: impl Into<String>, child_entry_name: Option<String>, )
pub fn direct_completions(&self) -> ToolDirectCompletionControl<'run>
pub fn attachments(&self) -> ToolAttachmentControl
pub fn process_events(&self) -> ToolProcessEventControl
pub fn cancellation_token(&self) -> Option<&CancellationToken>
pub fn async_process_id(&self) -> Option<&str>
pub fn tool_call_id(&self) -> Option<&str>
pub fn prepared_payload(&self) -> &Value
pub fn decode_prepared_payload<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
pub fn attempt_number(&self) -> u32
pub fn max_attempts(&self) -> u32
pub fn replay_key(&self) -> Option<&str>
pub fn with_async_process( self, process_id: impl Into<String>, cancellation_token: CancellationToken, ) -> Self
Trait Implementations§
Source§impl<'run> Clone for ToolContext<'run>
impl<'run> Clone for ToolContext<'run>
Source§fn clone(&self) -> ToolContext<'run>
fn clone(&self) -> ToolContext<'run>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'run> !RefUnwindSafe for ToolContext<'run>
impl<'run> !UnwindSafe for ToolContext<'run>
impl<'run> Freeze for ToolContext<'run>
impl<'run> Send for ToolContext<'run>
impl<'run> Sync for ToolContext<'run>
impl<'run> Unpin for ToolContext<'run>
impl<'run> UnsafeUnpin for ToolContext<'run>
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