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.cacheControl- The cache control settings for explicit caching. When set to {"type": "ephemeral"}, the system will attempt to hit or create a cache.
- Enclosing class:
- DashScopeApiSpec.ChatCompletionMessage
public static record DashScopeApiSpec.ChatCompletionMessage.MediaContent(String type, String text, String image, List<String> video, String audio, Map<String,String> cacheControl)
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.MediaContent(String type, String text, String image, List<String> video, String audio, Map<String, String> cacheControl) Creates an instance of aMediaContentrecord class.MediaContent(String text, Map<String, String> cacheControl) Constructor for a text content with cache control. -
Method Summary
Modifier and TypeMethodDescriptionaudio()Returns the value of theaudiorecord component.Returns the value of thecacheControlrecord 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
Constructor for a text content with cache control.- Parameters:
text- The text content of the message.cacheControl- The cache control settings.
-
MediaContent
-
MediaContent
-
MediaContent
public MediaContent(String type, String text, String image, List<String> video, String audio, Map<String, String> cacheControl) Creates an instance of aMediaContentrecord class.- Parameters:
type- the value for thetyperecord componenttext- the value for thetextrecord componentimage- the value for theimagerecord componentvideo- the value for thevideorecord componentaudio- the value for theaudiorecord componentcacheControl- the value for thecacheControlrecord component
-
-
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
-
cacheControl
Returns the value of thecacheControlrecord component.- Returns:
- the value of the
cacheControlrecord component
-