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 TypeMethodDescriptionGet the message content from the delta.Reason for finish.
-
Method Details
-
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
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 parameterlength: Incomplete model output due to max_tokens parameter or token limitfunction_call: The model decided to call a functioncontent_filter: Omitted content due to a flag from our content filtersnull: API response still in progress or incomplete- Returns:
- the finish reason or null.
-