Skip to content
QwryAI
Documentation
Pages

Android SDK

Qwry

Create the QwryAI Android SDK client with Qwry.create and set its options

object Qwry, Package: com.qwryai.sdk

The factory that creates SDK clients.

create

Kotlin
@JvmStatic
@JvmOverloads
fun create(
    context: Context,
    agentId: String,
    baseUrl: String = Qwry.DEFAULT_BASE_URL,
    maxToolLoopSteps: Int = 10
): QwryClient

Creates a client for one agent. Create it once and keep it, for example in your Application class.

context Context required

Any Android Context. The SDK keeps only its application context, to store the device ID and the signed-in user.

agentId String required

Your agent's ID, from Channels › Android SDK › Setup › Agent ID.

baseUrl String

The SDK API to call. Defaults to https://www.qwryai.com/api/sdk. Change it only to point the app at a test server.

maxToolLoopSteps Int

How many rounds of client-side tool calls one send, sendNonStreaming or retry may make before it throws TOOL_LOOP_LIMIT_EXCEEDED. Defaults to 10.

create (with options)

Pass the options by name:

Kotlin
val client = Qwry.create(
    context = applicationContext,
    agentId = "YOUR_AGENT_ID",
    maxToolLoopSteps = 5
)

From Java, @JvmOverloads gives you the shorter forms too:

java
QwryClient client = Qwry.create(context, "YOUR_AGENT_ID");

Constants

ConstantTypeValueDescription
Qwry.VERSIONString"0.1.0"The SDK's version. It's also sent in each request's User-Agent.
Qwry.DEFAULT_BASE_URLString"https://www.qwryai.com/api/sdk"Where the SDK sends requests unless you pass baseUrl.

QwryClient

class QwryClient, Package: com.qwryai.sdk

What create returns. Each member has its own guide:

MemberGuide
send, sendNonStreaming, retryStreaming
tool, removeToolClient-Side Tools
newConversation, currentConversationId, listConversations, listMessagesConversations & History
identify, logout, authState, currentUserId, deviceIdUser Identity
agentIdThe agent ID the client was created with

Explore the documentation