pub struct ToolContext {
pub working_dir: PathBuf,
pub session_id: SessionId,
pub frontend: Arc<dyn Frontend>,
pub extensions: HashMap<String, Arc<dyn Any + Send + Sync>>,
}Expand description
Runtime context passed to tools during execution.
Fields§
§working_dir: PathBufCurrent working directory.
session_id: SessionIdCurrent session ID.
frontend: Arc<dyn Frontend>Frontend for user interaction (e.g., asking for input during tool execution).
extensions: HashMap<String, Arc<dyn Any + Send + Sync>>Platform-specific extensions, keyed by extension ID.
Chatbot platforms populate this; GUI/TUI leave it empty.
Keys like “chatbot.platform_ext” map to Arc
Auto Trait Implementations§
impl !RefUnwindSafe for ToolContext
impl !UnwindSafe for ToolContext
impl Freeze for ToolContext
impl Send for ToolContext
impl Sync for ToolContext
impl Unpin for ToolContext
impl UnsafeUnpin for ToolContext
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