Type Alias LlmStream Execution Fn
Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -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 type LlmStreamExecutionFn = Arc<dyn Fn(&str, LlmRequest, LlmExecutionContext, Arc<dyn Fn(LlmRequest) -> Pin<Box<dyn Future<Output = Result<LlmJsonStream, FlowError>> + Send>> + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<LlmJsonStream, FlowError>> + Send>> + Sync + Send>;
Wrap or replace streaming LLM execution.
A streaming execution intercept can observe or modify the request before invoking the continuation, and it can also replace the returned stream. Its execution context exposes the request codec but deliberately omits a response codec because Relay codecs decode complete responses, not chunks.
Parameters
- First argument: Logical provider or model family name.
- Second argument: Current LLM request.
- Third argument: Request codec context with no response direction.
- Fourth argument: Continuation for the remaining streaming execution chain.
Returns
A future resolving to a JSON chunk stream.
Errors
The future resolves to an error when the intercept or remaining streaming execution chain fails.