pub struct Prompt(_);Implementations§
source§impl Prompt
impl Prompt
pub fn new_from_text_prompt(text_prompt: TextPrompt) -> Self
pub fn new_from_chat_prompt(chat_prompt: ChatPrompt) -> Self
pub fn as_chat_prompt(&self) -> Vec<ChatMessage>
pub fn as_text_prompt(&self) -> Option<&PromptTemplate>
pub fn as_text_prompt_or_convert(&self) -> PromptTemplate
pub async fn run<E: Executor>( &self, parameters: &Parameters, executor: &E ) -> Result<E::Output, E::Error>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Prompt
impl<'de> Deserialize<'de> for Prompt
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<ChatPrompt> for Prompt
impl From<ChatPrompt> for Prompt
source§fn from(chat_prompt: ChatPrompt) -> Self
fn from(chat_prompt: ChatPrompt) -> Self
Converts to this type from the input type.
source§impl From<TextPrompt> for Prompt
impl From<TextPrompt> for Prompt
source§fn from(text_prompt: TextPrompt) -> Self
fn from(text_prompt: TextPrompt) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request