Class SystemMessage

java.lang.Object
com.sap.ai.sdk.orchestration.SystemMessage
All Implemented Interfaces:
Message

public final class SystemMessage extends Object implements Message
Represents a chat message as 'system' to the orchestration service.
  • Constructor Details

    • SystemMessage

      public SystemMessage(@Nonnull String message)
      Creates a new system message from a string.
      Parameters:
      message - the first message.
  • Method Details

    • withText

      @Nonnull public SystemMessage withText(@Nonnull String message)
      Add text to the message.
      Parameters:
      message - the text to add.
      Returns:
      the new message.
      Since:
      1.3.0
    • 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.
    • 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
    • content

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