pub struct Prompt {
pub name: String,
pub description: Option<String>,
pub title: Option<String>,
pub icons: Option<Vec<Icon>>,
pub arguments: Option<Vec<PromptArgument>>,
pub meta: Option<HashMap<String, Value>>,
}Expand description
Prompt definition.
Describes a retrievable prompt with its arguments and metadata.
Fields§
§name: StringPrompt name (machine-readable identifier)
description: Option<String>Prompt description
title: Option<String>Human-readable title
icons: Option<Vec<Icon>>Prompt icons
arguments: Option<Vec<PromptArgument>>Prompt arguments
meta: Option<HashMap<String, Value>>Extension metadata (tags, version, etc.)
Implementations§
Source§impl Prompt
impl Prompt
Sourcepub fn new(name: impl Into<String>, description: impl Into<String>) -> Prompt
pub fn new(name: impl Into<String>, description: impl Into<String>) -> Prompt
Create a new prompt with name and description.
Sourcepub fn with_argument(self, arg: PromptArgument) -> Prompt
pub fn with_argument(self, arg: PromptArgument) -> Prompt
Add an argument to the prompt.
Sourcepub fn with_required_arg(
self,
name: impl Into<String>,
description: impl Into<String>,
) -> Prompt
pub fn with_required_arg( self, name: impl Into<String>, description: impl Into<String>, ) -> Prompt
Add a required argument.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Prompt
impl<'de> Deserialize<'de> for Prompt
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Prompt, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Prompt, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Prompt
impl Serialize for Prompt
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Prompt
Auto Trait Implementations§
impl Freeze for Prompt
impl RefUnwindSafe for Prompt
impl Send for Prompt
impl Sync for Prompt
impl Unpin for Prompt
impl UnsafeUnpin 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