SAP AI SDK for JavaScript - v2.8.0
    Preparing search index...

    Class OrchestrationStreamResponse<T>

    Orchestration stream response.

    Type Parameters

    • T
    Index

    Constructors

    • Type Parameters

      • T

      Returns OrchestrationStreamResponse<T>

      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.

    • 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>

    Properties

    _data: Partial<CompletionPostResponse>
    _openStream: boolean

    Accessors

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

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

    Methods

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

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

      Parameters

      • OptionalchoiceIndex: number

        The index of the choice to parse.

      Returns ChatMessages | undefined

      A list of all messages.

    • Gets the assistant message from the response.

      Parameters

      • OptionalchoiceIndex: number

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

      Returns AssistantChatMessage | undefined

      The assistant message.

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

      Parameters

      • OptionalchoiceIndex: number

        The index of the choice to parse.

      Returns string | undefined

      The message content.

    • Gets the finish reason for a specific choice index.

      Parameters

      • OptionalchoiceIndex: number

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

      Returns string | undefined

      The finish reason for the specified choice index.

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

    • Gets the intermediate results from the orchestration response.

      Returns ModuleResults | undefined

      The intermediate results.

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

      Parameters

      • OptionalchoiceIndex: number

        The index of the choice to parse.

      Returns string | undefined

      The refusal string.

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

    • Gets the token usage for the response.

      Returns TokenUsage | undefined

      The token usage for the response.

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

      Parameters

      • OptionalchoiceIndex: 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.