pub trait IntoPrompt {
type Message: Send + Sync + 'static;
// Required method
fn into_prompt(self) -> Vec<Self::Message>;
}
Expand description
Converts a value into a series of chat messages.
Provider crates typically use crate::generic::GenericMessage
, but a
back-end can require its own richer struct. By making the Message
type
an associated type we keep the trait flexible without resorting to
dynamic dispatch.
Required Associated Types§
Required Methods§
Sourcefn into_prompt(self) -> Vec<Self::Message>
fn into_prompt(self) -> Vec<Self::Message>
Consume self
and return all messages in the desired order.
Implementors§
Source§impl IntoPrompt for GenericMessage
Convenience implementation so a single crate::generic::GenericMessage
can be passed directly to the client without wrapping it in a struct.
impl IntoPrompt for GenericMessage
Convenience implementation so a single crate::generic::GenericMessage
can be passed directly to the client without wrapping it in a struct.