pub trait SamplingHandler: Send + Sync {
// Required method
fn handle<'life0, 'async_trait>(
&'life0 self,
request_id: String,
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§
Sourcefn handle<'life0, 'async_trait>(
&'life0 self,
request_id: String,
request: CreateMessageRequest,
ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<CreateMessageResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
request_id: String,
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
§Arguments
request_id- The JSON-RPC request ID for response correlationrequest- The sampling request parametersctx- The request context
Provided Methods§
Sourcefn sampling_capabilities(&self) -> SamplingCapabilities
fn sampling_capabilities(&self) -> SamplingCapabilities
Get supported sampling capabilities