Class ChatCompletionRequestAssistantMessage
java.lang.Object
com.sap.ai.sdk.foundationmodels.openai.generated.model.ChatCompletionRequestAssistantMessage
- All Implemented Interfaces:
ChatCompletionRequestMessage
public class ChatCompletionRequestAssistantMessage
extends Object
implements ChatCompletionRequestMessage
ChatCompletionRequestAssistantMessage
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe role of the messages author, in this case `assistant`. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddToolCallsItem(ChatCompletionMessageToolCall toolCallsItem) Add one toolCalls instance to thisChatCompletionRequestAssistantMessage.Set the content of thisChatCompletionRequestAssistantMessageinstance and return the same instance.booleanSet the functionCall of thisChatCompletionRequestAssistantMessageinstance and return the same instance.Get contentgetCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theChatCompletionRequestAssistantMessage.Deprecated.getName()An optional name for the participant.The refusal message by the assistant.getRole()The role of the messages author, in this case `assistant`.The tool calls generated by the model, such as function calls.inthashCode()Set the name of thisChatCompletionRequestAssistantMessageinstance and return the same instance.Set the refusal of thisChatCompletionRequestAssistantMessageinstance and return the same instance.Set the role of thisChatCompletionRequestAssistantMessageinstance and return the same instance.voidSet the content of thisChatCompletionRequestAssistantMessageinstance.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisChatCompletionRequestAssistantMessageinstance.voidSet the functionCall of thisChatCompletionRequestAssistantMessageinstance.voidSet the name of thisChatCompletionRequestAssistantMessageinstance.voidsetRefusal(String refusal) Set the refusal of thisChatCompletionRequestAssistantMessageinstance.voidSet the role of thisChatCompletionRequestAssistantMessageinstance.voidsetToolCalls(List<ChatCompletionMessageToolCall> toolCalls) Set the toolCalls of thisChatCompletionRequestAssistantMessageinstance.toMap()Get the value of all properties of thisChatCompletionRequestAssistantMessageinstance including unrecognized properties.toolCalls(List<ChatCompletionMessageToolCall> toolCalls) Set the toolCalls of thisChatCompletionRequestAssistantMessageinstance and return the same instance.toString()
-
Constructor Details
-
ChatCompletionRequestAssistantMessage
public ChatCompletionRequestAssistantMessage()
-
-
Method Details
-
content
@Nonnull public ChatCompletionRequestAssistantMessage content(@Nullable ChatCompletionRequestAssistantMessageContent content) Set the content of thisChatCompletionRequestAssistantMessageinstance and return the same instance.- Parameters:
content- The content of thisChatCompletionRequestAssistantMessage- Returns:
- The same instance of this
ChatCompletionRequestAssistantMessageclass
-
getContent
Get content- Returns:
- content The content of this
ChatCompletionRequestAssistantMessageinstance.
-
setContent
Set the content of thisChatCompletionRequestAssistantMessageinstance.- Parameters:
content- The content of thisChatCompletionRequestAssistantMessage
-
refusal
Set the refusal of thisChatCompletionRequestAssistantMessageinstance and return the same instance.- Parameters:
refusal- The refusal message by the assistant.- Returns:
- The same instance of this
ChatCompletionRequestAssistantMessageclass
-
getRefusal
The refusal message by the assistant.- Returns:
- refusal The refusal of this
ChatCompletionRequestAssistantMessageinstance.
-
setRefusal
Set the refusal of thisChatCompletionRequestAssistantMessageinstance.- Parameters:
refusal- The refusal message by the assistant.
-
role
@Nonnull public ChatCompletionRequestAssistantMessage role(@Nonnull ChatCompletionRequestAssistantMessage.RoleEnum role) Set the role of thisChatCompletionRequestAssistantMessageinstance and return the same instance.- Parameters:
role- The role of the messages author, in this case `assistant`.- Returns:
- The same instance of this
ChatCompletionRequestAssistantMessageclass
-
getRole
The role of the messages author, in this case `assistant`.- Returns:
- role The role of this
ChatCompletionRequestAssistantMessageinstance.
-
setRole
Set the role of thisChatCompletionRequestAssistantMessageinstance.- Parameters:
role- The role of the messages author, in this case `assistant`.
-
name
Set the name of thisChatCompletionRequestAssistantMessageinstance and return the same instance.- Parameters:
name- An optional name for the participant. Provides the model information to differentiate between participants of the same role.- Returns:
- The same instance of this
ChatCompletionRequestAssistantMessageclass
-
getName
An optional name for the participant. Provides the model information to differentiate between participants of the same role.- Returns:
- name The name of this
ChatCompletionRequestAssistantMessageinstance.
-
setName
Set the name of thisChatCompletionRequestAssistantMessageinstance.- Parameters:
name- An optional name for the participant. Provides the model information to differentiate between participants of the same role.
-
toolCalls
@Nonnull public ChatCompletionRequestAssistantMessage toolCalls(@Nullable List<ChatCompletionMessageToolCall> toolCalls) Set the toolCalls of thisChatCompletionRequestAssistantMessageinstance and return the same instance.- Parameters:
toolCalls- The tool calls generated by the model, such as function calls.- Returns:
- The same instance of this
ChatCompletionRequestAssistantMessageclass
-
addToolCallsItem
@Nonnull public ChatCompletionRequestAssistantMessage addToolCallsItem(@Nonnull ChatCompletionMessageToolCall toolCallsItem) Add one toolCalls instance to thisChatCompletionRequestAssistantMessage.- Parameters:
toolCallsItem- The toolCalls that should be added- Returns:
- The same instance of type
ChatCompletionRequestAssistantMessage
-
getToolCalls
The tool calls generated by the model, such as function calls.- Returns:
- toolCalls The toolCalls of this
ChatCompletionRequestAssistantMessageinstance.
-
setToolCalls
Set the toolCalls of thisChatCompletionRequestAssistantMessageinstance.- Parameters:
toolCalls- The tool calls generated by the model, such as function calls.
-
functionCall
@Nonnull public ChatCompletionRequestAssistantMessage functionCall(@Nullable ChatCompletionRequestAssistantMessageFunctionCall functionCall) Set the functionCall of thisChatCompletionRequestAssistantMessageinstance and return the same instance.- Parameters:
functionCall- The functionCall of thisChatCompletionRequestAssistantMessage- Returns:
- The same instance of this
ChatCompletionRequestAssistantMessageclass
-
getFunctionCall
Deprecated.Get functionCall- Returns:
- functionCall The functionCall of this
ChatCompletionRequestAssistantMessageinstance.
-
setFunctionCall
public void setFunctionCall(@Nullable ChatCompletionRequestAssistantMessageFunctionCall functionCall) Set the functionCall of thisChatCompletionRequestAssistantMessageinstance.- Parameters:
functionCall- The functionCall of thisChatCompletionRequestAssistantMessage
-
getCustomFieldNames
Get the names of the unrecognizable properties of theChatCompletionRequestAssistantMessage.- 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 thisChatCompletionRequestAssistantMessageinstance.- 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 thisChatCompletionRequestAssistantMessageinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisChatCompletionRequestAssistantMessageinstance. 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.