Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.
pub trait StreamingCodec: Send + Sync {
// Required methods
fn collector(&self) -> LlmCollectorFn;
fn finalizer(&self) -> LlmFinalizerFn;
}
Per-provider streaming codec used with crate::api::llm::llm_stream_call_execute.
collector() and finalizer() produce owned closures that share the codec’s internal accumulation state. Implementations typically wrap that state in Arc<Mutex<...>> so each &self-produced closure captures a clone of the handle.
LlmFinalizerFn is FnOnce, so a StreamingCodec instance is single-use: callers construct a fresh instance per managed-lifecycle call and discard it after the stream completes.
collectorfn collector(&self) -> LlmCollectorFn
Returns a closure that consumes one decoded provider event per call.
finalizerfn finalizer(&self) -> LlmFinalizerFn
Returns a closure that, when called once at end of stream, produces the assembled response payload in the shape the matching crate::codec::traits::LlmResponseCodec can decode.
impl StreamingCodec for AnthropicMessagesStreamingCodecimpl StreamingCodec for AnthropicMessagesStreamingCodec
impl StreamingCodec for OpenAIChatStreamingCodecimpl StreamingCodec for OpenAIChatStreamingCodec
impl StreamingCodec for OpenAIResponsesStreamingCodecimpl StreamingCodec for OpenAIResponsesStreamingCodec