SDKClient
Decisions
SDK reference for decisions —
list
GET
Usage:
const result = await swirls.client.decisions.list({
projectId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
cursor | object | No | |
decisionName | string | No | |
deploymentId | string | No | |
model | string | No | |
status | "completed" | "running" | "failed" | "cancelled" | "interrupted" | No | |
from | unknown | No | |
to | unknown | No | |
limit | number | No |
Output:
| Field | Type | Description |
|---|---|---|
items | object[] | |
nextCursor | object | null |
get
GET
Usage:
const result = await swirls.client.decisions.get({
projectId: '...',
traceId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
traceId | string | Yes |
Output:
| Field | Type | Description |
|---|---|---|
id | string | |
executionId | string | |
deploymentId | string | null | |
nodeId | string | |
nodeName | string | |
decisionName | string | |
definitionVersion | string | |
createdAt | unknown | |
model | string | null | |
status | string | |
request | object | |
receipt | object | null | |
attempts | object[] | |
feedback | object[] | |
nodes | object[] | |
reviews | object[] |
addFeedback
POST
Usage:
const result = await swirls.client.decisions.addFeedback({
projectId: '...',
traceId: '...',
feedback: {},
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
traceId | string | Yes | |
feedback | object | Yes |
Output:
| Field | Type | Description |
|---|---|---|
idempotencyKey | string | |
questionId | string | |
kind | "label" | "outcome" | "policy" | "action" | "review" | |
value | string | number | boolean | null | JSON value[] | object | |
source | string | |
reason | string | |
observedAt | unknown | |
supersedes | string[] | |
nodeId | string | |
id | string | |
actorId | string | |
createdAt | unknown |
calibration
GET
Usage:
const result = await swirls.client.decisions.calibration({
projectId: '...',
decisionName: '...',
questionId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
decisionName | string | Yes | |
questionId | string | Yes | |
threshold | number | No | |
from | unknown | No | |
to | unknown | No |
Output:
| Field | Type | Description |
|---|---|---|
generatedAt | unknown | |
sampled | number | |
excluded | number | |
truncated | boolean | |
datasetIds | string[] | |
groups | object[] |