pub trait LanguageModel {
// Required methods
fn generate_text_with_options<P>(
&self,
prompt: P,
options: GenerationOptions,
) -> impl Future<Output = Result<ResponseText, Error>> + '_
where P: TryInto<Prompt>,
P::Error: Into<Error>;
fn stream_text_with_options<P>(
&self,
prompt: P,
options: GenerationOptions,
) -> Result<ResponseStream, Error>
where P: TryInto<Prompt>,
P::Error: Into<Error>;
}Expand description
Provider-agnostic language-model boundary used by sessions and provider handles.
Required Methods§
Sourcefn generate_text_with_options<P>(
&self,
prompt: P,
options: GenerationOptions,
) -> impl Future<Output = Result<ResponseText, Error>> + '_
fn generate_text_with_options<P>( &self, prompt: P, options: GenerationOptions, ) -> impl Future<Output = Result<ResponseText, Error>> + '_
Sourcefn stream_text_with_options<P>(
&self,
prompt: P,
options: GenerationOptions,
) -> Result<ResponseStream, Error>
fn stream_text_with_options<P>( &self, prompt: P, options: GenerationOptions, ) -> Result<ResponseStream, Error>
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.