pub struct ToolContext {Show 17 fields
pub workspace: PathBuf,
pub shared_state: BTreeMap<String, Value>,
pub cycle_index: u32,
pub task_id: String,
pub tool_call_id: String,
pub tool_name: String,
pub arguments: ToolArguments,
pub idempotency_key: Option<String>,
pub metadata: BTreeMap<String, Value>,
pub app_state: Option<Arc<dyn Any + Send + Sync>>,
pub workspace_backend: Arc<dyn WorkspaceBackend>,
pub model_provider: Option<Arc<dyn ModelProvider>>,
pub run_context: Option<RunContext>,
pub sub_task_runner: Option<SubTaskRunner>,
pub sub_task_manager: Option<SubTaskManager>,
pub sub_task_turn_snapshot: Option<SubTaskTurnSnapshot>,
pub execution_backend: Option<RuntimeExecutionBackend>,
/* private fields */
}Fields§
§workspace: PathBuf§cycle_index: u32§task_id: String§tool_call_id: String§tool_name: String§arguments: ToolArguments§idempotency_key: Option<String>§metadata: BTreeMap<String, Value>§app_state: Option<Arc<dyn Any + Send + Sync>>§workspace_backend: Arc<dyn WorkspaceBackend>§model_provider: Option<Arc<dyn ModelProvider>>§run_context: Option<RunContext>§sub_task_runner: Option<SubTaskRunner>§sub_task_manager: Option<SubTaskManager>§sub_task_turn_snapshot: Option<SubTaskTurnSnapshot>§execution_backend: Option<RuntimeExecutionBackend>Implementations§
Source§impl ToolContext
impl ToolContext
pub fn new(workspace: impl Into<PathBuf>) -> Self
pub fn allow_outside_workspace_paths(&self) -> bool
pub fn begin_tool_call(&mut self, call: &ToolCall)
pub fn app_state<T: Send + Sync + 'static>(&self) -> Option<&T>
pub fn resolve_workspace_path(&self, raw_path: &str) -> Result<PathBuf, String>
pub fn effective_workspace_backend(&self) -> Arc<dyn WorkspaceBackend> ⓘ
Trait Implementations§
Source§impl Clone for ToolContext
impl Clone for ToolContext
Source§fn clone(&self) -> ToolContext
fn clone(&self) -> ToolContext
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 !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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.