# Class OrchestrationResponse

Representation of an orchestration response.

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

##### Index

### Constructors

constructor

### Properties

_data
rawResponse

### Methods

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

## Constructors

### constructor

- new OrchestrationResponse(rawResponse: HttpResponse): OrchestrationResponse

  #### Parameters

  - rawResponse: HttpResponse

  #### Returns OrchestrationResponse

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

## Properties

### `Readonly`_data

_data: CompletionPostResponse

The completion post response.

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

### `Readonly` rawResponse

rawResponse: HttpResponse

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

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

### getAllMessages

- getAllMessages(choiceIndex?: number): ChatMessages

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

  #### Parameters

  - `Optional` choiceIndex: number

    The index of the choice to parse.

  #### Returns ChatMessages

  A list of all messages.

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

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

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

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

### getFinishReason

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

  Reason for stopping the completion.

  #### Parameters

  - `Optional` choiceIndex: number

    The index of the choice to parse.

  #### Returns string | undefined

  The finish reason.

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

### 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.

  Each failure includes:

  - message: Description of what went wrong
  - code: Error code identifying the type of failure
  - location: Position in the fallback chain (e.g., "config[0]", "config[1]").

  #### Returns OrchestrationError[] | undefined

  The intermediate failures, or undefined if there were none.

  #### Example

      const response = await client.chatCompletion();
      const failures = response.getIntermediateFailures();
      if (failures) {
        failures.forEach(f => console.log(`${f.location}: ${f.message}`));
      }

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

### getIntermediateResults

- getIntermediateResults(): ModuleResults

  Gets the intermediate results from the orchestration response.

  #### Returns ModuleResults

  The intermediate results.

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

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

### getRequestId

- getRequestId(): string

  Gets the request ID from the orchestration response.

  #### Returns string

  The request ID.

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

### getTokenUsage

- getTokenUsage(): TokenUsage

  Usage of tokens in the response.

  #### Returns TokenUsage

  Token usage.

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

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