# 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](/docs/android-sdk/conversation-models). **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` > [tab] Text > > ### 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. > [tab] ToolCall > > ### MessagePart.ToolCall > > A tool the agent called. Tools registered with `client.tool` run on the device; others run on the server. > > ```kotlin > data class ToolCall( > val id: String, > val name: String, > val input: Any? > ) : MessagePart > ``` > > **id** `String` *required* > > The tool call's ID. > > **name** `String` *required* > > The tool's name, which is the action's name. > > **input** `Any?` > > The agent's input as a JSON value read by `org.json`, usually a `JSONObject`. > [tab] ToolResult > > ### MessagePart.ToolResult > > What a tool returned. > > ```kotlin > data class ToolResult( > val id: String, > val name: String, > val output: Any? > ) : MessagePart > ``` > > **id** `String` *required* > > The `id` of the `ToolCall` it answers. > > **name** `String` *required* > > The tool's name. > > **output** `Any?` > > The result as a JSON value. A failed tool's output is a `JSONObject` with an `error` field. ## 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 } ``` > [!NOTE] > > `send` and `retry` answer client-side tool calls themselves and only return once the agent has finished, so you'll normally see `STOP`. A reason the SDK doesn't recognise is read as `STOP`.