# Interface LlmResponse

LLM response class that provides the first candidate response from the model if available. Otherwise, returns error code and message.

interface LlmResponse {
citationMetadata?: CitationMetadata;
content?: Content;
customMetadata?: { [key: string]: unknown };
errorCode?: string;
errorMessage?: string;
finishReason?: FinishReason;
groundingMetadata?: GroundingMetadata;
inputTranscription?: Transcription;
interrupted?: boolean;
liveSessionResumptionUpdate?: LiveServerSessionResumptionUpdate;
outputTranscription?: Transcription;
partial?: boolean;
turnComplete?: boolean;
usageMetadata?: GenerateContentResponseUsageMetadata;
}

#### Hierarchy (View Summary)

- LlmResponse
  - Event

- Defined in models/llm_response.ts:22

## Properties

### `Optional` citationMetadata

citationMetadata?: CitationMetadata

The citation metadata of the response.

- Defined in models/llm_response.ts:36

### `Optional` content

content?: Content

The content of the response.

- Defined in models/llm_response.ts:26

### `Optional` customMetadata

customMetadata?: { [key: string]: unknown }

The custom metadata of the LlmResponse. An optional key-value pair to label an LlmResponse. NOTE: the entire object must be JSON serializable.

- Defined in models/llm_response.ts:71

### `Optional` errorCode

errorCode?: string

Error code if the response is an error. Code varies by model.

- Defined in models/llm_response.ts:53

### `Optional` errorMessage

errorMessage?: string

Error message if the response is an error.

- Defined in models/llm_response.ts:58

### `Optional` finishReason

finishReason?: FinishReason

The finish reason of the response.

- Defined in models/llm_response.ts:81

### `Optional` groundingMetadata

groundingMetadata?: GroundingMetadata

The grounding metadata of the response.

- Defined in models/llm_response.ts:31

### `Optional` inputTranscription

inputTranscription?: Transcription

Audio transcription of user input.

- Defined in models/llm_response.ts:91

### `Optional` interrupted

interrupted?: boolean

Flag indicating that LLM was interrupted when generating the content. Usually it's due to user interruption during a bidi streaming.

- Defined in models/llm_response.ts:64

### `Optional` liveSessionResumptionUpdate

liveSessionResumptionUpdate?: LiveServerSessionResumptionUpdate

The session resumption update of the LlmResponse

- Defined in models/llm_response.ts:86

### `Optional` outputTranscription

outputTranscription?: Transcription

Audio transcription of model output.

- Defined in models/llm_response.ts:96

### `Optional` partial

partial?: boolean

Indicates whether the text content is part of a unfinished text stream. Only used for streaming mode and when the content is plain text.

- Defined in models/llm_response.ts:42

### `Optional` turnComplete

turnComplete?: boolean

Indicates whether the response from the model is complete. Only used for streaming mode.

- Defined in models/llm_response.ts:48

### `Optional` usageMetadata

usageMetadata?: GenerateContentResponseUsageMetadata

The usage metadata of the LlmResponse.

- Defined in models/llm_response.ts:76