Struct LlmJson Stream

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

1pub struct LlmJsonStream { /* private fields */ }

Stream of JSON chunks produced by the managed streaming LLM pipeline.

In addition to ordinary stream polling, managed streams provide an explicit asynchronous close operation. A successful close means the producer has released its resources; subsequent polls return no more chunks.

Implementations

impl LlmJsonStream

impl LlmJsonStream

new

pub fn new<S>(stream: S) -> Selfwhere
    S: Stream<Item = Result<Json>> + Send + 'static,

Wrap a stream whose producer has no asynchronous teardown work.

from_closeable

pub fn from_closeable<S>(stream: S) -> Selfwhere
    S: LlmStreamInner + 'static,

Wrap a stream that implements explicit asynchronous teardown.

close

pub async fn close(&mut self) -> Result<()>

Stop the producer and wait for its cleanup to complete.

Trait Implementations

impl Stream for LlmJsonStream

impl Stream for LlmJsonStream

Item

type Item = Result<Value, FlowError>

poll_next

fn poll_next(
    self: Pin<&mut Self>,
    cx: &mut Context<'_>,
) -> Poll<Option<Self::Item>>

size_hint

fn size_hint(&self) -> (usize, Option<usize>)