Response Input
The two shapes the input of a ResponseRequest takes on the wire: a bare string, treated by the API as a single user message, or an array of ResponseItems.
The request constructors and ResponseParams.createRequest wrap a String or a List<ResponseItem> for you, so this type mostly shows up when reading a request back:
when (val input = request.input) {
is ResponseInput.Text -> println(input.text)
is ResponseInput.Items -> println("${'$'}{input.items.size} items")
null -> println("instructions only")
}Content copied to clipboard