pub struct DefaultToolExecutor { /* private fields */ }Expand description
默认工具执行器
Implementations§
Source§impl DefaultToolExecutor
impl DefaultToolExecutor
pub fn new() -> Self
Sourcepub fn register_tool(&mut self, tool: Box<dyn BuiltinTool>)
pub fn register_tool(&mut self, tool: Box<dyn BuiltinTool>)
注册内置工具
Sourcepub fn history(&self) -> Vec<ExecutionRecord>
pub fn history(&self) -> Vec<ExecutionRecord>
获取执行历史
Sourcepub fn clear_history(&self)
pub fn clear_history(&self)
清空历史
Trait Implementations§
Source§impl Default for DefaultToolExecutor
impl Default for DefaultToolExecutor
Source§impl ToolExecutor for DefaultToolExecutor
impl ToolExecutor for DefaultToolExecutor
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
request: ToolRequest,
) -> Pin<Box<dyn Future<Output = Layer3Result<ToolResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
request: ToolRequest,
) -> Pin<Box<dyn Future<Output = Layer3Result<ToolResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
执行单个工具调用 Read more
Source§fn execute_batch<'life0, 'async_trait>(
&'life0 self,
requests: Vec<ToolRequest>,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<ToolResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_batch<'life0, 'async_trait>(
&'life0 self,
requests: Vec<ToolRequest>,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<ToolResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
执行多个工具调用(并行) Read more
Source§fn list_tools(&self) -> Vec<ToolMeta>
fn list_tools(&self) -> Vec<ToolMeta>
获取所有已注册工具的元数据
Auto Trait Implementations§
impl !RefUnwindSafe for DefaultToolExecutor
impl !UnwindSafe for DefaultToolExecutor
impl Freeze for DefaultToolExecutor
impl Send for DefaultToolExecutor
impl Sync for DefaultToolExecutor
impl Unpin for DefaultToolExecutor
impl UnsafeUnpin for DefaultToolExecutor
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> 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 more