ResponseContentPart

@Serializable(with = ResponseContentPartSerializer::class)
sealed interface ResponseContentPart

One element of the content array of a ResponseItem.

The concrete subtypes are distinguished on the wire by the type discriminator: InputTextPart and InputImagePart describe what is sent to the model, OutputTextPart and ReasoningTextPart what comes back. A part the SDK does not know is preserved as an UnknownResponseContentPart rather than failing the whole response.

Prefer the input { } DSL over instantiating parts directly:

client.createResponse {
params { model = ChatModel.DEEPSEEK_FLASH }
input {
user {
text("What is in this image?")
image("https://example.com/cat.jpg", ImageDetail.LOW)
}
}
}

See also

Inheritors

Properties

Link copied to clipboard
abstract val type: String

Raw type discriminator of the part.