Trait ModelSDK

Source
pub trait ModelSDK {
    type Input;
    type Output;

    // Required methods
    fn chat_once<'life0, 'async_trait>(
        &'life0 self,
        message: Self::Input,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn chat_stream<'life0, 'async_trait>(
        &'life0 self,
        messages: Self::Input,
    ) -> Pin<Box<dyn Future<Output = Result<ByteStream>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Associated Types§

Required Methods§

Source

fn chat_once<'life0, 'async_trait>( &'life0 self, message: Self::Input, ) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a request to the model and get a response.

Source

fn chat_stream<'life0, 'async_trait>( &'life0 self, messages: Self::Input, ) -> Pin<Box<dyn Future<Output = Result<ByteStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stream responses from the model.

Implementors§