Class ChatCompletionStreamResponseDelta
java.lang.Object
com.sap.ai.sdk.foundationmodels.openai.generated.model.ChatCompletionStreamResponseDelta
A chat completion delta generated by streamed model responses.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe role of the author of this message. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddToolCallsItem(ChatCompletionMessageToolCallChunk toolCallsItem) Add one toolCalls instance to thisChatCompletionStreamResponseDelta.Set the content of thisChatCompletionStreamResponseDeltainstance and return the same instance.booleanfunctionCall(ChatCompletionStreamResponseDeltaFunctionCall functionCall) Set the functionCall of thisChatCompletionStreamResponseDeltainstance and return the same instance.The contents of the chunk message.getCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theChatCompletionStreamResponseDelta.Deprecated.The refusal message generated by the model.getRole()The role of the author of this message.Get toolCallsinthashCode()Set the refusal of thisChatCompletionStreamResponseDeltainstance and return the same instance.Set the role of thisChatCompletionStreamResponseDeltainstance and return the same instance.voidsetContent(String content) Set the content of thisChatCompletionStreamResponseDeltainstance.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisChatCompletionStreamResponseDeltainstance.voidsetFunctionCall(ChatCompletionStreamResponseDeltaFunctionCall functionCall) Set the functionCall of thisChatCompletionStreamResponseDeltainstance.voidsetRefusal(String refusal) Set the refusal of thisChatCompletionStreamResponseDeltainstance.voidSet the role of thisChatCompletionStreamResponseDeltainstance.voidsetToolCalls(List<ChatCompletionMessageToolCallChunk> toolCalls) Set the toolCalls of thisChatCompletionStreamResponseDeltainstance.toMap()Get the value of all properties of thisChatCompletionStreamResponseDeltainstance including unrecognized properties.toolCalls(List<ChatCompletionMessageToolCallChunk> toolCalls) Set the toolCalls of thisChatCompletionStreamResponseDeltainstance and return the same instance.toString()
-
Constructor Details
-
ChatCompletionStreamResponseDelta
public ChatCompletionStreamResponseDelta()
-
-
Method Details
-
content
Set the content of thisChatCompletionStreamResponseDeltainstance and return the same instance.- Parameters:
content- The contents of the chunk message.- Returns:
- The same instance of this
ChatCompletionStreamResponseDeltaclass
-
getContent
The contents of the chunk message.- Returns:
- content The content of this
ChatCompletionStreamResponseDeltainstance.
-
setContent
Set the content of thisChatCompletionStreamResponseDeltainstance.- Parameters:
content- The contents of the chunk message.
-
functionCall
@Nonnull public ChatCompletionStreamResponseDelta functionCall(@Nullable ChatCompletionStreamResponseDeltaFunctionCall functionCall) Set the functionCall of thisChatCompletionStreamResponseDeltainstance and return the same instance.- Parameters:
functionCall- The functionCall of thisChatCompletionStreamResponseDelta- Returns:
- The same instance of this
ChatCompletionStreamResponseDeltaclass
-
getFunctionCall
Deprecated.Get functionCall- Returns:
- functionCall The functionCall of this
ChatCompletionStreamResponseDeltainstance.
-
setFunctionCall
Set the functionCall of thisChatCompletionStreamResponseDeltainstance.- Parameters:
functionCall- The functionCall of thisChatCompletionStreamResponseDelta
-
toolCalls
@Nonnull public ChatCompletionStreamResponseDelta toolCalls(@Nullable List<ChatCompletionMessageToolCallChunk> toolCalls) Set the toolCalls of thisChatCompletionStreamResponseDeltainstance and return the same instance.- Parameters:
toolCalls- The toolCalls of thisChatCompletionStreamResponseDelta- Returns:
- The same instance of this
ChatCompletionStreamResponseDeltaclass
-
addToolCallsItem
@Nonnull public ChatCompletionStreamResponseDelta addToolCallsItem(@Nonnull ChatCompletionMessageToolCallChunk toolCallsItem) Add one toolCalls instance to thisChatCompletionStreamResponseDelta.- Parameters:
toolCallsItem- The toolCalls that should be added- Returns:
- The same instance of type
ChatCompletionStreamResponseDelta
-
getToolCalls
Get toolCalls- Returns:
- toolCalls The toolCalls of this
ChatCompletionStreamResponseDeltainstance.
-
setToolCalls
Set the toolCalls of thisChatCompletionStreamResponseDeltainstance.- Parameters:
toolCalls- The toolCalls of thisChatCompletionStreamResponseDelta
-
role
@Nonnull public ChatCompletionStreamResponseDelta role(@Nullable ChatCompletionStreamResponseDelta.RoleEnum role) Set the role of thisChatCompletionStreamResponseDeltainstance and return the same instance.- Parameters:
role- The role of the author of this message.- Returns:
- The same instance of this
ChatCompletionStreamResponseDeltaclass
-
getRole
The role of the author of this message.- Returns:
- role The role of this
ChatCompletionStreamResponseDeltainstance.
-
setRole
Set the role of thisChatCompletionStreamResponseDeltainstance.- Parameters:
role- The role of the author of this message.
-
refusal
Set the refusal of thisChatCompletionStreamResponseDeltainstance and return the same instance.- Parameters:
refusal- The refusal message generated by the model.- Returns:
- The same instance of this
ChatCompletionStreamResponseDeltaclass
-
getRefusal
The refusal message generated by the model.- Returns:
- refusal The refusal of this
ChatCompletionStreamResponseDeltainstance.
-
setRefusal
Set the refusal of thisChatCompletionStreamResponseDeltainstance.- Parameters:
refusal- The refusal message generated by the model.
-
getCustomFieldNames
Get the names of the unrecognizable properties of theChatCompletionStreamResponseDelta.- 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 thisChatCompletionStreamResponseDeltainstance.- 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 thisChatCompletionStreamResponseDeltainstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisChatCompletionStreamResponseDeltainstance. 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.