pub trait Prompt: WasmCompatSend + WasmCompatSync {
// Required method
fn prompt(
&self,
prompt: impl Into<Message> + WasmCompatSend,
) -> impl IntoFuture<Output = Result<String, PromptError>, IntoFuture: WasmCompatSend>;
}Expand description
Trait defining a high-level LLM simple prompt interface (i.e.: prompt in, response out).
Required Methods§
Sourcefn prompt(
&self,
prompt: impl Into<Message> + WasmCompatSend,
) -> impl IntoFuture<Output = Result<String, PromptError>, IntoFuture: WasmCompatSend>
fn prompt( &self, prompt: impl Into<Message> + WasmCompatSend, ) -> impl IntoFuture<Output = Result<String, PromptError>, IntoFuture: WasmCompatSend>
Send a simple prompt to the underlying completion model.
If the completion model’s response is a message, then it is returned as a string.
If the completion model’s response is a tool call, then the tool is called and the result is returned as a string.
If the tool does not exist, or the tool call fails, then an error is returned.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.