pub enum Prompt {
Text(TextPromptClient),
Chat(ChatPromptClient),
}Expand description
Unified prompt type — either Text or Chat.
Returned by PromptManager::get_prompt.
Use is_text / is_chat or pattern
matching to determine the variant.
Variants§
Text(TextPromptClient)
A text prompt with {{variable}} template support.
Chat(ChatPromptClient)
A chat prompt with a list of messages.
Implementations§
Source§impl Prompt
impl Prompt
Sourcepub fn as_text(&self) -> Option<&TextPromptClient>
pub fn as_text(&self) -> Option<&TextPromptClient>
Returns a reference to the inner TextPromptClient if this is a text prompt.
Sourcepub fn as_chat(&self) -> Option<&ChatPromptClient>
pub fn as_chat(&self) -> Option<&ChatPromptClient>
Returns a reference to the inner ChatPromptClient if this is a chat prompt.
Sourcepub fn is_fallback(&self) -> bool
pub fn is_fallback(&self) -> bool
Returns whether this prompt was served from an expired cache entry (fallback).
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 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