Skip to main content

intercept_sse_stream

Function intercept_sse_stream 

Source
pub fn intercept_sse_stream<S, E>(
    stream: S,
    interceptor: Arc<SpeculativeStreamInterceptor>,
) -> BoxStream<'static, Result<Bytes, E>>
where S: Stream<Item = Result<Bytes, E>> + Send + 'static, E: Send + 'static,
Expand description

SSE ストリームをインターセプトし、文境界ごとの投機的ハルシネーション検証とサーキットブレークを行う。

ハルシネーションを検知した場合は、安全な置換エラーイベントを注入してストリームを遮断する。