Class CreateMessageResult

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

Result payload for "sampling/createMessage" (MCP sampling). Never dispatched through McpRevision; see CreateMessageRequest's class Javadoc for the same plain-POJO/duplex-payload rationale.
  • Constructor Details

  • Method Details

    • getRole

      public Role getRole()
      The generated message's role (real schema restricts this to user/assistant).
      Returns:
      The role, or null if not set.
    • setRole

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

      public Content getContent()
      The generated content — a single block (text/image/audio/resource).
      Returns:
      The content, or null if not set.
    • setContent

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

      public String getModel()
      The model that generated the content.
      Returns:
      The model name, or null if not set.
    • setModel

      Sets the model name.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object (for method chaining).
    • getStopReason

      Why sampling stopped (commonly endTurn/stopSequence/maxTokens, but the schema also permits arbitrary server-defined strings, so this stays a plain String).
      Returns:
      The stop reason, or null if not set.
    • setStopReason

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