Record Class ZhiPuAiApi.ChatCompletionMessage.MediaContent
java.lang.Object
java.lang.Record
org.springframework.ai.zhipuai.api.ZhiPuAiApi.ChatCompletionMessage.MediaContent
- Record Components:
type
- Content type, each can be of type text or image_url.text
- The text content of the message.imageUrl
- The image content of the message. You can pass multiple images by adding multiple image_url content parts. Image input is only supported when using the glm-4v model.
- Enclosing class:
- ZhiPuAiApi.ChatCompletionMessage
public static record ZhiPuAiApi.ChatCompletionMessage.MediaContent(String type, String text, ZhiPuAiApi.ChatCompletionMessage.MediaContent.ImageUrl imageUrl)
extends Record
An array of content parts with a defined type.
Each MediaContent can be of either "text" or "image_url" type. Not both.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
The image content of the message. -
Constructor Summary
ConstructorDescriptionMediaContent
(String text) Shortcut constructor for a text content.MediaContent
(String type, String text, ZhiPuAiApi.ChatCompletionMessage.MediaContent.ImageUrl imageUrl) Creates an instance of aMediaContent
record class.Shortcut constructor for an image content. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.imageUrl()
Returns the value of theimageUrl
record component.text()
Returns the value of thetext
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.
-
Constructor Details
-
MediaContent
Shortcut constructor for a text content.- Parameters:
text
- The text content of the message.
-
MediaContent
Shortcut constructor for an image content.- Parameters:
imageUrl
- The image content of the message.
-
MediaContent
public MediaContent(String type, String text, ZhiPuAiApi.ChatCompletionMessage.MediaContent.ImageUrl imageUrl) Creates an instance of aMediaContent
record class.
-
-
Method Details
-
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)
. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
text
Returns the value of thetext
record component.- Returns:
- the value of the
text
record component
-
imageUrl
Returns the value of theimageUrl
record component.- Returns:
- the value of the
imageUrl
record component
-