Skip to main content

ContextualExecutor

Trait ContextualExecutor 

Source
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§

Source

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,

带上下文执行工具

§Arguments
  • request - 工具调用请求
  • context - 执行上下文
Source

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".

Implementors§