Skip to main content

DynLanguageModel

Trait DynLanguageModel 

Source
pub trait DynLanguageModel:
    Send
    + Sync
    + 'static {
    // Required methods
    fn provider(&self) -> &ProviderId;
    fn model_id(&self) -> &ModelId;
    fn supported_urls(&self) -> BoxFuture<'_, SupportedUrls>;
    fn do_generate(
        &self,
        options: CallOptions,
    ) -> BoxFuture<'_, Result<GenerateResult, ProviderError>>;
    fn do_stream(
        &self,
        options: CallOptions,
    ) -> BoxFuture<'_, Result<StreamResult, ProviderError>>;
}
Expand description

Object-safe counterpart of LanguageModel.

Implemented automatically for every LanguageModel; do not implement it by hand.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§