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

    Class AzureOpenAiChatCompletionStreamChunkResponse

    Azure OpenAI chat completion stream chunk response.

    Index

    Constructors

    Properties

    _data: AzureOpenAiCreateChatCompletionStreamResponse

    Methods

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

        • Optionallogprobs?:
              | {
                  content: AzureOpenAiChatCompletionTokenLogprob[]
                  | null;
                  refusal: AzureOpenAiChatCompletionTokenLogprob[] | null;
              } & Record<string, any>
              | null

          Log probability information for the choice.

      • undefined
    • Parses the chunk response and returns the delta content.

      Parameters

      • OptionalchoiceIndex: number

        The index of the choice to parse.

      Returns string | null | undefined

      The message delta content.

    • Gets the delta tool calls for a specific choice index.

      Parameters

      • OptionalchoiceIndex: number

        The index of the choice to parse.

      Returns AzureOpenAiChatCompletionMessageToolCallChunk[] | undefined

      The delta tool calls for the specified choice index.

    • Reason for stopping the completion stream chunk.

      Parameters

      • OptionalchoiceIndex: number

        The index of the choice to parse.

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

      The finish reason.

    • Usage of tokens in the chunk response.

      Returns AzureOpenAiCompletionUsage | null

      Token usage.

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