pub struct Prompt {
pub name: String,
pub title: Option<String>,
pub description: Option<String>,
pub icons: Option<Vec<ToolIcon>>,
pub arguments: Vec<PromptArgument>,
/* private fields */
}Expand description
A complete prompt definition with handler
Fields§
§name: String§title: Option<String>§description: Option<String>§icons: Option<Vec<ToolIcon>>§arguments: Vec<PromptArgument>Implementations§
Source§impl Prompt
impl Prompt
Sourcepub fn builder(name: impl Into<String>) -> PromptBuilder
pub fn builder(name: impl Into<String>) -> PromptBuilder
Create a new prompt builder
Sourcepub fn definition(&self) -> PromptDefinition
pub fn definition(&self) -> PromptDefinition
Get the prompt definition for prompts/list
Sourcepub fn get(
&self,
arguments: HashMap<String, String>,
) -> BoxFuture<'_, Result<GetPromptResult>>
pub fn get( &self, arguments: HashMap<String, String>, ) -> BoxFuture<'_, Result<GetPromptResult>>
Get the prompt with arguments
Sourcepub fn get_with_context(
&self,
ctx: RequestContext,
arguments: HashMap<String, String>,
) -> BoxFuture<'_, Result<GetPromptResult>>
pub fn get_with_context( &self, ctx: RequestContext, arguments: HashMap<String, String>, ) -> BoxFuture<'_, Result<GetPromptResult>>
Get the prompt with request context
Use this when you have a RequestContext available for progress/cancellation.
Sourcepub fn uses_context(&self) -> bool
pub fn uses_context(&self) -> bool
Returns true if this prompt uses context
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Prompt
impl !RefUnwindSafe for Prompt
impl Send for Prompt
impl Sync for Prompt
impl Unpin for Prompt
impl !UnwindSafe for Prompt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more