SamplingHandler

Trait SamplingHandler 

Source
pub trait SamplingHandler: Send + Sync {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        request: CreateMessageRequest,
        ctx: RequestContext,
    ) -> Pin<Box<dyn Future<Output = ServerResult<CreateMessageResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn sampling_capabilities(&self) -> SamplingCapabilities { ... }
}
Expand description

Sampling handler trait for processing sampling requests

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, request: CreateMessageRequest, ctx: RequestContext, ) -> Pin<Box<dyn Future<Output = ServerResult<CreateMessageResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle a sampling request

Provided Methods§

Source

fn sampling_capabilities(&self) -> SamplingCapabilities

Get supported sampling capabilities

Implementors§