Package io.modelcontextprotocol.spec
Record Class McpSchema.CreateMessageRequest
java.lang.Object
java.lang.Record
io.modelcontextprotocol.spec.McpSchema.CreateMessageRequest
- All Implemented Interfaces:
McpSchema.Request
- Enclosing class:
- McpSchema
public static record McpSchema.CreateMessageRequest(List<McpSchema.SamplingMessage> messages, McpSchema.ModelPreferences modelPreferences, String systemPrompt, McpSchema.CreateMessageRequest.ContextInclusionStrategy includeContext, Double temperature, int maxTokens, List<String> stopSequences, Map<String,Object> metadata)
extends Record
implements McpSchema.Request
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionCreateMessageRequest(List<McpSchema.SamplingMessage> messages, McpSchema.ModelPreferences modelPreferences, String systemPrompt, McpSchema.CreateMessageRequest.ContextInclusionStrategy includeContext, Double temperature, int maxTokens, List<String> stopSequences, Map<String, Object> metadata) Creates an instance of aCreateMessageRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theincludeContextrecord component.intReturns the value of themaxTokensrecord component.messages()Returns the value of themessagesrecord component.metadata()Returns the value of themetadatarecord component.Returns the value of themodelPreferencesrecord component.Returns the value of thestopSequencesrecord component.Returns the value of thesystemPromptrecord component.Returns the value of thetemperaturerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CreateMessageRequest
public CreateMessageRequest(List<McpSchema.SamplingMessage> messages, McpSchema.ModelPreferences modelPreferences, String systemPrompt, McpSchema.CreateMessageRequest.ContextInclusionStrategy includeContext, Double temperature, int maxTokens, List<String> stopSequences, Map<String, Object> metadata) Creates an instance of aCreateMessageRequestrecord class.- Parameters:
messages- the value for themessagesrecord componentmodelPreferences- the value for themodelPreferencesrecord componentsystemPrompt- the value for thesystemPromptrecord componentincludeContext- the value for theincludeContextrecord componenttemperature- the value for thetemperaturerecord componentmaxTokens- the value for themaxTokensrecord componentstopSequences- the value for thestopSequencesrecord componentmetadata- the value for themetadatarecord component
-
-
Method Details
-
builder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
messages
Returns the value of themessagesrecord component.- Returns:
- the value of the
messagesrecord component
-
modelPreferences
Returns the value of themodelPreferencesrecord component.- Returns:
- the value of the
modelPreferencesrecord component
-
systemPrompt
Returns the value of thesystemPromptrecord component.- Returns:
- the value of the
systemPromptrecord component
-
includeContext
Returns the value of theincludeContextrecord component.- Returns:
- the value of the
includeContextrecord component
-
temperature
Returns the value of thetemperaturerecord component.- Returns:
- the value of the
temperaturerecord component
-
maxTokens
public int maxTokens()Returns the value of themaxTokensrecord component.- Returns:
- the value of the
maxTokensrecord component
-
stopSequences
Returns the value of thestopSequencesrecord component.- Returns:
- the value of the
stopSequencesrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-