InputContent
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ @JsonSubTypes.Type(value = TextInputContent.class, name = "text"), @JsonSubTypes.Type(value = ImageInputContent.class, name = "image"), @JsonSubTypes.Type(value = AudioInputContent.class, name = "audio"), @JsonSubTypes.Type(value = VideoInputContent.class, name = "video"), @JsonSubTypes.Type(value = DocumentInputContent.class, name = "document") }) public sealed interface InputContent permits TextInputContent, ImageInputContent, AudioInputContent, VideoInputContent, DocumentInputContent
源码Source
io/agentscope/core/agui/model/InputContent.java:42–55定义输入内容契约的接口。位于 io.agentscope.core.agui.model 包。
Sealed interface representing a typed content part in the AG-UI protocol.
This corresponds to the AG-UI protocol's InputContent union type,
covering text, image, audio, video, and document inputs.
JSON polymorphism is handled via the type discriminator field,
consistent with the AG-UI protocol specification:
-
"text"→TextInputContent -
"image"→ImageInputContent -
"audio"→AudioInputContent -
"video"→VideoInputContent -
"document"→DocumentInputContent