Class CreateMessageRequest

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

Parameters for "sampling/createMessage", a server-to-client duplex request (MCP sampling). Never dispatched through McpRevision — this is a plain POJO decoded/encoded by hand (or via the client's typed duplex flow) inside an McpServerRequestHandler implementation.
  • Constructor Details

  • Method Details

    • getMessages

      The conversation history to sample from.
      Returns:
      The messages list, or null if not set.
    • setMessages

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

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

      Appends to the messages.
      Parameters:
      value - The values to append.
      Returns:
      This object (for method chaining).
    • addMessages

      Appends to the messages.
      Parameters:
      value - The values to append.
      Returns:
      This object (for method chaining).
    • getModelPreferences

      Model-selection preferences.
      Returns:
      The preferences, or null if not set.
    • setModelPreferences

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

      An optional system prompt.
      Returns:
      The system prompt, or null if not set.
    • setSystemPrompt

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

      Which MCP context to include (none/thisServer/allServers per the pinned schema). Kept as a plain String, matching this module's existing precedent of not over-modeling schema string-enums that do not gate real branching logic in this codebase.
      Returns:
      The include-context value, or null if not set.
    • setIncludeContext

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

      Sampling temperature.
      Returns:
      The temperature, or null if not set.
    • setTemperature

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

      Maximum tokens to sample.
      Returns:
      The max tokens, or null if not set.
    • setMaxTokens

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

      Sequences that stop sampling when generated.
      Returns:
      The stop sequences, or null if not set.
    • setStopSequences

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

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

      Appends to the stop sequences.
      Parameters:
      value - The values to append.
      Returns:
      This object (for method chaining).
    • addStopSequences

      Appends to the stop sequences.
      Parameters:
      value - The values to append.
      Returns:
      This object (for method chaining).
    • getMetadata

      Free-form server-defined metadata.
      Returns:
      The metadata map, or null if not set.
    • setMetadata

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

      Convenience method to add a single metadata entry.
      Parameters:
      name - The entry name. Can be null (LinkedHashMap tolerates a null key).
      value - The entry value. Can be null (stored as null).
      Returns:
      This object (for method chaining).