Function build_prompt_ir

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 fn build_prompt_ir(request: &AnnotatedLlmRequest) -> Result<PromptIR>

Build a normalized PromptIR from an annotated LLM request.

The builder preserves prompt order, inserts tool-schema blocks before the first non-system message when tools are present, and computes the request hashes needed by downstream Adaptive Cache Governor (ACG) analysis.

Parameters

  • request: Annotated LLM request to normalize.

Returns

A Result containing the constructed PromptIR.

Errors

Returns an error when tool definitions or request components cannot be serialized into the canonical form required by the IR.