Package com.sap.ai.sdk.foundationmodels.openai.generated.model

# 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 Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `ChatCompletionRequestAssistantMessage.RoleEnum`
  The role of the messages author, in this case `assistant`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ChatCompletionRequestAssistantMessage()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ChatCompletionRequestAssistantMessage`
  `addToolCallsItem(ChatCompletionMessageToolCall toolCallsItem)`
  Add one toolCalls instance to this `ChatCompletionRequestAssistantMessage`.
  `ChatCompletionRequestAssistantMessage`
  `content(ChatCompletionRequestAssistantMessageContent content)`
  Set the content of this `ChatCompletionRequestAssistantMessage` instance and return the same instance.
  `boolean`
  `equals(Object o)`
  `ChatCompletionRequestAssistantMessage`
  `functionCall(ChatCompletionRequestAssistantMessageFunctionCall functionCall)`
  Set the functionCall of this `ChatCompletionRequestAssistantMessage` instance and return the same instance.
  `ChatCompletionRequestAssistantMessageContent`
  `getContent()`
  Get content
  `Object`
  `getCustomField(String name)`
  Deprecated.
  Use `toMap()` instead.
  `Set<String>`
  `getCustomFieldNames()`
  Get the names of the unrecognizable properties of the `ChatCompletionRequestAssistantMessage`.
  `ChatCompletionRequestAssistantMessageFunctionCall`
  `getFunctionCall()`
  Deprecated.
  `String`
  `getName()`
  An optional name for the participant.
  `String`
  `getRefusal()`
  The refusal message by the assistant.
  `ChatCompletionRequestAssistantMessage.RoleEnum`
  `getRole()`
  The role of the messages author, in this case `assistant`.
  `List<ChatCompletionMessageToolCall>`
  `getToolCalls()`
  The tool calls generated by the model, such as function calls.
  `int`
  `hashCode()`
  `ChatCompletionRequestAssistantMessage`
  `name(String name)`
  Set the name of this `ChatCompletionRequestAssistantMessage` instance and return the same instance.
  `ChatCompletionRequestAssistantMessage`
  `refusal(String refusal)`
  Set the refusal of this `ChatCompletionRequestAssistantMessage` instance and return the same instance.
  `ChatCompletionRequestAssistantMessage`
  `role(ChatCompletionRequestAssistantMessage.RoleEnum role)`
  Set the role of this `ChatCompletionRequestAssistantMessage` instance and return the same instance.
  `void`
  `setContent(ChatCompletionRequestAssistantMessageContent content)`
  Set the content of this `ChatCompletionRequestAssistantMessage` instance.
  `void`
  `setCustomField(String customFieldName, Object customFieldValue)`
  Set an unrecognizable property of this `ChatCompletionRequestAssistantMessage` instance.
  `void`
  `setFunctionCall(ChatCompletionRequestAssistantMessageFunctionCall functionCall)`
  Set the functionCall of this `ChatCompletionRequestAssistantMessage` instance.
  `void`
  `setName(String name)`
  Set the name of this `ChatCompletionRequestAssistantMessage` instance.
  `void`
  `setRefusal(String refusal)`
  Set the refusal of this `ChatCompletionRequestAssistantMessage` instance.
  `void`
  `setRole(ChatCompletionRequestAssistantMessage.RoleEnum role)`
  Set the role of this `ChatCompletionRequestAssistantMessage` instance.
  `void`
  `setToolCalls(List<ChatCompletionMessageToolCall> toolCalls)`
  Set the toolCalls of this `ChatCompletionRequestAssistantMessage` instance.
  `Map<String,Object>`
  `toMap()`
  Get the value of all properties of this `ChatCompletionRequestAssistantMessage` instance including unrecognized properties.
  `ChatCompletionRequestAssistantMessage`
  `toolCalls(List<ChatCompletionMessageToolCall> toolCalls)`
  Set the toolCalls of this `ChatCompletionRequestAssistantMessage` instance and return the same instance.
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ChatCompletionRequestAssistantMessage

    public ChatCompletionRequestAssistantMessage()

- ## Method Details

  - ### content

    @Nonnull public ChatCompletionRequestAssistantMessage content(@Nullable ChatCompletionRequestAssistantMessageContent content)
    Set the content of this `ChatCompletionRequestAssistantMessage` instance and return the same instance.
    Parameters:
      `content` - The content of this `ChatCompletionRequestAssistantMessage`
    Returns:
      The same instance of this `ChatCompletionRequestAssistantMessage` class

  - ### getContent

    @Nullable public ChatCompletionRequestAssistantMessageContent getContent()
    Get content
    Returns:
      content The content of this `ChatCompletionRequestAssistantMessage` instance.

  - ### setContent

    public void setContent(@Nullable ChatCompletionRequestAssistantMessageContent content)
    Set the content of this `ChatCompletionRequestAssistantMessage` instance.
    Parameters:
      `content` - The content of this `ChatCompletionRequestAssistantMessage`

  - ### refusal

    @Nonnull public ChatCompletionRequestAssistantMessage refusal(@Nullable String refusal)
    Set the refusal of this `ChatCompletionRequestAssistantMessage` instance and return the same instance.
    Parameters:
      `refusal` - The refusal message by the assistant.
    Returns:
      The same instance of this `ChatCompletionRequestAssistantMessage` class

  - ### getRefusal

    @Nullable public String getRefusal()
    The refusal message by the assistant.
    Returns:
      refusal The refusal of this `ChatCompletionRequestAssistantMessage` instance.

  - ### setRefusal

    public void setRefusal(@Nullable String refusal)
    Set the refusal of this `ChatCompletionRequestAssistantMessage` instance.
    Parameters:
      `refusal` - The refusal message by the assistant.

  - ### role

    @Nonnull public ChatCompletionRequestAssistantMessage role(@Nonnull ChatCompletionRequestAssistantMessage.RoleEnum role)
    Set the role of this `ChatCompletionRequestAssistantMessage` instance and return the same instance.
    Parameters:
      `role` - The role of the messages author, in this case `assistant`.
    Returns:
      The same instance of this `ChatCompletionRequestAssistantMessage` class

  - ### getRole

    @Nonnull public ChatCompletionRequestAssistantMessage.RoleEnum getRole()
    The role of the messages author, in this case `assistant`.
    Returns:
      role The role of this `ChatCompletionRequestAssistantMessage` instance.

  - ### setRole

    public void setRole(@Nonnull ChatCompletionRequestAssistantMessage.RoleEnum role)
    Set the role of this `ChatCompletionRequestAssistantMessage` instance.
    Parameters:
      `role` - The role of the messages author, in this case `assistant`.

  - ### name

    @Nonnull public ChatCompletionRequestAssistantMessage name(@Nullable String name)
    Set the name of this `ChatCompletionRequestAssistantMessage` instance 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 `ChatCompletionRequestAssistantMessage` class

  - ### getName

    @Nonnull public String 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 `ChatCompletionRequestAssistantMessage` instance.

  - ### setName

    public void setName(@Nullable String name)
    Set the name of this `ChatCompletionRequestAssistantMessage` instance.
    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 this `ChatCompletionRequestAssistantMessage` instance and return the same instance.
    Parameters:
      `toolCalls` - The tool calls generated by the model, such as function calls.
    Returns:
      The same instance of this `ChatCompletionRequestAssistantMessage` class

  - ### addToolCallsItem

    @Nonnull public ChatCompletionRequestAssistantMessage addToolCallsItem(@Nonnull ChatCompletionMessageToolCall toolCallsItem)
    Add one toolCalls instance to this `ChatCompletionRequestAssistantMessage`.
    Parameters:
      `toolCallsItem` - The toolCalls that should be added
    Returns:
      The same instance of type `ChatCompletionRequestAssistantMessage`

  - ### getToolCalls

    @Nonnull public List<ChatCompletionMessageToolCall> getToolCalls()
    The tool calls generated by the model, such as function calls.
    Returns:
      toolCalls The toolCalls of this `ChatCompletionRequestAssistantMessage` instance.

  - ### setToolCalls

    public void setToolCalls(@Nullable List<ChatCompletionMessageToolCall> toolCalls)
    Set the toolCalls of this `ChatCompletionRequestAssistantMessage` instance.
    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 this `ChatCompletionRequestAssistantMessage` instance and return the same instance.
    Parameters:
      `functionCall` - The functionCall of this `ChatCompletionRequestAssistantMessage`
    Returns:
      The same instance of this `ChatCompletionRequestAssistantMessage` class

  - ### getFunctionCall

    @Deprecated @Nullable public ChatCompletionRequestAssistantMessageFunctionCall getFunctionCall()
    Deprecated.
    Get functionCall
    Returns:
      functionCall The functionCall of this `ChatCompletionRequestAssistantMessage` instance.

  - ### setFunctionCall

    public void setFunctionCall(@Nullable ChatCompletionRequestAssistantMessageFunctionCall functionCall)
    Set the functionCall of this `ChatCompletionRequestAssistantMessage` instance.
    Parameters:
      `functionCall` - The functionCall of this `ChatCompletionRequestAssistantMessage`

  - ### getCustomFieldNames

    @Nonnull public Set<String> getCustomFieldNames()
    Get the names of the unrecognizable properties of the `ChatCompletionRequestAssistantMessage`.
    Returns:
      The set of properties names

  - ### getCustomField

    @Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException
    Deprecated.
    Use `toMap()` instead.
    Get the value of an unrecognizable property of this `ChatCompletionRequestAssistantMessage` instance.
    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

    @Nonnull public Map<String,Object> toMap()
    Get the value of all properties of this `ChatCompletionRequestAssistantMessage` instance including unrecognized properties.
    Returns:
      The map of all properties

  - ### setCustomField

    public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue)
    Set an unrecognizable property of this `ChatCompletionRequestAssistantMessage` instance. 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 property
      `customFieldValue` - The value of the property

  - ### equals

    public boolean equals(@Nullable Object o)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### toString

    @Nonnull public String toString()
    Overrides:
      `toString` in class `Object`