# Class AzureOpenAiChatCompletionStreamResponse<T>

Azure OpenAI chat completion stream response.

#### Type Parameters

- T

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

##### Index

### Constructors

constructor

### Accessors

rawResponse
stream

### Methods

_getFinishReasons
_getToolCallsAccumulators
_setFinishReasons
_setTokenUsage
_setToolCalls
getFinishReason
getRequestId
getTokenUsage
getToolCalls

## Constructors

### constructor

- new AzureOpenAiChatCompletionStreamResponse<T>(): AzureOpenAiChatCompletionStreamResponse<
  T,
  >

  #### Type Parameters

  - T

  #### Returns AzureOpenAiChatCompletionStreamResponse<T>

  #### Deprecated

  Since v2.9.0. Provide an HttpResponse parameter when constructing AzureOpenAiChatCompletionStreamResponse. This constructor overload will be removed in v3.0.0. Creates an Azure OpenAI chat completion stream response.

  - Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-completion-stream-response.d.ts:22
- new AzureOpenAiChatCompletionStreamResponse<T>(
  rawResponse: HttpResponse,
  ): AzureOpenAiChatCompletionStreamResponse<T>

  Creates an Azure OpenAI chat completion stream response.

  #### Type Parameters

  - T

  #### Parameters

  - rawResponse: HttpResponse

    The raw HTTP response. SSE data is not part of the immediate response.

  #### Returns AzureOpenAiChatCompletionStreamResponse<T>

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

## Accessors

### rawResponse

- get rawResponse(): HttpResponse

  Gets the raw HTTP response. SSE data is not part of the immediate response.

  #### Returns HttpResponse

  The raw HTTP response.

  #### Throws

  When constructed without a raw response parameter (deprecated).

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

### stream

- get stream(): AzureOpenAiChatCompletionStream<T>

  #### Returns AzureOpenAiChatCompletionStream<T>

  - Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-completion-stream-response.d.ts:67
- set stream(stream: AzureOpenAiChatCompletionStream<T>): void
  `Internal`

  #### Parameters

  - stream: AzureOpenAiChatCompletionStream<T>

  #### Returns void

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

## Methods

### _getFinishReasons

- _getFinishReasons(): Map<
  number,
  | "stop"
  | "length"
  | "tool_calls"
  | "content_filter"
  | "function_call"
  | null,
  >
  `Internal`

  #### Returns Map<
  number,
  | "stop"
  | "length"
  | "tool_calls"
  | "content_filter"
  | "function_call"
  | null,
  >

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

### _getToolCallsAccumulators

- _getToolCallsAccumulators(): Map<number, Map<number, ToolCallAccumulator>>
  `Internal`

  #### Returns Map<number, Map<number, ToolCallAccumulator>>

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

### _setFinishReasons

- _setFinishReasons(
  finishReasons: Map<
  number,
  | "stop"
  | "length"
  | "tool_calls"
  | "content_filter"
  | "function_call"
  | null,
  >,
  ): void
  `Internal`

  #### Parameters

  - finishReasons: Map<
    number,
    | "stop"
    | "length"
    | "tool_calls"
    | "content_filter"
    | "function_call"
    | null,
    >

  #### Returns void

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

### _setTokenUsage

- _setTokenUsage(usage: AzureOpenAiCompletionUsage): void
  `Internal`

  #### Parameters

  - usage: AzureOpenAiCompletionUsage

  #### Returns void

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

### _setToolCalls

- _setToolCalls(
  choiceIndex: number,
  toolCalls: AzureOpenAiChatCompletionMessageToolCalls,
  ): void
  `Internal`

  #### Parameters

  - choiceIndex: number
  - toolCalls: AzureOpenAiChatCompletionMessageToolCalls

  #### Returns void

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

### getFinishReason

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

  #### Parameters

  - `Optional` choiceIndex: number

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

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

### getRequestId

- getRequestId(): string | undefined

  Gets the request ID from the response headers.

  #### Returns string | undefined

  The request ID, or undefined if the header is not present.

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

### getTokenUsage

- getTokenUsage(): AzureOpenAiCompletionUsage | undefined

  #### Returns AzureOpenAiCompletionUsage | undefined

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

### getToolCalls

- getToolCalls(
  choiceIndex?: number,
  ): AzureOpenAiChatCompletionMessageToolCalls | undefined

  Gets the tool calls for a specific choice index.

  #### Parameters

  - `Optional` choiceIndex: number

    The index of the choice to get the tool calls for.

  #### Returns AzureOpenAiChatCompletionMessageToolCalls | undefined

  The tool calls for the specified choice index.

  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-response.d.ts:58