Package io.modelcontextprotocol.spec
Record Class McpSchema.ImageContent
java.lang.Object
java.lang.Record
io.modelcontextprotocol.spec.McpSchema.ImageContent
- Record Components:
annotations- Optional annotations for the clientdata- The base64-encoded image datamimeType- The MIME type of the image. Different providers may support different image typesmeta- See specification for notes on _meta usage
- All Implemented Interfaces:
McpSchema.Annotated,McpSchema.Content
- Enclosing class:
- McpSchema
public static record McpSchema.ImageContent(McpSchema.Annotations annotations, String data, String mimeType, Map<String,Object> meta)
extends Record
implements McpSchema.Annotated, McpSchema.Content
An image provided to or from an LLM.
-
Constructor Summary
ConstructorsConstructorDescriptionImageContent(McpSchema.Annotations annotations, String data, String mimeType) ImageContent(McpSchema.Annotations annotations, String data, String mimeType, Map<String, Object> meta) Creates an instance of aImageContentrecord class.ImageContent(List<McpSchema.Role> audience, Double priority, String data, String mimeType) Deprecated.Only exists for backwards-compatibility purposes. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theannotationsrecord component.audience()Deprecated.Only exists for backwards-compatibility purposes.data()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.meta()Returns the value of themetarecord component.mimeType()Returns the value of themimeTyperecord component.priority()Deprecated.Only exists for backwards-compatibility purposes.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.modelcontextprotocol.spec.McpSchema.Content
type
-
Constructor Details
-
ImageContent
-
ImageContent
@Deprecated public ImageContent(List<McpSchema.Role> audience, Double priority, String data, String mimeType) Deprecated.Only exists for backwards-compatibility purposes. UseImageContent(Annotations, String, String)instead. -
ImageContent
public ImageContent(McpSchema.Annotations annotations, String data, String mimeType, Map<String, Object> meta) Creates an instance of aImageContentrecord class.- Parameters:
annotations- the value for theannotationsrecord componentdata- the value for thedatarecord componentmimeType- the value for themimeTyperecord componentmeta- the value for themetarecord component
-
-
Method Details
-
audience
Deprecated.Only exists for backwards-compatibility purposes. Useannotations()instead. -
priority
Deprecated.Only exists for backwards-compatibility purposes. Useannotations()instead. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
annotations
Returns the value of theannotationsrecord component.- Specified by:
annotationsin interfaceMcpSchema.Annotated- Returns:
- the value of the
annotationsrecord component
-
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
mimeType
Returns the value of themimeTyperecord component.- Returns:
- the value of the
mimeTyperecord component
-
meta
Returns the value of themetarecord component.- Specified by:
metain interfaceMcpSchema.Content- Returns:
- the value of the
metarecord component
-