next_web_ai/model/
streaming_model.rs1use futures_core::stream::BoxStream;
2
3use next_web_core::{async_trait, error::BoxError};
4
5#[async_trait]
6pub trait StreamingModel<TReq, TResChunk>: Send {
7 async fn stream(
8 &self,
9 request: TReq,
10 ) -> Result<BoxStream<'static, Result<TResChunk, BoxError>>, BoxError>;
11}