> This page is for NeMo Relay, version v1.0.0.
> For other versions, use one of these documentation indexes:
> - Latest (v0.11.2) (default): https://docs.nvidia.com/nemo/relay/latest/llms.txt
> - dev: https://docs.nvidia.com/nemo/relay/dev/llms.txt
> - v1.0.0: https://docs.nvidia.com/nemo/relay/v1.0.0/llms.txt
> - v0.11.2: https://docs.nvidia.com/nemo/relay/v0.11.2/llms.txt
> - v0.10.4: https://docs.nvidia.com/nemo/relay/v0.10.4/llms.txt
> - v0.9.4: https://docs.nvidia.com/nemo/relay/v0.9.4/llms.txt
> - v0.8.4: https://docs.nvidia.com/nemo/relay/v0.8.4/llms.txt

> For clean Markdown of any page, append .md to the page URL. For a task-oriented documentation index, fetch https://docs.nvidia.com/nemo/relay/llms.txt. Use the documentation version matching the installed NeMo Relay package: latest follows the latest stable release, vX.Y.Z identifies a retained release snapshot, and dev documents development changes. Preserve the selected version when following links; do not mix examples or API contracts from different versions. Fetch the relevant section's /llms.txt before individual pages instead of loading a complete version index.

# Struct Annotated LlmResponse

> Structured view of an LLM response, produced by a response codec from raw JSON API output.

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`.

<pre />

Structured view of an LLM response, produced by a response codec from raw JSON API output.

The `extra` field captures any top-level keys not modeled by the known fields, ensuring lossless round-trip through serde.

## Fields

### `id: Option<String>`

Response ID from the API (e.g., "chatcmpl-abc123", "resp_abc123", "msg_abc123").

### `model: Option<String>`

The model that actually served the request (may differ from requested model).

### `message: Option<MessageContent>`

The assistant's response content, reusing [`MessageContent`](/reference/api/rust-library-reference/nemo-relay-types/codec/request/enum-messagecontent) from request types.

### `tool_calls: Option<Vec<ResponseToolCall>>`

Tool calls requested by the model, normalized across APIs.

Uses [`ResponseToolCall`](/reference/api/rust-library-reference/nemo-relay-types/codec/response/struct-responsetoolcall) (arguments as [`Json`](/reference/api/rust-library-reference/nemo-relay-plugin/type-json)) NOT the request-side `ToolCall` (arguments as `String`).

### `finish_reason: Option<FinishReason>`

Why generation stopped, normalized across APIs.

### `usage: Option<Usage>`

Token usage statistics.

### `optimization_summary: Option<LlmOptimizationSummary>`

Plugin-neutral optimization accounting computed by Relay at LLM close.

### `api_specific: Option<ApiSpecificResponse>`

API-specific response data that cannot be normalized across providers.

### `extra: Map<String, Value>`

Catch-all for unmodeled top-level fields, ensuring lossless round-trip.

## Implementations

### `impl AnnotatedLlmResponse`

<pre />

#### `output`

<pre />

Inspect current normalized content followed by separate tool calls.

This does not reconstruct provider ordering between those fields.

#### `response_text`

<pre />

Join all explicit text/refusals in the current output, excluding tools.

#### `has_tool_calls`

<pre />

Check if the response contains any tool calls.

Returns `true` if `tool_calls` is `Some` with at least one element.

## Trait Implementations

### `impl Clone for AnnotatedLlmResponse`

<pre />

#### `clone`

<pre />

#### `clone_from`

<pre />

### `impl Debug for AnnotatedLlmResponse`

<pre />

#### `fmt`

<pre />

### `impl Default for AnnotatedLlmResponse`

<pre />

#### `default`

<pre />

### `impl<'de> Deserialize<'de> for AnnotatedLlmResponse`

<pre />

#### `deserialize`

<pre />

### `impl PartialEq for AnnotatedLlmResponse`

<pre />

#### `eq`

<pre />

#### `ne`

<pre />

### `impl Serialize for AnnotatedLlmResponse`

<pre />

#### `serialize`

<pre />

### `impl StructuralPartialEq for AnnotatedLlmResponse`

<pre />