> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For full documentation content, see https://docs.nvidia.com/nemo/relay/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# 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 -p nemo-relay-adaptive -p nemo-relay-ffi`.

<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/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/codec/response/struct-responsetoolcall) (arguments as [`Json`](/reference/api/rust-library-reference/nemo-relay/json/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.

### `api_specific: Option<ApiSpecificResponse>`

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

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

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

## Implementations

### `impl AnnotatedLlmResponse`

<pre />

#### `response_text`

<pre />

Extract the text content of the response message.

For [`MessageContent::Text`](/reference/api/rust-library-reference/nemo-relay/codec/request/enum-messagecontent), returns the string directly. For [`MessageContent::Parts`](/reference/api/rust-library-reference/nemo-relay/codec/request/enum-messagecontent), returns the text of the first [`super::request::ContentPart::Text`](/reference/api/rust-library-reference/nemo-relay/codec/request/enum-contentpart) part. Returns `None` if `message` is `None`.

#### `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<'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 />