Skip to content
QwryAI
Documentation
Pages

Android SDK

ChatResponse

Reference for ChatResponse, MessagePart and the enums that send and retry return

ChatResponse

data class ChatResponse, Package: com.qwryai.sdk

What send, sendNonStreaming and retry return once the agent's answer is complete.

Kotlin
data class ChatResponse(
    val message: Message,
    val conversationId: String,
    val userMessageId: String?,
    val userId: String?,
    val finishReason: FinishReason,
    val credits: Double
)

message Message required

The agent's answer. message.id is the ID the server gave it, message.role is always ASSISTANT, message.parts holds its text, tool calls and tool results, and message.text joins its text. message.createdAt is when the answer finished on the device. See Conversation & Message.

conversationId String required

The conversation the answer belongs to. Pass it to continue that conversation.

userMessageId String?

The ID the server gave the message you sent.

userId String?

The identified user, or null while the SDK is anonymous.

finishReason FinishReason required

Why the answer ended: STOP, ERROR or TOOL_CALLS.

credits Double required

Message credits the answer used.

MessagePart

sealed interface MessagePart, Package: com.qwryai.sdk

MessagePart.Text

Text the agent wrote, or the text a user sent.

Kotlin
data class Text(val text: String) : MessagePart

text String required

The text.

Enums

Message.Role

Kotlin
enum class Role {
    USER,      // sent by the user
    ASSISTANT  // written by the agent, or by a person on your team
}

ChatResponse.FinishReason

Kotlin
enum class FinishReason {
    STOP,       // the answer is complete
    ERROR,      // the answer ended with an error
    TOOL_CALLS  // the agent is waiting for tool results
}

Explore the documentation