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