Package com.sap.ai.sdk.orchestration

# Class ToolMessage

java.lang.Object
com.sap.ai.sdk.orchestration.ToolMessage

All Implemented Interfaces:
  `Message`

public final class ToolMessage extends Object implements Message
Represents a chat message as 'tool' to the orchestration service.

Since:
  1.4.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ToolMessage(String id, String content)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `MessageContent`
  `content()`
  Returns the content of the message.
  `ChatMessage`
  `createChatMessage()`
  Converts the message to a serializable ChatMessage object.
  `boolean`
  `equals(Object o)`
  `int`
  `hashCode()`
  `String`
  `id()`
  `String`
  `role()`
  The role of the assistant.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### ToolMessage

    public ToolMessage(@Nonnull String id, @Nonnull String content)

- ## Method Details

  - ### content

    @Nonnull public MessageContent content()
    Description copied from interface: `Message`
    Returns the content of the message.
    Specified by:
      `content` in interface `Message`
    Returns:
      the content.

  - ### createChatMessage

    @Nonnull public ChatMessage createChatMessage()
    Description copied from interface: `Message`
    Converts the message to a serializable ChatMessage object.
    Specified by:
      `createChatMessage` in interface `Message`
    Returns:
      the corresponding `ChatMessage` object.

  - ### role

    @Nonnull public String role()
    The role of the assistant.
    Specified by:
      `role` in interface `Message`
    Returns:
      the role.

  - ### id

    @Nonnull public String id()

  - ### equals

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

  - ### hashCode

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

  - ### toString

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