pub trait Chat: WasmCompatSend + WasmCompatSync {
// Required method
fn chat(
&self,
prompt: impl Into<Message> + WasmCompatSend,
chat_history: &mut Vec<Message>,
) -> impl Future<Output = Result<String, PromptError>> + WasmCompatSend;
}Expand description
High-level prompting with caller-owned canonical chat history.
Required Methods§
Sourcefn chat(
&self,
prompt: impl Into<Message> + WasmCompatSend,
chat_history: &mut Vec<Message>,
) -> impl Future<Output = Result<String, PromptError>> + WasmCompatSend
fn chat( &self, prompt: impl Into<Message> + WasmCompatSend, chat_history: &mut Vec<Message>, ) -> impl Future<Output = Result<String, PromptError>> + WasmCompatSend
Execute one turn and append only committed messages to chat_history.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".