Class SamplingMessage

java.lang.Object
org.apache.juneau.bean.mcp.v20260728.SamplingMessage

@Marshalled public class SamplingMessage extends Object
One message in CreateMessageRequest.getMessages() (MCP sampling).
  • Constructor Details

  • Method Details

    • getRole

      public Role getRole()
      The message role. The real schema restricts sampling roles to user/assistant, a subset this reused Role enum already covers.
      Returns:
      The role, or null if not set.
    • setRole

      public SamplingMessage setRole(Role value)
      Sets the message role.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object (for method chaining).
    • getContent

      public Content getContent()
      The message content — a single block (text/image/audio/resource), not a list, matching the real sampling schema.
      Returns:
      The content, or null if not set.
    • setContent

      Sets the message content.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object (for method chaining).