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
@JvmStatic
@JvmOverloads
fun create(
context: Context,
agentId: String,
baseUrl: String = Qwry.DEFAULT_BASE_URL,
maxToolLoopSteps: Int = 10
): QwryClientCreates 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:
val client = Qwry.create(
context = applicationContext,
agentId = "YOUR_AGENT_ID",
maxToolLoopSteps = 5
)From Java, @JvmOverloads gives you the shorter forms too:
QwryClient client = Qwry.create(context, "YOUR_AGENT_ID");Constants
| Constant | Type | Value | Description |
|---|---|---|---|
Qwry.VERSION | String | "0.1.0" | The SDK's version. It's also sent in each request's User-Agent. |
Qwry.DEFAULT_BASE_URL | String | "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:
| Member | Guide |
|---|---|
send, sendNonStreaming, retry | Streaming |
tool, removeTool | Client-Side Tools |
newConversation, currentConversationId, listConversations, listMessages | Conversations & History |
identify, logout, authState, currentUserId, deviceId | User Identity |
agentId | The agent ID the client was created with |