pub trait PromptHandler: Send + Sync {
// Required method
fn handle<'life0, 'async_trait>(
&'life0 self,
args: HashMap<String, String>,
extra: RequestHandlerExtra,
) -> Pin<Box<dyn Future<Output = Result<GetPromptResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn metadata(&self) -> Option<PromptInfo> { ... }
}Expand description
Handler for prompt generation.
Required Methods§
Provided Methods§
Sourcefn metadata(&self) -> Option<PromptInfo>
fn metadata(&self) -> Option<PromptInfo>
Get prompt metadata including description and arguments schema. Returns None to use default empty metadata.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl PromptHandler for TaskWorkflowPromptHandler
Available on non-WebAssembly only.
impl PromptHandler for WorkflowPromptHandler
Available on non-WebAssembly only.
impl<F> PromptHandler for SimplePrompt<F>
Available on non-WebAssembly only.
impl<F> PromptHandler for SyncPrompt<F>
Available on non-WebAssembly only.
impl<T, F> PromptHandler for TypedPrompt<T, F>where
T: DeserializeOwned + Send + Sync + 'static,
F: Fn(T, RequestHandlerExtra) -> Pin<Box<dyn Future<Output = Result<GetPromptResult>> + Send>> + Send + Sync,
Available on non-WebAssembly only.