pub trait RustPrompt: Send + Sync {
type Params: DeserializeOwned + JsonSchema + Send;
const NAME: &'static str;
const DESCRIPTION: &'static str;
// Required method
fn render(
&self,
params: Self::Params,
) -> impl Future<Output = Result<PromptOutput, ToolError>> + Send;
// Provided method
fn description(&self) -> Cow<'static, str> { ... }
}Expand description
A custom prompt template implemented in Rust with strongly-typed parameters.
Required Associated Constants§
Sourceconst DESCRIPTION: &'static str
const DESCRIPTION: &'static str
Human-readable description.
Required Associated Types§
Sourcetype Params: DeserializeOwned + JsonSchema + Send
type Params: DeserializeOwned + JsonSchema + Send
The strongly-typed parameters struct deriving Deserialize + JsonSchema.
Required Methods§
Provided Methods§
Sourcefn description(&self) -> Cow<'static, str>
fn description(&self) -> Cow<'static, str>
Return the prompt description.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".