ModelExt

Trait ModelExt 

Source
pub trait ModelExt: Model {
    // Provided method
    fn structured_output<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        messages: &'life1 [Message],
        system_prompt: Option<&'life2 str>,
    ) -> Pin<Box<dyn Future<Output = Result<T, StrandsError>> + Send + 'async_trait>>
       where T: DeserializeOwned + JsonSchema + Send + 'async_trait,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Extension trait for models with additional functionality.

Provided Methods§

Source

fn structured_output<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, messages: &'life1 [Message], system_prompt: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<T, StrandsError>> + Send + 'async_trait>>
where T: DeserializeOwned + JsonSchema + Send + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Generates a structured output from the model.

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.

Implementors§

Source§

impl<T: Model> ModelExt for T