Class AssistantMessage

java.lang.Object
com.sap.ai.sdk.orchestration.Message
com.sap.ai.sdk.orchestration.AssistantMessage

public final class AssistantMessage extends Message
Represents a chat message as 'assistant' to the orchestration service.
  • Constructor Details

    • AssistantMessage

      public AssistantMessage(@Nonnull String singleMessage)
      Creates a new assistant message with the given single message.
      Parameters:
      singleMessage - the single message.
  • Method Details

    • withToolCalls

      @Nonnull public AssistantMessage withToolCalls(@Nonnull List<MessageToolCall> toolCalls)
      Returns a new AssistantMessage instance with the provided tool calls added to the existing ones.
      Parameters:
      toolCalls - the list of tool calls to add.
      Returns:
      a new AssistantMessage instance with the combined tool calls.
    • createChatMessage

      @Nonnull public ChatMessage createChatMessage()
    • role

      @Nonnull public String role()
      The role of the assistant.
      Specified by:
      role in class Message
      Returns:
      the role.
    • content

      @Nonnull public MessageContent content()
      The content of the message.
      Specified by:
      content in class Message
      Returns:
      the content.
    • toolCalls

      @Nullable public List<MessageToolCall> toolCalls()
      Tool call if there is any.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Message
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class Message
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Message