pub struct PythonReplTool { /* private fields */ }Expand description
Python REPL tool.
Implementations§
Source§impl PythonReplTool
impl PythonReplTool
Sourcepub fn with_config(config: PythonReplConfig) -> Self
pub fn with_config(config: PythonReplConfig) -> Self
Build with a custom config.
Sourcepub fn with_description(self, d: impl Into<String>) -> Self
pub fn with_description(self, d: impl Into<String>) -> Self
Override the description.
Sourcepub fn config(&self) -> &PythonReplConfig
pub fn config(&self) -> &PythonReplConfig
Borrow the active config.
Trait Implementations§
Source§impl Tool for PythonReplTool
impl Tool for PythonReplTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Description shown to the LLM.
Source§fn args_schema(&self) -> Option<Value>
fn args_schema(&self) -> Option<Value>
Optional JSON Schema for the parameters. None = no parameters.
Source§fn _run<'life0, 'async_trait>(
&'life0 self,
input: ToolInput,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn _run<'life0, 'async_trait>(
&'life0 self,
input: ToolInput,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the tool with the given input.
Source§fn return_direct(&self) -> bool
fn return_direct(&self) -> bool
Hint to the agent: if true, return the tool result directly
instead of looping back to the LLM.
Auto Trait Implementations§
impl Freeze for PythonReplTool
impl RefUnwindSafe for PythonReplTool
impl Send for PythonReplTool
impl Sync for PythonReplTool
impl Unpin for PythonReplTool
impl UnsafeUnpin for PythonReplTool
impl UnwindSafe for PythonReplTool
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