pub trait GenerativeModel: Send + Sync {
// Required method
fn generate(&self, input: &[Message]) -> AsyncStream<GenerationEvent>;
}Required Methods§
Sourcefn generate(&self, input: &[Message]) -> AsyncStream<GenerationEvent>
fn generate(&self, input: &[Message]) -> AsyncStream<GenerationEvent>
One attempt. Failure ends the stream; dropping it cancels the request.
A successful stream starts with MessagePart::MessageStart and includes
a MessagePart::TurnEndReason. A custom model should emit parts that
MessageAccumulator can validate. Calls do not execute tools or retry.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".