# Class OrchestrationStreamResponse<T>

Orchestration stream response.

#### Type Parameters

- T

- Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:7

##### Index

### Constructors

constructor

### Properties

_data
_openStream

### Accessors

rawResponse
stream

### Methods

findChoiceByIndex
getAllMessages
getAssistantMessage
getCitations
getContent
getFinishReason
getIntermediateFailures
getIntermediateResults
getRefusal
getRequestId
getTokenUsage
getToolCalls

## Constructors

### constructor

- new OrchestrationStreamResponse<T>(): OrchestrationStreamResponse<T>

  #### Type Parameters

  - T

  #### Returns OrchestrationStreamResponse<T>

  #### Deprecated

  Since v2.6.0. Provide an HttpResponse parameter when constructing OrchestrationStreamResponse. This constructor overload will be removed in v3.0.0. Creates an orchestration stream response.

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:16
- new OrchestrationStreamResponse<T>(
  rawResponse: HttpResponse,
  ): OrchestrationStreamResponse<T>

  Creates an orchestration stream response.

  #### Type Parameters

  - T

  #### Parameters

  - rawResponse: HttpResponse

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

  #### Returns OrchestrationStreamResponse<T>

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:21

## Properties

### _data

_data: Partial<CompletionPostResponse>

- Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:9

### _openStream

_openStream: boolean

- Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:8

## Accessors

### rawResponse

- get rawResponse(): HttpResponse

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

  #### Returns HttpResponse

  The raw HTTP response.

  #### Throws

  When OrchestrationStreamResponse was constructed without a raw response parameter (deprecated).

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:27

### stream

- get stream(): OrchestrationStream<T>

  #### Returns OrchestrationStream<T>

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:99
- set stream(stream: OrchestrationStream<T>): void
  `Internal`

  #### Parameters

  - stream: OrchestrationStream<T>

  #### Returns void

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:103

## Methods

### findChoiceByIndex

- findChoiceByIndex(index: number): LlmChoice | undefined

  Parses the response and returns the choice by index.

  #### Parameters

  - index: number

    The index of the choice to find.

  #### Returns LlmChoice | undefined

  An LLMChoice object associated with the index.

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:92

### getAllMessages

- getAllMessages(choiceIndex?: number): ChatMessages | undefined

  Messages that can be used for subsequent prompts as message history.

  #### Parameters

  - `Optional` choiceIndex: number

    The index of the choice to parse.

  #### Returns ChatMessages | undefined

  A list of all messages.

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:68

### getAssistantMessage

- getAssistantMessage(choiceIndex?: number): AssistantChatMessage | undefined

  Gets the assistant message from the response.

  #### Parameters

  - `Optional` choiceIndex: number

    The index of the choice to use (default is 0).

  #### Returns AssistantChatMessage | undefined

  The assistant message.

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:74

### getCitations

- getCitations(): Citation[] | undefined

  Gets the citations from the orchestration response. Citations are returned by models like Perplexity Sonar that provide source references.

  #### Returns Citation[] | undefined

  The citations, or undefined if there are none.

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:98

### getContent

- getContent(choiceIndex?: number): string | undefined

  Parses the orchestration response and returns the content. If the response was filtered, an error is thrown.

  #### Parameters

  - `Optional` choiceIndex: number

    The index of the choice to parse.

  #### Returns string | undefined

  The message content.

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:50

### getFinishReason

- getFinishReason(choiceIndex?: number): string | undefined

  Gets the finish reason for a specific choice index.

  #### Parameters

  - `Optional` choiceIndex: number

    The index of the choice to get the finish reason for.

  #### Returns string | undefined

  The finish reason for the specified choice index.

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:43

### getIntermediateFailures

- getIntermediateFailures(): OrchestrationError[] | undefined

  Gets the intermediate failures from the orchestration response. When using module fallback, this contains errors from module configurations that failed before a successful one was found.

  #### Returns OrchestrationError[] | undefined

  The intermediate failures, or undefined if there were none.

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:86

### getIntermediateResults

- getIntermediateResults(): ModuleResults | undefined

  Gets the intermediate results from the orchestration response.

  #### Returns ModuleResults | undefined

  The intermediate results.

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:79

### getRefusal

- getRefusal(choiceIndex?: number): string | undefined

  Parses the orchestration response and returns the refusal message generated by the model.

  #### Parameters

  - `Optional` choiceIndex: number

    The index of the choice to parse.

  #### Returns string | undefined

  The refusal string.

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:62

### getRequestId

- getRequestId(): string | undefined

  Gets the request ID for the stream response.

  #### Returns string | undefined

  The request ID, or undefined if the first chunk has not been received yet.

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:37

### getTokenUsage

- getTokenUsage(): TokenUsage | undefined

  Gets the token usage for the response.

  #### Returns TokenUsage | undefined

  The token usage for the response.

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:32

### getToolCalls

- getToolCalls(choiceIndex?: number): MessageToolCalls | undefined

  Parses the orchestration response and returns the tool calls generated by the model.

  #### Parameters

  - `Optional` choiceIndex: number

    The index of the choice to parse.

  #### Returns MessageToolCalls | undefined

  The message tool calls.

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

  - Defined in packages/orchestration/dist/orchestration-stream-response.d.ts:56