pub trait ContextualExecutor: ToolExecutor {
// Required methods
fn execute_with_context<'life0, 'async_trait>(
&'life0 self,
request: ToolRequest,
context: ExecutionContext,
) -> Pin<Box<dyn Future<Output = Layer3Result<ToolResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn execute_batch_with_context<'life0, 'async_trait>(
&'life0 self,
requests: Vec<ToolRequest>,
context: ExecutionContext,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<ToolResponse>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
带上下文的工具执行器
扩展 ToolExecutor,支持上下文传递。
Required Methods§
Sourcefn execute_with_context<'life0, 'async_trait>(
&'life0 self,
request: ToolRequest,
context: ExecutionContext,
) -> Pin<Box<dyn Future<Output = Layer3Result<ToolResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_with_context<'life0, 'async_trait>(
&'life0 self,
request: ToolRequest,
context: ExecutionContext,
) -> Pin<Box<dyn Future<Output = Layer3Result<ToolResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn execute_batch_with_context<'life0, 'async_trait>(
&'life0 self,
requests: Vec<ToolRequest>,
context: ExecutionContext,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<ToolResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_batch_with_context<'life0, 'async_trait>(
&'life0 self,
requests: Vec<ToolRequest>,
context: ExecutionContext,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<ToolResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
带上下文批量执行
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".