Trait ClientInstantiate

Source
pub trait ClientInstantiate {
    // Required method
    fn instantiate_parameterized<T: MagicInstantiate>(
        &self,
        parameters: MagicInstantiateParameters,
    ) -> impl Future<Output = Result<T, InstantiateError>>;

    // Provided method
    fn instantiate<T: MagicInstantiate>(
        &self,
        instructions: &str,
    ) -> impl Future<Output = Result<T, InstantiateError>> { ... }
}
Expand description

An extension trait for OpenAIClient that adds a method to instantiate a value.

Required Methods§

Source

fn instantiate_parameterized<T: MagicInstantiate>( &self, parameters: MagicInstantiateParameters, ) -> impl Future<Output = Result<T, InstantiateError>>

Instantiate a value using custom parameters.

Provided Methods§

Source

fn instantiate<T: MagicInstantiate>( &self, instructions: &str, ) -> impl Future<Output = Result<T, InstantiateError>>

Instantiate a value using the global model settings.

Use mutate_global_model_settings to set them.

instructions is a string that describes how the user wants the value to be instantiated.

See the instantiate_parameterized method for more information.

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.

Implementations on Foreign Types§

Source§

impl<C: Config> ClientInstantiate for Client<C>

Implementors§