ReferenceSDKClient
Agents
SDK reference for agents — Create and manage agent chat sessions, and list the agents in a deployment.
Create and manage agent chat sessions, and list the agents in a deployment.
createSession
Create a platform agent chat session
POST
Usage:
const result = await swirls.client.agents.createSession({
agentName: '...',
projectId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
agentName | string | Yes | |
projectId | string | Yes | |
title | string | null | No | |
metadata | object | No |
Output:
| Field | Type | Description |
|---|---|---|
sessionId | string |
listSessions
List agent chat sessions for a project
GET
Usage:
const result = await swirls.client.agents.listSessions({
projectId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
agentName | string | No | |
limit | number | No |
Output:
| Field | Type | Description |
|---|---|---|
sessions | object[] |
getSession
Load an agent chat session by id
GET
Usage:
const result = await swirls.client.agents.getSession({
sessionId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes |
deleteSession
Delete an agent chat session by id
POST
Usage:
const result = await swirls.client.agents.deleteSession({
sessionId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes |
Output:
| Field | Type | Description |
|---|---|---|
deleted | boolean |
createWebSession
Create a web channel chat session for an agent
POST
Usage:
const result = await swirls.client.agents.createWebSession({
projectId: '...',
bindingName: '...',
agentName: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
bindingName | string | Yes | |
agentName | string | Yes | |
title | string | null | No |
Output:
| Field | Type | Description |
|---|---|---|
sessionId | string |
listWebSessions
List web channel chat sessions for the current user
GET
Usage:
const result = await swirls.client.agents.listWebSessions({
projectId: '...',
bindingName: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
bindingName | string | Yes | |
limit | number | No |
Output:
| Field | Type | Description |
|---|---|---|
sessions | object[] |
getWebChatMessages
Load persisted chat-sdk message history for a web session (text-oriented v1)
GET
Usage:
const result = await swirls.client.agents.getWebChatMessages({
sessionId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes |
Output:
| Field | Type | Description |
|---|---|---|
messages | object[] |
listAgents
List agents in the active deployment for a project
GET
Usage:
const result = await swirls.client.agents.listAgents({
projectId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes |
Output:
| Field | Type | Description |
|---|---|---|
agents | object[] |