Response Content
The two shapes a content or output field takes on the wire: a bare string, or an array of ResponseContentParts.
Reading one is a when over the two cases:
when (val content = message.content) {
is ResponseContent.Text -> println(content.text)
is ResponseContent.Parts -> content.parts.forEach(::println)
null -> println("no content")
}Content copied to clipboard
Writing one is usually implicit: the item constructors take a String or a List<ResponseContentPart> and wrap it for you.