model_gateway_rs/sdk/mod.rs
1use async_trait::async_trait;
2use service_utils_rs::utils::ByteStream;
3
4use crate::error::Result;
5
6pub mod openai;
7
8#[async_trait]
9pub trait ModelSDK {
10 type Input;
11 type Output;
12
13 /// Send a request to the model and get a response.
14 async fn chat_once(&self, message: Self::Input) -> Result<Self::Output>;
15
16 /// Stream responses from the model.
17 async fn chat_stream(&self, messages: Self::Input) -> Result<ByteStream>;
18}