类 OpenAIContentPart
java.lang.Object
io.agentscope.core.formatter.openai.dto.OpenAIContentPart
OpenAI content part DTO for multimodal messages.
Each content part has a type and corresponding data: - "text" type with text field - "image_url" type with image_url field - "video_url" type with video_url field - "input_audio" type with input_audio field
Example text part:
{"type": "text", "text": "What's in this image?"}
Example image part:
{"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}
Example video part:
{"type": "video_url", "videoUrl": {"url": "https://example.com/video.mp4"}}
-
嵌套类概要
嵌套类 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static OpenAIContentPart.Builderbuilder()getText()getType()static OpenAIContentPartCreate an image content part.static OpenAIContentPartCreate an image content part with detail level.static OpenAIContentPartinputAudio(String data, String format) Create an audio content part.voidsetImageUrl(OpenAIImageUrl imageUrl) voidsetInputAudio(OpenAIInputAudio inputAudio) voidvoidvoidsetVideoUrl(OpenAIVideoUrl videoUrl) static OpenAIContentPartCreate a text content part.static OpenAIContentPartCreate a video content part.
-
构造器详细资料
-
OpenAIContentPart
public OpenAIContentPart()
-
-
方法详细资料
-
getType
-
setType
-
getText
-
setText
-
getImageUrl
-
setImageUrl
-
getInputAudio
-
setInputAudio
-
getVideoUrl
-
setVideoUrl
-
text
Create a text content part.- 参数:
text- the text content- 返回:
- a new OpenAIContentPart
-
imageUrl
Create an image content part.- 参数:
url- the image URL or base64 data URI- 返回:
- a new OpenAIContentPart
-
imageUrl
Create an image content part with detail level.- 参数:
url- the image URL or base64 data URIdetail- the detail level ("low", "high", or "auto")- 返回:
- a new OpenAIContentPart
-
inputAudio
Create an audio content part.- 参数:
data- the base64-encoded audio dataformat- the audio format (e.g., "wav", "mp3")- 返回:
- a new OpenAIContentPart
-
videoUrl
Create a video content part.- 参数:
url- the video URL or base64 data URI- 返回:
- a new OpenAIContentPart
-
builder
-