Class ChatCompletionResponseMessage
java.lang.Object
com.sap.ai.sdk.foundationmodels.openai.generated.model.ChatCompletionResponseMessage
A chat completion message generated by the model.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddToolCallsItem(ChatCompletionMessageToolCall toolCallsItem) Add one toolCalls instance to thisChatCompletionResponseMessage.Set the content of thisChatCompletionResponseMessageinstance and return the same instance.booleanfunctionCall(ChatCompletionFunctionCall functionCall) Set the functionCall of thisChatCompletionResponseMessageinstance and return the same instance.The contents of the message.getCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theChatCompletionResponseMessage.Get functionCallThe refusal message generated by the model.getRole()Get roleThe tool calls generated by the model, such as function calls.inthashCode()Set the refusal of thisChatCompletionResponseMessageinstance and return the same instance.Set the role of thisChatCompletionResponseMessageinstance and return the same instance.voidsetContent(String content) Set the content of thisChatCompletionResponseMessageinstance.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisChatCompletionResponseMessageinstance.voidsetFunctionCall(ChatCompletionFunctionCall functionCall) Set the functionCall of thisChatCompletionResponseMessageinstance.voidsetRefusal(String refusal) Set the refusal of thisChatCompletionResponseMessageinstance.voidSet the role of thisChatCompletionResponseMessageinstance.voidsetToolCalls(List<ChatCompletionMessageToolCall> toolCalls) Set the toolCalls of thisChatCompletionResponseMessageinstance.toMap()Get the value of all properties of thisChatCompletionResponseMessageinstance including unrecognized properties.toolCalls(List<ChatCompletionMessageToolCall> toolCalls) Set the toolCalls of thisChatCompletionResponseMessageinstance and return the same instance.toString()
-
Constructor Details
-
ChatCompletionResponseMessage
public ChatCompletionResponseMessage()
-
-
Method Details
-
role
Set the role of thisChatCompletionResponseMessageinstance and return the same instance.- Parameters:
role- The role of thisChatCompletionResponseMessage- Returns:
- The same instance of this
ChatCompletionResponseMessageclass
-
getRole
Get role- Returns:
- role The role of this
ChatCompletionResponseMessageinstance.
-
setRole
Set the role of thisChatCompletionResponseMessageinstance.- Parameters:
role- The role of thisChatCompletionResponseMessage
-
refusal
Set the refusal of thisChatCompletionResponseMessageinstance and return the same instance.- Parameters:
refusal- The refusal message generated by the model.- Returns:
- The same instance of this
ChatCompletionResponseMessageclass
-
getRefusal
The refusal message generated by the model.- Returns:
- refusal The refusal of this
ChatCompletionResponseMessageinstance.
-
setRefusal
Set the refusal of thisChatCompletionResponseMessageinstance.- Parameters:
refusal- The refusal message generated by the model.
-
content
Set the content of thisChatCompletionResponseMessageinstance and return the same instance.- Parameters:
content- The contents of the message.- Returns:
- The same instance of this
ChatCompletionResponseMessageclass
-
getContent
The contents of the message.- Returns:
- content The content of this
ChatCompletionResponseMessageinstance.
-
setContent
Set the content of thisChatCompletionResponseMessageinstance.- Parameters:
content- The contents of the message.
-
toolCalls
@Nonnull public ChatCompletionResponseMessage toolCalls(@Nullable List<ChatCompletionMessageToolCall> toolCalls) Set the toolCalls of thisChatCompletionResponseMessageinstance and return the same instance.- Parameters:
toolCalls- The tool calls generated by the model, such as function calls.- Returns:
- The same instance of this
ChatCompletionResponseMessageclass
-
addToolCallsItem
@Nonnull public ChatCompletionResponseMessage addToolCallsItem(@Nonnull ChatCompletionMessageToolCall toolCallsItem) Add one toolCalls instance to thisChatCompletionResponseMessage.- Parameters:
toolCallsItem- The toolCalls that should be added- Returns:
- The same instance of type
ChatCompletionResponseMessage
-
getToolCalls
The tool calls generated by the model, such as function calls.- Returns:
- toolCalls The toolCalls of this
ChatCompletionResponseMessageinstance.
-
setToolCalls
Set the toolCalls of thisChatCompletionResponseMessageinstance.- Parameters:
toolCalls- The tool calls generated by the model, such as function calls.
-
functionCall
@Nonnull public ChatCompletionResponseMessage functionCall(@Nullable ChatCompletionFunctionCall functionCall) Set the functionCall of thisChatCompletionResponseMessageinstance and return the same instance.- Parameters:
functionCall- The functionCall of thisChatCompletionResponseMessage- Returns:
- The same instance of this
ChatCompletionResponseMessageclass
-
getFunctionCall
Get functionCall- Returns:
- functionCall The functionCall of this
ChatCompletionResponseMessageinstance.
-
setFunctionCall
Set the functionCall of thisChatCompletionResponseMessageinstance.- Parameters:
functionCall- The functionCall of thisChatCompletionResponseMessage
-
getCustomFieldNames
Get the names of the unrecognizable properties of theChatCompletionResponseMessage.- 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 thisChatCompletionResponseMessageinstance.- 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 thisChatCompletionResponseMessageinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisChatCompletionResponseMessageinstance. 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.