MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / execute_llm_stream

Method execute_llm_stream

crates/core/src/plugins/nemo_guardrails/python.rs:154–170  ·  view source on GitHub ↗
(
        &self,
        request: LlmRequest,
        next: crate::api::runtime::LlmStreamExecutionNextFn,
        enable_input: bool,
        enable_output: bool,
    )

Source from the content-addressed store, hash-verified

152 }
153
154 async fn execute_llm_stream(
155 &self,
156 request: LlmRequest,
157 next: crate::api::runtime::LlmStreamExecutionNextFn,
158 enable_input: bool,
159 enable_output: bool,
160 ) -> FlowResult<LlmJsonStream> {
161 let (request, messages) = self.prepare_llm_request(request, enable_input).await?;
162 let provider_stream = next(request).await?;
163
164 if !enable_output || !self.bridge.has_streaming_output_rails().await? {
165 return Ok(provider_stream);
166 }
167
168 self.bridge.ensure_streaming_output_supported().await?;
169 self.guard_provider_stream(messages, provider_stream).await
170 }
171
172 async fn prepare_llm_request(
173 &self,

Callers 1

register_local_backendFunction · 0.80

Tested by

no test coverage detected