Text
@SerialName(value = "text")
@Serializable
Plain text content.
Implements Request, Response, and StreamResponse, making it usable in all contexts.
Samples
// Create a message with text content.
val message = Message(
role = Role.User,
content = Content.Text("Hello, how are you?")
)Content copied to clipboard
when (content) { // Content is Content.StreamResponse!
is Content.Text -> println("Text chunk: ${content.text}")
is Content.Reasoning -> println("Reasoning chunk: ${content.value}")
is Content.ToolCallDelta -> println("Tool call delta ${content.name}, ${content.argumentsChunk}")
}Content copied to clipboard
Functions
Link copied to clipboard
Wraps this request content as an assistant Message.
Link copied to clipboard
Attempts to cast this response content to a request-compatible content type.