Package com.sap.ai.sdk.orchestration.model

# Class ResponseChatMessage

java.lang.Object
com.sap.ai.sdk.orchestration.model.ResponseChatMessage

public class ResponseChatMessage extends Object
ResponseChatMessage

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `ResponseChatMessage.Builder`
  Builder helper class.
  `static enum`
  `ResponseChatMessage.RoleEnum`
  Gets or Sets role

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `ResponseChatMessage()`
  Default constructor for ResponseChatMessage.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ResponseChatMessage`
  `addToolCallsItem(MessageToolCall toolCallsItem)`
  Add one toolCalls instance to this `ResponseChatMessage`.
  `ResponseChatMessage`
  `content(String content)`
  Set the content of this `ResponseChatMessage` instance and return the same instance.
  `static ResponseChatMessage.Builder`
  `create()`
  Create a type-safe, fluent-api builder object to construct a new `ResponseChatMessage` instance with all required arguments.
  `boolean`
  `equals(Object o)`
  `String`
  `getContent()`
  Get content
  `Object`
  `getCustomField(String name)`
  Deprecated.
  Use `toMap()` instead.
  `Set<String>`
  `getCustomFieldNames()`
  Get the names of the unrecognizable properties of the `ResponseChatMessage`.
  `String`
  `getRefusal()`
  Get refusal
  `ResponseChatMessage.RoleEnum`
  `getRole()`
  Get role
  `List<MessageToolCall>`
  `getToolCalls()`
  The tool calls generated by the model, such as function calls.
  `int`
  `hashCode()`
  `ResponseChatMessage`
  `refusal(String refusal)`
  Set the refusal of this `ResponseChatMessage` instance and return the same instance.
  `ResponseChatMessage`
  `role(ResponseChatMessage.RoleEnum role)`
  Set the role of this `ResponseChatMessage` instance and return the same instance.
  `void`
  `setContent(String content)`
  Set the content of this `ResponseChatMessage` instance.
  `void`
  `setCustomField(String customFieldName, Object customFieldValue)`
  Set an unrecognizable property of this `ResponseChatMessage` instance.
  `void`
  `setRefusal(String refusal)`
  Set the refusal of this `ResponseChatMessage` instance.
  `void`
  `setRole(ResponseChatMessage.RoleEnum role)`
  Set the role of this `ResponseChatMessage` instance.
  `void`
  `setToolCalls(List<MessageToolCall> toolCalls)`
  Set the toolCalls of this `ResponseChatMessage` instance.
  `Map<String,Object>`
  `toMap()`
  Get the value of all properties of this `ResponseChatMessage` instance including unrecognized properties.
  `ResponseChatMessage`
  `toolCalls(List<MessageToolCall> toolCalls)`
  Set the toolCalls of this `ResponseChatMessage` 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

  - ### ResponseChatMessage

    protected ResponseChatMessage()
    Default constructor for ResponseChatMessage.

- ## Method Details

  - ### role

    @Nonnull public ResponseChatMessage role(@Nonnull ResponseChatMessage.RoleEnum role)
    Set the role of this `ResponseChatMessage` instance and return the same instance.
    Parameters:
      `role` - The role of this `ResponseChatMessage`
    Returns:
      The same instance of this `ResponseChatMessage` class

  - ### getRole

    @Nonnull public ResponseChatMessage.RoleEnum getRole()
    Get role
    Returns:
      role The role of this `ResponseChatMessage` instance.

  - ### setRole

    public void setRole(@Nonnull ResponseChatMessage.RoleEnum role)
    Set the role of this `ResponseChatMessage` instance.
    Parameters:
      `role` - The role of this `ResponseChatMessage`

  - ### content

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

  - ### getContent

    @Nonnull public String getContent()
    Get content
    Returns:
      content The content of this `ResponseChatMessage` instance.

  - ### setContent

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

  - ### refusal

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

  - ### getRefusal

    @Nonnull public String getRefusal()
    Get refusal
    Returns:
      refusal The refusal of this `ResponseChatMessage` instance.

  - ### setRefusal

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

  - ### toolCalls

    @Nonnull public ResponseChatMessage toolCalls(@Nullable List<MessageToolCall> toolCalls)
    Set the toolCalls of this `ResponseChatMessage` 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 `ResponseChatMessage` class

  - ### addToolCallsItem

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

  - ### getToolCalls

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

  - ### setToolCalls

    public void setToolCalls(@Nullable List<MessageToolCall> toolCalls)
    Set the toolCalls of this `ResponseChatMessage` instance.
    Parameters:
      `toolCalls` - The tool calls generated by the model, such as function calls.

  - ### getCustomFieldNames

    @Nonnull public Set<String> getCustomFieldNames()
    Get the names of the unrecognizable properties of the `ResponseChatMessage`.
    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 `ResponseChatMessage` 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 `ResponseChatMessage` 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 `ResponseChatMessage` 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`

  - ### create

    public static ResponseChatMessage.Builder create()
    Create a type-safe, fluent-api builder object to construct a new `ResponseChatMessage` instance with all required arguments.