@cadenya/cadenya 0.124.0 → 0.125.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +18 -7
- package/client.d.mts +17 -11
- package/client.d.mts.map +1 -1
- package/client.d.ts +17 -11
- package/client.d.ts.map +1 -1
- package/client.js +7 -3
- package/client.js.map +1 -1
- package/client.mjs +7 -3
- package/client.mjs.map +1 -1
- package/internal/request-options.d.mts +1 -1
- package/internal/request-options.d.ts +1 -1
- package/package.json +1 -1
- package/resources/account.d.mts +8 -0
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +8 -0
- package/resources/account.d.ts.map +1 -1
- package/resources/account.js.map +1 -1
- package/resources/account.mjs.map +1 -1
- package/resources/agents/agents.d.mts +115 -28
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +115 -28
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js +93 -13
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +93 -13
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/feedback.d.mts +13 -2
- package/resources/agents/feedback.d.mts.map +1 -1
- package/resources/agents/feedback.d.ts +13 -2
- package/resources/agents/feedback.d.ts.map +1 -1
- package/resources/agents/feedback.js +13 -2
- package/resources/agents/feedback.js.map +1 -1
- package/resources/agents/feedback.mjs +13 -2
- package/resources/agents/feedback.mjs.map +1 -1
- package/resources/agents/index.d.mts +1 -1
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +1 -1
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs.map +1 -1
- package/resources/agents/schedules.d.mts +100 -52
- package/resources/agents/schedules.d.mts.map +1 -1
- package/resources/agents/schedules.d.ts +100 -52
- package/resources/agents/schedules.d.ts.map +1 -1
- package/resources/agents/schedules.js +99 -21
- package/resources/agents/schedules.js.map +1 -1
- package/resources/agents/schedules.mjs +99 -21
- package/resources/agents/schedules.mjs.map +1 -1
- package/resources/agents/variations.d.mts +252 -105
- package/resources/agents/variations.d.mts.map +1 -1
- package/resources/agents/variations.d.ts +252 -105
- package/resources/agents/variations.d.ts.map +1 -1
- package/resources/agents/variations.js +138 -27
- package/resources/agents/variations.js.map +1 -1
- package/resources/agents/variations.mjs +138 -27
- package/resources/agents/variations.mjs.map +1 -1
- package/resources/agents/webhook-deliveries.d.mts +13 -2
- package/resources/agents/webhook-deliveries.d.mts.map +1 -1
- package/resources/agents/webhook-deliveries.d.ts +13 -2
- package/resources/agents/webhook-deliveries.d.ts.map +1 -1
- package/resources/agents/webhook-deliveries.js +13 -2
- package/resources/agents/webhook-deliveries.js.map +1 -1
- package/resources/agents/webhook-deliveries.mjs +13 -2
- package/resources/agents/webhook-deliveries.mjs.map +1 -1
- package/resources/ai-provider-keys.d.mts +125 -110
- package/resources/ai-provider-keys.d.mts.map +1 -1
- package/resources/ai-provider-keys.d.ts +125 -110
- package/resources/ai-provider-keys.d.ts.map +1 -1
- package/resources/ai-provider-keys.js +11 -9
- package/resources/ai-provider-keys.js.map +1 -1
- package/resources/ai-provider-keys.mjs +11 -9
- package/resources/ai-provider-keys.mjs.map +1 -1
- package/resources/api-keys.d.mts +28 -20
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +28 -20
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +14 -12
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +14 -12
- package/resources/api-keys.mjs.map +1 -1
- package/resources/index.d.mts +4 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/memory-layers/entries.d.mts +27 -30
- package/resources/memory-layers/entries.d.mts.map +1 -1
- package/resources/memory-layers/entries.d.ts +27 -30
- package/resources/memory-layers/entries.d.ts.map +1 -1
- package/resources/memory-layers/entries.js +12 -12
- package/resources/memory-layers/entries.js.map +1 -1
- package/resources/memory-layers/entries.mjs +12 -12
- package/resources/memory-layers/entries.mjs.map +1 -1
- package/resources/memory-layers/index.d.mts +1 -1
- package/resources/memory-layers/index.d.mts.map +1 -1
- package/resources/memory-layers/index.d.ts +1 -1
- package/resources/memory-layers/index.d.ts.map +1 -1
- package/resources/memory-layers/index.js.map +1 -1
- package/resources/memory-layers/index.mjs.map +1 -1
- package/resources/memory-layers/memory-layers.d.mts +34 -22
- package/resources/memory-layers/memory-layers.d.mts.map +1 -1
- package/resources/memory-layers/memory-layers.d.ts +34 -22
- package/resources/memory-layers/memory-layers.d.ts.map +1 -1
- package/resources/memory-layers/memory-layers.js +11 -9
- package/resources/memory-layers/memory-layers.js.map +1 -1
- package/resources/memory-layers/memory-layers.mjs +11 -9
- package/resources/memory-layers/memory-layers.mjs.map +1 -1
- package/resources/models.d.mts +32 -24
- package/resources/models.d.mts.map +1 -1
- package/resources/models.d.ts +32 -24
- package/resources/models.d.ts.map +1 -1
- package/resources/models.js +10 -8
- package/resources/models.js.map +1 -1
- package/resources/models.mjs +10 -8
- package/resources/models.mjs.map +1 -1
- package/resources/objectives/feedback.d.mts +27 -3
- package/resources/objectives/feedback.d.mts.map +1 -1
- package/resources/objectives/feedback.d.ts +27 -3
- package/resources/objectives/feedback.d.ts.map +1 -1
- package/resources/objectives/feedback.js +27 -3
- package/resources/objectives/feedback.js.map +1 -1
- package/resources/objectives/feedback.mjs +27 -3
- package/resources/objectives/feedback.mjs.map +1 -1
- package/resources/objectives/index.d.mts +2 -2
- package/resources/objectives/index.d.mts.map +1 -1
- package/resources/objectives/index.d.ts +2 -2
- package/resources/objectives/index.d.ts.map +1 -1
- package/resources/objectives/index.js.map +1 -1
- package/resources/objectives/index.mjs.map +1 -1
- package/resources/objectives/objectives.d.mts +273 -102
- package/resources/objectives/objectives.d.mts.map +1 -1
- package/resources/objectives/objectives.d.ts +273 -102
- package/resources/objectives/objectives.d.ts.map +1 -1
- package/resources/objectives/objectives.js +112 -17
- package/resources/objectives/objectives.js.map +1 -1
- package/resources/objectives/objectives.mjs +112 -17
- package/resources/objectives/objectives.mjs.map +1 -1
- package/resources/objectives/tasks.d.mts +25 -8
- package/resources/objectives/tasks.d.mts.map +1 -1
- package/resources/objectives/tasks.d.ts +25 -8
- package/resources/objectives/tasks.d.ts.map +1 -1
- package/resources/objectives/tasks.js +26 -5
- package/resources/objectives/tasks.js.map +1 -1
- package/resources/objectives/tasks.mjs +26 -5
- package/resources/objectives/tasks.mjs.map +1 -1
- package/resources/objectives/tool-calls.d.mts +99 -42
- package/resources/objectives/tool-calls.d.mts.map +1 -1
- package/resources/objectives/tool-calls.d.ts +99 -42
- package/resources/objectives/tool-calls.d.ts.map +1 -1
- package/resources/objectives/tool-calls.js +73 -14
- package/resources/objectives/tool-calls.js.map +1 -1
- package/resources/objectives/tool-calls.mjs +73 -14
- package/resources/objectives/tool-calls.mjs.map +1 -1
- package/resources/objectives/tools.d.mts +13 -2
- package/resources/objectives/tools.d.mts.map +1 -1
- package/resources/objectives/tools.d.ts +13 -2
- package/resources/objectives/tools.d.ts.map +1 -1
- package/resources/objectives/tools.js +13 -2
- package/resources/objectives/tools.js.map +1 -1
- package/resources/objectives/tools.mjs +13 -2
- package/resources/objectives/tools.mjs.map +1 -1
- package/resources/search.d.mts +11 -2
- package/resources/search.d.mts.map +1 -1
- package/resources/search.d.ts +11 -2
- package/resources/search.d.ts.map +1 -1
- package/resources/search.js +3 -2
- package/resources/search.js.map +1 -1
- package/resources/search.mjs +3 -2
- package/resources/search.mjs.map +1 -1
- package/resources/tool-sets/index.d.mts +2 -2
- package/resources/tool-sets/index.d.mts.map +1 -1
- package/resources/tool-sets/index.d.ts +2 -2
- package/resources/tool-sets/index.d.ts.map +1 -1
- package/resources/tool-sets/index.js.map +1 -1
- package/resources/tool-sets/index.mjs.map +1 -1
- package/resources/tool-sets/secrets.d.mts +9 -24
- package/resources/tool-sets/secrets.d.mts.map +1 -1
- package/resources/tool-sets/secrets.d.ts +9 -24
- package/resources/tool-sets/secrets.d.ts.map +1 -1
- package/resources/tool-sets/secrets.js +12 -12
- package/resources/tool-sets/secrets.js.map +1 -1
- package/resources/tool-sets/secrets.mjs +12 -12
- package/resources/tool-sets/secrets.mjs.map +1 -1
- package/resources/tool-sets/tool-sets.d.mts +149 -64
- package/resources/tool-sets/tool-sets.d.mts.map +1 -1
- package/resources/tool-sets/tool-sets.d.ts +149 -64
- package/resources/tool-sets/tool-sets.d.ts.map +1 -1
- package/resources/tool-sets/tool-sets.js +17 -15
- package/resources/tool-sets/tool-sets.js.map +1 -1
- package/resources/tool-sets/tool-sets.mjs +17 -15
- package/resources/tool-sets/tool-sets.mjs.map +1 -1
- package/resources/tool-sets/tools.d.mts +33 -43
- package/resources/tool-sets/tools.d.mts.map +1 -1
- package/resources/tool-sets/tools.d.ts +33 -43
- package/resources/tool-sets/tools.d.ts.map +1 -1
- package/resources/tool-sets/tools.js +18 -18
- package/resources/tool-sets/tools.js.map +1 -1
- package/resources/tool-sets/tools.mjs +18 -18
- package/resources/tool-sets/tools.mjs.map +1 -1
- package/resources/uploads.d.mts +14 -6
- package/resources/uploads.d.mts.map +1 -1
- package/resources/uploads.d.ts +14 -6
- package/resources/uploads.d.ts.map +1 -1
- package/resources/uploads.js +5 -4
- package/resources/uploads.js.map +1 -1
- package/resources/uploads.mjs +5 -4
- package/resources/uploads.mjs.map +1 -1
- package/resources/workspace-admin/index.d.mts +1 -1
- package/resources/workspace-admin/index.d.mts.map +1 -1
- package/resources/workspace-admin/index.d.ts +1 -1
- package/resources/workspace-admin/index.d.ts.map +1 -1
- package/resources/workspace-admin/index.js.map +1 -1
- package/resources/workspace-admin/index.mjs.map +1 -1
- package/resources/workspace-admin/members.d.mts +41 -6
- package/resources/workspace-admin/members.d.mts.map +1 -1
- package/resources/workspace-admin/members.d.ts +41 -6
- package/resources/workspace-admin/members.d.ts.map +1 -1
- package/resources/workspace-admin/members.js +34 -6
- package/resources/workspace-admin/members.js.map +1 -1
- package/resources/workspace-admin/members.mjs +34 -6
- package/resources/workspace-admin/members.mjs.map +1 -1
- package/resources/workspace-admin/profiles.d.mts +8 -0
- package/resources/workspace-admin/profiles.d.mts.map +1 -1
- package/resources/workspace-admin/profiles.d.ts +8 -0
- package/resources/workspace-admin/profiles.d.ts.map +1 -1
- package/resources/workspace-admin/profiles.js +8 -0
- package/resources/workspace-admin/profiles.js.map +1 -1
- package/resources/workspace-admin/profiles.mjs +8 -0
- package/resources/workspace-admin/profiles.mjs.map +1 -1
- package/resources/workspace-admin/workspace-admin.d.mts +65 -9
- package/resources/workspace-admin/workspace-admin.d.mts.map +1 -1
- package/resources/workspace-admin/workspace-admin.d.ts +65 -9
- package/resources/workspace-admin/workspace-admin.d.ts.map +1 -1
- package/resources/workspace-admin/workspace-admin.js +46 -6
- package/resources/workspace-admin/workspace-admin.js.map +1 -1
- package/resources/workspace-admin/workspace-admin.mjs +46 -6
- package/resources/workspace-admin/workspace-admin.mjs.map +1 -1
- package/resources/workspace-secrets.d.mts +27 -15
- package/resources/workspace-secrets.d.mts.map +1 -1
- package/resources/workspace-secrets.d.ts +27 -15
- package/resources/workspace-secrets.d.ts.map +1 -1
- package/resources/workspace-secrets.js +11 -9
- package/resources/workspace-secrets.js.map +1 -1
- package/resources/workspace-secrets.mjs +11 -9
- package/resources/workspace-secrets.mjs.map +1 -1
- package/src/client.ts +102 -5
- package/src/internal/request-options.ts +1 -1
- package/src/resources/account.ts +9 -0
- package/src/resources/agents/agents.ts +147 -37
- package/src/resources/agents/feedback.ts +14 -3
- package/src/resources/agents/index.ts +6 -0
- package/src/resources/agents/schedules.ts +143 -71
- package/src/resources/agents/variations.ts +319 -125
- package/src/resources/agents/webhook-deliveries.ts +14 -3
- package/src/resources/ai-provider-keys.ts +155 -127
- package/src/resources/api-keys.ts +48 -29
- package/src/resources/index.ts +44 -1
- package/src/resources/memory-layers/entries.ts +56 -40
- package/src/resources/memory-layers/index.ts +2 -0
- package/src/resources/memory-layers/memory-layers.ts +53 -30
- package/src/resources/models.ts +46 -31
- package/src/resources/objectives/feedback.ts +29 -5
- package/src/resources/objectives/index.ts +26 -0
- package/src/resources/objectives/objectives.ts +373 -125
- package/src/resources/objectives/tasks.ts +33 -12
- package/src/resources/objectives/tool-calls.ts +123 -46
- package/src/resources/objectives/tools.ts +14 -3
- package/src/resources/search.ts +14 -4
- package/src/resources/tool-sets/index.ts +23 -3
- package/src/resources/tool-sets/secrets.ts +32 -35
- package/src/resources/tool-sets/tool-sets.ts +239 -79
- package/src/resources/tool-sets/tools.ts +79 -61
- package/src/resources/uploads.ts +22 -8
- package/src/resources/workspace-admin/index.ts +2 -0
- package/src/resources/workspace-admin/members.ts +53 -12
- package/src/resources/workspace-admin/profiles.ts +8 -0
- package/src/resources/workspace-admin/workspace-admin.ts +80 -11
- package/src/resources/workspace-secrets.ts +40 -25
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -27,6 +27,9 @@ import {
|
|
|
27
27
|
} from './schedules';
|
|
28
28
|
import * as VariationsAPI from './variations';
|
|
29
29
|
import {
|
|
30
|
+
AddAgentVariationAssignmentRequestSubAgentID,
|
|
31
|
+
AddAgentVariationAssignmentRequestToolID,
|
|
32
|
+
AddAgentVariationAssignmentRequestToolSetID,
|
|
30
33
|
AgentVariation,
|
|
31
34
|
AgentVariationInfo,
|
|
32
35
|
AgentVariationSpec,
|
|
@@ -40,6 +43,9 @@ import {
|
|
|
40
43
|
VariationAddAssignmentParams,
|
|
41
44
|
VariationAddMemoryLayerParams,
|
|
42
45
|
VariationAssignment,
|
|
46
|
+
VariationAssignmentAgent,
|
|
47
|
+
VariationAssignmentTool,
|
|
48
|
+
VariationAssignmentToolSet,
|
|
43
49
|
VariationCreateParams,
|
|
44
50
|
VariationDeleteParams,
|
|
45
51
|
VariationListParams,
|
|
@@ -78,36 +84,79 @@ export class Agents extends APIResource {
|
|
|
78
84
|
|
|
79
85
|
/**
|
|
80
86
|
* Creates a new agent in the workspace
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const agent = await client.agents.create({
|
|
91
|
+
* workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q',
|
|
92
|
+
* metadata: { name: 'name' },
|
|
93
|
+
* spec: {
|
|
94
|
+
* variationSelectionMode:
|
|
95
|
+
* 'VARIATION_SELECTION_MODE_UNSPECIFIED',
|
|
96
|
+
* },
|
|
97
|
+
* });
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
create(params: AgentCreateParams, options?: RequestOptions): APIPromise<Agent> {
|
|
101
|
+
const { workspaceId = this._client.workspaceID, ...body } = params;
|
|
102
|
+
return this._client.post(path`/v1/workspaces/${workspaceId}/agents`, { body, ...options });
|
|
84
103
|
}
|
|
85
104
|
|
|
86
105
|
/**
|
|
87
106
|
* Retrieves an agent by ID from the workspace
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* const agent = await client.agents.retrieve(
|
|
111
|
+
* 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
|
|
112
|
+
* { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
|
|
113
|
+
* );
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
retrieve(
|
|
117
|
+
id: string,
|
|
118
|
+
params: AgentRetrieveParams | null | undefined = {},
|
|
119
|
+
options?: RequestOptions,
|
|
120
|
+
): APIPromise<Agent> {
|
|
121
|
+
const { workspaceId = this._client.workspaceID } = params ?? {};
|
|
91
122
|
return this._client.get(path`/v1/workspaces/${workspaceId}/agents/${id}`, options);
|
|
92
123
|
}
|
|
93
124
|
|
|
94
125
|
/**
|
|
95
126
|
* Updates an agent in the workspace
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* const agent = await client.agents.update(
|
|
131
|
+
* 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
|
|
132
|
+
* { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
|
|
133
|
+
* );
|
|
134
|
+
* ```
|
|
96
135
|
*/
|
|
97
136
|
update(id: string, params: AgentUpdateParams, options?: RequestOptions): APIPromise<Agent> {
|
|
98
|
-
const { workspaceId, ...body } = params;
|
|
137
|
+
const { workspaceId = this._client.workspaceID, ...body } = params;
|
|
99
138
|
return this._client.patch(path`/v1/workspaces/${workspaceId}/agents/${id}`, { body, ...options });
|
|
100
139
|
}
|
|
101
140
|
|
|
102
141
|
/**
|
|
103
142
|
* Lists all agents in the workspace
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```ts
|
|
146
|
+
* // Automatically fetches more pages as needed.
|
|
147
|
+
* for await (const agent of client.agents.list({
|
|
148
|
+
* workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q',
|
|
149
|
+
* })) {
|
|
150
|
+
* // ...
|
|
151
|
+
* }
|
|
152
|
+
* ```
|
|
104
153
|
*/
|
|
105
154
|
list(
|
|
106
|
-
|
|
107
|
-
query: AgentListParams | null | undefined = {},
|
|
155
|
+
params: AgentListParams | null | undefined = {},
|
|
108
156
|
options?: RequestOptions,
|
|
109
157
|
): PagePromise<AgentsCursorPagination, Agent> {
|
|
110
|
-
|
|
158
|
+
const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
|
|
159
|
+
return this._client.getAPIList(path`/v1/workspaces/${workspaceId}/agents`, CursorPagination<Agent>, {
|
|
111
160
|
query,
|
|
112
161
|
...options,
|
|
113
162
|
});
|
|
@@ -115,9 +164,21 @@ export class Agents extends APIResource {
|
|
|
115
164
|
|
|
116
165
|
/**
|
|
117
166
|
* Deletes an agent from the workspace
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```ts
|
|
170
|
+
* await client.agents.delete(
|
|
171
|
+
* 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
|
|
172
|
+
* { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
|
|
173
|
+
* );
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
delete(
|
|
177
|
+
id: string,
|
|
178
|
+
params: AgentDeleteParams | null | undefined = {},
|
|
179
|
+
options?: RequestOptions,
|
|
180
|
+
): APIPromise<void> {
|
|
181
|
+
const { workspaceId = this._client.workspaceID } = params ?? {};
|
|
121
182
|
return this._client.delete(path`/v1/workspaces/${workspaceId}/agents/${id}`, {
|
|
122
183
|
...options,
|
|
123
184
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
@@ -127,27 +188,51 @@ export class Agents extends APIResource {
|
|
|
127
188
|
/**
|
|
128
189
|
* Transitions an agent to STATE_ARCHIVED. Archived agents are hidden from list
|
|
129
190
|
* results and cannot be used for objectives; active schedules are paused.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```ts
|
|
194
|
+
* const agent = await client.agents.archive(
|
|
195
|
+
* 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
|
|
196
|
+
* { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
|
|
197
|
+
* );
|
|
198
|
+
* ```
|
|
130
199
|
*/
|
|
131
200
|
archive(id: string, params: AgentArchiveParams, options?: RequestOptions): APIPromise<Agent> {
|
|
132
|
-
const { workspaceId, ...body } = params;
|
|
201
|
+
const { workspaceId = this._client.workspaceID, ...body } = params;
|
|
133
202
|
return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${id}:archive`, { body, ...options });
|
|
134
203
|
}
|
|
135
204
|
|
|
136
205
|
/**
|
|
137
206
|
* Transitions an agent to STATE_PUBLISHED, making it available for objectives. The
|
|
138
207
|
* agent must have at least one variation.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```ts
|
|
211
|
+
* const agent = await client.agents.publish(
|
|
212
|
+
* 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
|
|
213
|
+
* { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
|
|
214
|
+
* );
|
|
215
|
+
* ```
|
|
139
216
|
*/
|
|
140
217
|
publish(id: string, params: AgentPublishParams, options?: RequestOptions): APIPromise<Agent> {
|
|
141
|
-
const { workspaceId, ...body } = params;
|
|
218
|
+
const { workspaceId = this._client.workspaceID, ...body } = params;
|
|
142
219
|
return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${id}:publish`, { body, ...options });
|
|
143
220
|
}
|
|
144
221
|
|
|
145
222
|
/**
|
|
146
223
|
* Transitions an archived agent back to STATE_DRAFT. Publish the agent again to
|
|
147
224
|
* make it available for objectives.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```ts
|
|
228
|
+
* const agent = await client.agents.unarchive(
|
|
229
|
+
* 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
|
|
230
|
+
* { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
|
|
231
|
+
* );
|
|
232
|
+
* ```
|
|
148
233
|
*/
|
|
149
234
|
unarchive(id: string, params: AgentUnarchiveParams, options?: RequestOptions): APIPromise<Agent> {
|
|
150
|
-
const { workspaceId, ...body } = params;
|
|
235
|
+
const { workspaceId = this._client.workspaceID, ...body } = params;
|
|
151
236
|
return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${id}:unarchive`, {
|
|
152
237
|
body,
|
|
153
238
|
...options,
|
|
@@ -157,9 +242,17 @@ export class Agents extends APIResource {
|
|
|
157
242
|
/**
|
|
158
243
|
* Transitions a published agent back to STATE_DRAFT. Active schedules for the
|
|
159
244
|
* agent are paused until it is published again.
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```ts
|
|
248
|
+
* const agent = await client.agents.unpublish(
|
|
249
|
+
* 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
|
|
250
|
+
* { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
|
|
251
|
+
* );
|
|
252
|
+
* ```
|
|
160
253
|
*/
|
|
161
254
|
unpublish(id: string, params: AgentUnpublishParams, options?: RequestOptions): APIPromise<Agent> {
|
|
162
|
-
const { workspaceId, ...body } = params;
|
|
255
|
+
const { workspaceId = this._client.workspaceID, ...body } = params;
|
|
163
256
|
return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${id}:unpublish`, {
|
|
164
257
|
body,
|
|
165
258
|
...options,
|
|
@@ -281,19 +374,25 @@ export interface Page {
|
|
|
281
374
|
|
|
282
375
|
export interface AgentCreateParams {
|
|
283
376
|
/**
|
|
284
|
-
*
|
|
285
|
-
|
|
286
|
-
|
|
377
|
+
* Path param: Workspace ID.
|
|
378
|
+
*/
|
|
379
|
+
workspaceId?: string;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Body param: CreateResourceMetadata contains the user-provided fields for
|
|
383
|
+
* creating a workspace-scoped resource. Read-only fields (id, account_id,
|
|
384
|
+
* workspace_id, profile_id, created_at) are excluded since they are set by the
|
|
385
|
+
* server.
|
|
287
386
|
*/
|
|
288
387
|
metadata: Shared.CreateResourceMetadata;
|
|
289
388
|
|
|
290
389
|
/**
|
|
291
|
-
* Agent specification (user-provided configuration)
|
|
390
|
+
* Body param: Agent specification (user-provided configuration)
|
|
292
391
|
*/
|
|
293
392
|
spec: AgentSpec;
|
|
294
393
|
|
|
295
394
|
/**
|
|
296
|
-
* Create agent variation request
|
|
395
|
+
* Body param: Create agent variation request
|
|
297
396
|
*/
|
|
298
397
|
defaultVariation?: AgentCreateParams.DefaultVariation;
|
|
299
398
|
}
|
|
@@ -321,14 +420,14 @@ export interface AgentRetrieveParams {
|
|
|
321
420
|
/**
|
|
322
421
|
* Workspace ID.
|
|
323
422
|
*/
|
|
324
|
-
workspaceId
|
|
423
|
+
workspaceId?: string;
|
|
325
424
|
}
|
|
326
425
|
|
|
327
426
|
export interface AgentUpdateParams {
|
|
328
427
|
/**
|
|
329
428
|
* Path param: Workspace ID.
|
|
330
429
|
*/
|
|
331
|
-
workspaceId
|
|
430
|
+
workspaceId?: string;
|
|
332
431
|
|
|
333
432
|
/**
|
|
334
433
|
* Body param: UpdateResourceMetadata contains the user-provided fields for
|
|
@@ -351,40 +450,45 @@ export interface AgentUpdateParams {
|
|
|
351
450
|
|
|
352
451
|
export interface AgentListParams extends CursorPaginationParams {
|
|
353
452
|
/**
|
|
354
|
-
*
|
|
355
|
-
|
|
453
|
+
* Path param: Workspace ID.
|
|
454
|
+
*/
|
|
455
|
+
workspaceId?: string;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Query param: When true, the `info` field on each returned agent is populated.
|
|
459
|
+
* Requests with this flag count more against your rate limit.
|
|
356
460
|
*/
|
|
357
461
|
includeInfo?: boolean;
|
|
358
462
|
|
|
359
463
|
/**
|
|
360
|
-
* Filters by metadata labels. Comma-separated key=value pairs, e.g.
|
|
464
|
+
* Query param: Filters by metadata labels. Comma-separated key=value pairs, e.g.
|
|
361
465
|
* "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
|
|
362
466
|
* semantics).
|
|
363
467
|
*/
|
|
364
468
|
labels?: string;
|
|
365
469
|
|
|
366
470
|
/**
|
|
367
|
-
* Filter expression (query param: prefix)
|
|
471
|
+
* Query param: Filter expression (query param: prefix)
|
|
368
472
|
*/
|
|
369
473
|
prefix?: string;
|
|
370
474
|
|
|
371
475
|
/**
|
|
372
|
-
* Free-form search query
|
|
476
|
+
* Query param: Free-form search query
|
|
373
477
|
*/
|
|
374
478
|
query?: string;
|
|
375
479
|
|
|
376
480
|
/**
|
|
377
|
-
* Sort order for results (asc or desc by creation time)
|
|
481
|
+
* Query param: Sort order for results (asc or desc by creation time)
|
|
378
482
|
*/
|
|
379
483
|
sortOrder?: string;
|
|
380
484
|
|
|
381
485
|
/**
|
|
382
|
-
* Filter by agent lifecycle state
|
|
486
|
+
* Query param: Filter by agent lifecycle state
|
|
383
487
|
*/
|
|
384
488
|
state?: 'STATE_UNSPECIFIED' | 'STATE_DRAFT' | 'STATE_PUBLISHED' | 'STATE_ARCHIVED';
|
|
385
489
|
|
|
386
490
|
/**
|
|
387
|
-
* Filter by variation selection mode
|
|
491
|
+
* Query param: Filter by variation selection mode
|
|
388
492
|
*/
|
|
389
493
|
variationSelectionMode?:
|
|
390
494
|
| 'VARIATION_SELECTION_MODE_UNSPECIFIED'
|
|
@@ -396,35 +500,35 @@ export interface AgentDeleteParams {
|
|
|
396
500
|
/**
|
|
397
501
|
* Workspace ID.
|
|
398
502
|
*/
|
|
399
|
-
workspaceId
|
|
503
|
+
workspaceId?: string;
|
|
400
504
|
}
|
|
401
505
|
|
|
402
506
|
export interface AgentArchiveParams {
|
|
403
507
|
/**
|
|
404
508
|
* Workspace ID.
|
|
405
509
|
*/
|
|
406
|
-
workspaceId
|
|
510
|
+
workspaceId?: string;
|
|
407
511
|
}
|
|
408
512
|
|
|
409
513
|
export interface AgentPublishParams {
|
|
410
514
|
/**
|
|
411
515
|
* Workspace ID.
|
|
412
516
|
*/
|
|
413
|
-
workspaceId
|
|
517
|
+
workspaceId?: string;
|
|
414
518
|
}
|
|
415
519
|
|
|
416
520
|
export interface AgentUnarchiveParams {
|
|
417
521
|
/**
|
|
418
522
|
* Workspace ID.
|
|
419
523
|
*/
|
|
420
|
-
workspaceId
|
|
524
|
+
workspaceId?: string;
|
|
421
525
|
}
|
|
422
526
|
|
|
423
527
|
export interface AgentUnpublishParams {
|
|
424
528
|
/**
|
|
425
529
|
* Workspace ID.
|
|
426
530
|
*/
|
|
427
|
-
workspaceId
|
|
531
|
+
workspaceId?: string;
|
|
428
532
|
}
|
|
429
533
|
|
|
430
534
|
Agents.Feedback = Feedback;
|
|
@@ -462,6 +566,9 @@ export declare namespace Agents {
|
|
|
462
566
|
|
|
463
567
|
export {
|
|
464
568
|
Variations as Variations,
|
|
569
|
+
type AddAgentVariationAssignmentRequestSubAgentID as AddAgentVariationAssignmentRequestSubAgentID,
|
|
570
|
+
type AddAgentVariationAssignmentRequestToolID as AddAgentVariationAssignmentRequestToolID,
|
|
571
|
+
type AddAgentVariationAssignmentRequestToolSetID as AddAgentVariationAssignmentRequestToolSetID,
|
|
465
572
|
type AgentVariation as AgentVariation,
|
|
466
573
|
type AgentVariationInfo as AgentVariationInfo,
|
|
467
574
|
type AgentVariationSpec as AgentVariationSpec,
|
|
@@ -472,6 +579,9 @@ export declare namespace Agents {
|
|
|
472
579
|
type CompactionConfigSummarizationStrategy as CompactionConfigSummarizationStrategy,
|
|
473
580
|
type CompactionConfigToolResultClearingStrategy as CompactionConfigToolResultClearingStrategy,
|
|
474
581
|
type VariationAssignment as VariationAssignment,
|
|
582
|
+
type VariationAssignmentAgent as VariationAssignmentAgent,
|
|
583
|
+
type VariationAssignmentTool as VariationAssignmentTool,
|
|
584
|
+
type VariationAssignmentToolSet as VariationAssignmentToolSet,
|
|
475
585
|
type VariationMemoryLayerAssignment as VariationMemoryLayerAssignment,
|
|
476
586
|
type AgentVariationsCursorPagination as AgentVariationsCursorPagination,
|
|
477
587
|
type VariationCreateParams as VariationCreateParams,
|
|
@@ -15,13 +15,24 @@ export class Feedback extends APIResource {
|
|
|
15
15
|
* Lists feedback submitted across all objectives belonging to an agent. Supports
|
|
16
16
|
* search by comment, sentiment filter, agent variation filter, and creation date
|
|
17
17
|
* range. Results are ordered by creation time, newest first.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* // Automatically fetches more pages as needed.
|
|
22
|
+
* for await (const objectiveFeedback of client.agents.feedback.list(
|
|
23
|
+
* 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
|
|
24
|
+
* { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
|
|
25
|
+
* )) {
|
|
26
|
+
* // ...
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
18
29
|
*/
|
|
19
30
|
list(
|
|
20
31
|
agentID: string,
|
|
21
|
-
params: FeedbackListParams,
|
|
32
|
+
params: FeedbackListParams | null | undefined = {},
|
|
22
33
|
options?: RequestOptions,
|
|
23
34
|
): PagePromise<ObjectiveFeedbacksCursorPagination, ObjectivesFeedbackAPI.ObjectiveFeedback> {
|
|
24
|
-
const { workspaceId, ...query } = params;
|
|
35
|
+
const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
|
|
25
36
|
return this._client.getAPIList(
|
|
26
37
|
path`/v1/workspaces/${workspaceId}/agents/${agentID}/feedback`,
|
|
27
38
|
CursorPagination<ObjectivesFeedbackAPI.ObjectiveFeedback>,
|
|
@@ -34,7 +45,7 @@ export interface FeedbackListParams extends CursorPaginationParams {
|
|
|
34
45
|
/**
|
|
35
46
|
* Path param
|
|
36
47
|
*/
|
|
37
|
-
workspaceId
|
|
48
|
+
workspaceId?: string;
|
|
38
49
|
|
|
39
50
|
/**
|
|
40
51
|
* Query param: Optional filter to limit results to feedback on objectives run by a
|
|
@@ -39,6 +39,9 @@ export {
|
|
|
39
39
|
} from './schedules';
|
|
40
40
|
export {
|
|
41
41
|
Variations,
|
|
42
|
+
type AddAgentVariationAssignmentRequestSubAgentID,
|
|
43
|
+
type AddAgentVariationAssignmentRequestToolID,
|
|
44
|
+
type AddAgentVariationAssignmentRequestToolSetID,
|
|
42
45
|
type AgentVariation,
|
|
43
46
|
type AgentVariationInfo,
|
|
44
47
|
type AgentVariationSpec,
|
|
@@ -49,6 +52,9 @@ export {
|
|
|
49
52
|
type CompactionConfigSummarizationStrategy,
|
|
50
53
|
type CompactionConfigToolResultClearingStrategy,
|
|
51
54
|
type VariationAssignment,
|
|
55
|
+
type VariationAssignmentAgent,
|
|
56
|
+
type VariationAssignmentTool,
|
|
57
|
+
type VariationAssignmentToolSet,
|
|
52
58
|
type VariationMemoryLayerAssignment,
|
|
53
59
|
type VariationCreateParams,
|
|
54
60
|
type VariationRetrieveParams,
|