Skip to navigation

Struct LlmExecution Context

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.

pub struct LlmExecutionContext { /* private fields */ }

Codec access for one LLM execution.

Request codec information is always present. Response codec access is available only for non-streaming calls because response codecs expect a complete response, not individual chunks.

Relay chooses the codecs before interceptors run. Changing the payload does not select a different codec. Codec handles expire when the interceptor finishes; a streaming request handle remains valid until its returned stream ends or closes. Later use returns FlowError::InvalidArgument. Public construction supports direct callback tests; only Relay can attach active, revocable codec handles.

Implementations

impl LlmExecutionContext

impl LlmExecutionContext

new

pub fn new(
    request_codec: LlmRequestContext,
    response_codec: Option<LlmResponseContext>,
) -> Self

Construct an execution context from request and optional response codec context.

request_codec

pub fn request_codec(&self) -> &LlmRequestContext

Return the request-direction codec identity and revocable capability.

response_codec

pub fn response_codec(&self) -> Option<&LlmResponseContext>

Return the completed-response codec identity and revocable capability.

Streaming execution returns None because Relay does not expose a completed-response codec for individual stream chunks.

Trait Implementations

impl Clone for LlmExecutionContext

impl Clone for LlmExecutionContext

clone

fn clone(&self) -> LlmExecutionContext

clone_from

fn clone_from(&mut self, source: &Self)

impl Debug for LlmExecutionContext

impl Debug for LlmExecutionContext

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Default for LlmExecutionContext

impl Default for LlmExecutionContext

default

fn default() -> LlmExecutionContext