pub trait PromptHandler: Send + Sync {
// Required methods
fn handle<'life0, 'async_trait>(
&'life0 self,
request: GetPromptRequest,
ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<GetPromptResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn prompt_definition(&self) -> Prompt;
// Provided method
fn validate_arguments(
&self,
_args: &HashMap<String, Value>,
) -> ServerResult<()> { ... }
}
Expand description
Prompt handler trait for processing prompt requests
Required Methods§
Sourcefn handle<'life0, 'async_trait>(
&'life0 self,
request: GetPromptRequest,
ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<GetPromptResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
request: GetPromptRequest,
ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<GetPromptResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a prompt request
Sourcefn prompt_definition(&self) -> Prompt
fn prompt_definition(&self) -> Prompt
Get the prompt definition
Provided Methods§
Sourcefn validate_arguments(&self, _args: &HashMap<String, Value>) -> ServerResult<()>
fn validate_arguments(&self, _args: &HashMap<String, Value>) -> ServerResult<()>
Validate prompt arguments (optional, default implementation allows all)