Skip to content
QwryAI
Documentation
Pages

Android SDK

Conversation & Message

Reference for Conversation, Message, Page and the types used for conversation history

Conversation

data class Conversation, Package: com.qwryai.sdk

Kotlin
data class Conversation(
    val id: String,
    val title: String?,
    val createdAt: Long,
    val updatedAt: Long,
    val userId: String?,
    val status: Status
)

id String required

The conversation's ID.

title String?

A short summary QwryAI writes for the conversation, or null until there is one.

createdAt Long required

When the conversation started, in seconds since 1970.

updatedAt Long required

When it was last active, in seconds since 1970.

userId String?

The identified user it belongs to, or null for an anonymous (device) conversation.

status Conversation.Status required

ONGOING, ENDED or TAKEN_OVER.

Conversation.Status

Kotlin
enum class Status {
    ONGOING,    // the agent is answering
    ENDED,      // the conversation has ended
    TAKEN_OVER  // a person on your team has taken over
}

Message

data class Message, Package: com.qwryai.sdk

Kotlin
data class Message(
    val id: String,
    val role: Role,
    val parts: List<MessagePart>,
    val createdAt: Long? = null,
    val feedback: Feedback? = null,
    val score: Double? = null
) {
    val text: String get() = parts.filterIsInstance<MessagePart.Text>().joinToString("") { it.text }
}

id String required

The message's ID.

role Message.Role required

USER or ASSISTANT.

parts List<MessagePart> required

The message's content: Text, ToolCall and ToolResult parts. See ChatResponse.

createdAt Long?

When it was sent, in seconds since 1970.

feedback Message.Feedback?

The user's rating of the answer, or null.

score Double?

The agent's confidence in this answer, when it reported one.

text String

All of the message's text parts joined together.

Message.Feedback

Kotlin
enum class Feedback {
    POSITIVE, // thumbs up
    NEGATIVE  // thumbs down
}

Page\<T>

data class Page<T>, Package: com.qwryai.sdk

Returned by listConversations() and listMessages().

Kotlin
data class Page<T>(
    val items: List<T>,
    val cursor: String?,
    val hasMore: Boolean,
    val total: Int
)

items List<T> required

The items on this page.

cursor String?

Pass it back to get the next page. null when there are no more.

hasMore Boolean required

Whether another page exists.

total Int required

How many items there are across all pages.

Explore the documentation