Package com.sap.ai.sdk.prompt.registry.model

# Class ToolChatMessage

java.lang.Object
com.sap.ai.sdk.prompt.registry.model.ToolChatMessage

All Implemented Interfaces:
  `ChatMessage`

public class ToolChatMessage extends Object implements ChatMessage
ToolChatMessage

- ## Nested Class Summary

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

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ToolChatMessage`
  `content(ChatMessageContent content)`
  Set the content of this `ToolChatMessage` instance and return the same instance.
  `static ToolChatMessage.Builder`
  `create()`
  Create a type-safe, fluent-api builder object to construct a new `ToolChatMessage` instance with all required arguments.
  `boolean`
  `equals(Object o)`
  `ChatMessageContent`
  `getContent()`
  Get content
  `Object`
  `getCustomField(String name)`
  Deprecated.
  Use `toMap()` instead.
  `Set<String>`
  `getCustomFieldNames()`
  Get the names of the unrecognizable properties of the `ToolChatMessage`.
  `ToolChatMessage.RoleEnum`
  `getRole()`
  Get role
  `String`
  `getToolCallId()`
  Get toolCallId
  `int`
  `hashCode()`
  `ToolChatMessage`
  `role(ToolChatMessage.RoleEnum role)`
  Set the role of this `ToolChatMessage` instance and return the same instance.
  `void`
  `setContent(ChatMessageContent content)`
  Set the content of this `ToolChatMessage` instance.
  `void`
  `setCustomField(String customFieldName, Object customFieldValue)`
  Set an unrecognizable property of this `ToolChatMessage` instance.
  `void`
  `setRole(ToolChatMessage.RoleEnum role)`
  Set the role of this `ToolChatMessage` instance.
  `void`
  `setToolCallId(String toolCallId)`
  Set the toolCallId of this `ToolChatMessage` instance.
  `Map<String,Object>`
  `toMap()`
  Get the value of all properties of this `ToolChatMessage` instance including unrecognized properties.
  `ToolChatMessage`
  `toolCallId(String toolCallId)`
  Set the toolCallId of this `ToolChatMessage` 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

  - ### ToolChatMessage

    protected ToolChatMessage()
    Default constructor for ToolChatMessage.

- ## Method Details

  - ### role

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

  - ### getRole

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

  - ### setRole

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

  - ### toolCallId

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

  - ### getToolCallId

    @Nonnull public String getToolCallId()
    Get toolCallId
    Returns:
      toolCallId The toolCallId of this `ToolChatMessage` instance.

  - ### setToolCallId

    public void setToolCallId(@Nonnull String toolCallId)
    Set the toolCallId of this `ToolChatMessage` instance.
    Parameters:
      `toolCallId` - The toolCallId of this `ToolChatMessage`

  - ### content

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

  - ### getContent

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

  - ### setContent

    public void setContent(@Nonnull ChatMessageContent content)
    Set the content of this `ToolChatMessage` instance.
    Parameters:
      `content` - The content of this `ToolChatMessage`

  - ### getCustomFieldNames

    @Nonnull public Set<String> getCustomFieldNames()
    Get the names of the unrecognizable properties of the `ToolChatMessage`.
    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 `ToolChatMessage` 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 `ToolChatMessage` 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 `ToolChatMessage` 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 ToolChatMessage.Builder create()
    Create a type-safe, fluent-api builder object to construct a new `ToolChatMessage` instance with all required arguments.