# Class AzureOpenAiChatCompletionStreamChunkResponse

Azure OpenAI chat completion stream chunk response.

- Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-completion-stream-chunk-response.d.ts:5

##### Index

### Constructors

constructor

### Properties

_data

### Methods

findChoiceByIndex
getDeltaContent
getDeltaToolCalls
getFinishReason
getTokenUsage

## Constructors

### constructor

- new AzureOpenAiChatCompletionStreamChunkResponse(
  _data: AzureOpenAiCreateChatCompletionStreamResponse,
  ): AzureOpenAiChatCompletionStreamChunkResponse

  #### Parameters

  - _data: AzureOpenAiCreateChatCompletionStreamResponse

  #### Returns AzureOpenAiChatCompletionStreamChunkResponse

  - Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-completion-stream-chunk-response.d.ts:7

## Properties

### `Readonly`_data

_data: AzureOpenAiCreateChatCompletionStreamResponse

- Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-completion-stream-chunk-response.d.ts:6

## Methods

### findChoiceByIndex

- findChoiceByIndex(
  index: number,
  ):
  | {
  delta: AzureOpenAiChatCompletionStreamResponseDelta;
  finish_reason: | "stop"
  | "length"
  | "tool_calls"
  | "content_filter"
  | "function_call"
  | null;
  index: number;
  logprobs?: | {
  content: AzureOpenAiChatCompletionTokenLogprob[]
  | null;
  refusal: AzureOpenAiChatCompletionTokenLogprob[] | null;
  } & Record<string, any>
  | null;
  } & Record<string, any>
  | undefined

  Parses the chunk response and returns the choice by index.

  #### Parameters

  - index: number

    The index of the choice to find.

  #### Returns
  | {
  delta: AzureOpenAiChatCompletionStreamResponseDelta;
  finish_reason: | "stop"
  | "length"
  | "tool_calls"
  | "content_filter"
  | "function_call"
  | null;
  index: number;
  logprobs?: | {
  content: AzureOpenAiChatCompletionTokenLogprob[]
  | null;
  refusal: AzureOpenAiChatCompletionTokenLogprob[] | null;
  } & Record<string, any>
  | null;
  } & Record<string, any>
  | undefined

  An LLMChoiceStreaming object associated withe index.

  - {
    delta: AzureOpenAiChatCompletionStreamResponseDelta;
    finish_reason:
    | "stop"
    | "length"
    | "tool_calls"
    | "content_filter"
    | "function_call"
    | null;
    index: number;
    logprobs?: | {
    content: AzureOpenAiChatCompletionTokenLogprob[]
    | null;
    refusal: AzureOpenAiChatCompletionTokenLogprob[] | null;
    } & Record<string, any>
    | null;
    } & Record<string, any>

    - ##### delta: AzureOpenAiChatCompletionStreamResponseDelta

    - ##### finish_reason: "stop" | "length" | "tool_calls" | "content_filter" | "function_call" | null

      The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.

    - ##### index: number

      The index of the choice in the list of choices.

    - ##### `Optional` logprobs?:
      | {
      content: AzureOpenAiChatCompletionTokenLogprob[]
      | null;
      refusal: AzureOpenAiChatCompletionTokenLogprob[] | null;
      } & Record<string, any>
      | null

      Log probability information for the choice.

  - undefined
  - Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-completion-stream-chunk-response.d.ts:36

### getDeltaContent

- getDeltaContent(choiceIndex?: number): string | null | undefined

  Parses the chunk response and returns the delta content.

  #### Parameters

  - `Optional` choiceIndex: number

    The index of the choice to parse.

  #### Returns string | null | undefined

  The message delta content.

  - Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-completion-stream-chunk-response.d.ts:24

### getDeltaToolCalls

- getDeltaToolCalls(
  choiceIndex?: number,
  ): AzureOpenAiChatCompletionMessageToolCallChunk[] | undefined

  Gets the delta tool calls for a specific choice index.

  #### Parameters

  - `Optional` choiceIndex: number

    The index of the choice to parse.

  #### Returns AzureOpenAiChatCompletionMessageToolCallChunk[] | undefined

  The delta tool calls for the specified choice index.

  - Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-completion-stream-chunk-response.d.ts:30

### getFinishReason

- getFinishReason(
  choiceIndex?: number,
  ):
  | "stop"
  | "length"
  | "tool_calls"
  | "content_filter"
  | "function_call"
  | null
  | undefined

  Reason for stopping the completion stream chunk.

  #### Parameters

  - `Optional` choiceIndex: number

    The index of the choice to parse.

  #### Returns
  | "stop"
  | "length"
  | "tool_calls"
  | "content_filter"
  | "function_call"
  | null
  | undefined

  The finish reason.

  - Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-completion-stream-chunk-response.d.ts:18

### getTokenUsage

- getTokenUsage(): AzureOpenAiCompletionUsage | null

  Usage of tokens in the chunk response.

  #### Returns AzureOpenAiCompletionUsage | null

  Token usage.

  Copyright Ⓒ 2026 SAP SE or an SAP affiliate company. All rights reserved.

  - Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-completion-stream-chunk-response.d.ts:12