Skip to main content

PromptHandler

Type Alias PromptHandler 

Source
pub type PromptHandler = Arc<dyn Fn(RequestContext, JsonObject) -> BoxReadFuture + Send + Sync>;
Expand description

Serves one prompts/get, given the arguments the peer sent.

Takes the whole argument object rather than a decoded one: prompt arguments are free-form by revision — a template like {diff} or {focus} is the specification’s own idiom — so there is no fixed struct to decode into without turning a user’s template into this crate’s invention. Owned arguments, for the same reason as ResourceHandler.

Aliased Type§

pub struct PromptHandler { /* private fields */ }