Record Class DashScopeApiSpec.ChatCompletionMessage.MediaContent
java.lang.Object
java.lang.Record
com.alibaba.cloud.ai.dashscope.spec.DashScopeApiSpec.ChatCompletionMessage.MediaContent
- Record Components:
text- The text content of the message.image- The image content of the message. You can pass multiple imagesvideo- The image list of video. by adding multiple image_url content parts. Image input is only supported when using the glm-4v model.audio- The audio content of the message.
- Enclosing class:
- DashScopeApiSpec.ChatCompletionMessage
public static record DashScopeApiSpec.ChatCompletionMessage.MediaContent(String type, String text, String image, List<String> video, String audio)
extends Record
An array of content parts with a defined type. Each MediaContent can be of
either "text" or "image_url" type. Not both.
-
Constructor Summary
ConstructorsConstructorDescriptionMediaContent(String text) Shortcut constructor for a text content.Creates an instance of aMediaContentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaudio()Returns the value of theaudiorecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.image()Returns the value of theimagerecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.video()Returns the value of thevideorecord component.
-
Constructor Details
-
MediaContent
Shortcut constructor for a text content.- Parameters:
text- The text content of the message.
-
MediaContent
-
MediaContent
Creates an instance of aMediaContentrecord 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 thetyperecord component.- Returns:
- the value of the
typerecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
image
Returns the value of theimagerecord component.- Returns:
- the value of the
imagerecord component
-
video
Returns the value of thevideorecord component.- Returns:
- the value of the
videorecord component
-
audio
Returns the value of theaudiorecord component.- Returns:
- the value of the
audiorecord component
-