Class ChatCompletionStreamOptions
java.lang.Object
com.sap.ai.sdk.foundationmodels.openai.generated.model.ChatCompletionStreamOptions
Options for streaming response. Only set this when you set `stream: true`.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theChatCompletionStreamOptions.inthashCode()includeUsage(Boolean includeUsage) Set the includeUsage of thisChatCompletionStreamOptionsinstance and return the same instance.If set, an additional chunk will be streamed before the `data: [DONE]` message.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisChatCompletionStreamOptionsinstance.voidsetIncludeUsage(Boolean includeUsage) Set the includeUsage of thisChatCompletionStreamOptionsinstance.toMap()Get the value of all properties of thisChatCompletionStreamOptionsinstance including unrecognized properties.toString()
-
Constructor Details
-
ChatCompletionStreamOptions
public ChatCompletionStreamOptions()
-
-
Method Details
-
includeUsage
Set the includeUsage of thisChatCompletionStreamOptionsinstance and return the same instance.- Parameters:
includeUsage- If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.- Returns:
- The same instance of this
ChatCompletionStreamOptionsclass
-
isIncludeUsage
If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.- Returns:
- includeUsage The includeUsage of this
ChatCompletionStreamOptionsinstance.
-
setIncludeUsage
Set the includeUsage of thisChatCompletionStreamOptionsinstance.- Parameters:
includeUsage- If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.
-
getCustomFieldNames
Get the names of the unrecognizable properties of theChatCompletionStreamOptions.- Returns:
- The set of properties names
-
getCustomField
@Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException Deprecated.UsetoMap()instead.Get the value of an unrecognizable property of thisChatCompletionStreamOptionsinstance.- Parameters:
name- The name of the property- Returns:
- The value of the property
- Throws:
NoSuchElementException- If no property with the given name could be found.
-
toMap
Get the value of all properties of thisChatCompletionStreamOptionsinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisChatCompletionStreamOptionsinstance. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
customFieldName- The name of the propertycustomFieldValue- The value of the property
-
equals
-
hashCode
public int hashCode() -
toString
-
toMap()instead.