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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMessages(Collection<SamplingMessage> value) Appends to the messages.addMessages(SamplingMessage... value) Appends to the messages.addStopSequences(String... value) Appends to the stop sequences.addStopSequences(Collection<String> value) Appends to the stop sequences.Which MCP context to include (none/thisServer/allServersper the pinned schema).Maximum tokens to sample.The conversation history to sample from.Free-form server-defined metadata.Model-selection preferences.Sequences that stop sampling when generated.An optional system prompt.Sampling temperature.putMetadata(String name, Object value) Convenience method to add a single metadata entry.setIncludeContext(String value) Sets the include-context value.setMaxTokens(Integer value) Sets the max tokens.setMessages(List<SamplingMessage> value) Sets the messages.setMessages(SamplingMessage... value) Sets the messages.setMetadata(Map<String, Object> value) Sets the metadata.Sets the model preferences.setStopSequences(String... value) Sets the stop sequences.setStopSequences(List<String> value) Sets the stop sequences.setSystemPrompt(String value) Sets the system prompt.setTemperature(Double value) Sets the temperature.
-
Constructor Details
-
CreateMessageRequest
public CreateMessageRequest()
-
-
Method Details
-
getMessages
The conversation history to sample from.- Returns:
- The messages list, or
nullif not set.
-
setMessages
Sets the messages.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
setMessages
Sets the messages.- Parameters:
value- The new value. Can benull 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
nullif not set.
-
setModelPreferences
Sets the model preferences.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getSystemPrompt
An optional system prompt.- Returns:
- The system prompt, or
nullif not set.
-
setSystemPrompt
Sets the system prompt.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getIncludeContext
Which MCP context to include (none/thisServer/allServersper the pinned schema). Kept as a plainString, 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
nullif not set.
-
setIncludeContext
Sets the include-context value.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getTemperature
Sampling temperature.- Returns:
- The temperature, or
nullif not set.
-
setTemperature
Sets the temperature.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getMaxTokens
Maximum tokens to sample.- Returns:
- The max tokens, or
nullif not set.
-
setMaxTokens
Sets the max tokens.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getStopSequences
Sequences that stop sampling when generated.- Returns:
- The stop sequences, or
nullif not set.
-
setStopSequences
Sets the stop sequences.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
setStopSequences
Sets the stop sequences.- Parameters:
value- The new value. Can benull 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
nullif not set.
-
setMetadata
Sets the metadata.- Parameters:
value- The new value. Can benull 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 benull (LinkedHashMaptolerates anull key).value- The entry value. Can benull (stored asnull ).- Returns:
- This object (for method chaining).
-