Package com.sap.ai.sdk.core.common

# Interface StreamedDelta

All Known Implementing Classes:
  `OpenAiChatCompletionDelta`, `OpenAiChatCompletionDelta`, `OrchestrationChatCompletionDelta`

public interface StreamedDelta
Interface for streamed delta classes.

This interface defines a method to retrieve the content from a delta, which is a chunk in a stream of data. Implementations of this interface should provide the logic to extract the relevant content from the delta.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getDeltaContent()`
  Get the message content from the delta.
  `String`
  `getFinishReason()`
  Reason for finish.

- ## Method Details

  - ### getDeltaContent

    @Nonnull String getDeltaContent()
    Get the message content from the delta.

    Note: If there are multiple choices only the first one is returned

    Note: Some deltas do not contain any content

    Returns:
      the message content or empty string.

  - ### getFinishReason

    @Nullable String getFinishReason()
    Reason for finish. The possible values are:

    `stop`: API returned complete message, or a message terminated by one of the stop sequences provided via the stop parameter

    `length`: Incomplete model output due to max_tokens parameter or token limit

    `function_call`: The model decided to call a function

    `content_filter`: Omitted content due to a flag from our content filters

    `null`: API response still in progress or incomplete

    Returns:
      the finish reason or null.