@roarkanalytics/sdk 6.2.0 → 7.0.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 +16 -0
- package/client.d.mts +6 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/lib/config.d.mts +12 -0
- package/lib/config.d.mts.map +1 -1
- package/lib/config.d.ts +12 -0
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +11 -1
- package/lib/config.js.map +1 -1
- package/lib/config.mjs +9 -0
- package/lib/config.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/calendar-connection.d.mts +897 -0
- package/resources/calendar-connection.d.mts.map +1 -0
- package/resources/calendar-connection.d.ts +897 -0
- package/resources/calendar-connection.d.ts.map +1 -0
- package/resources/calendar-connection.js +143 -0
- package/resources/calendar-connection.js.map +1 -0
- package/resources/calendar-connection.mjs +139 -0
- package/resources/calendar-connection.mjs.map +1 -0
- package/resources/call.d.mts +2 -0
- package/resources/call.d.mts.map +1 -1
- package/resources/call.d.ts +2 -0
- package/resources/call.d.ts.map +1 -1
- package/resources/config.d.mts +506 -26
- package/resources/config.d.mts.map +1 -1
- package/resources/config.d.ts +506 -26
- package/resources/config.d.ts.map +1 -1
- package/resources/http-request-definition.d.mts +4 -4
- package/resources/http-request-definition.d.mts.map +1 -1
- package/resources/http-request-definition.d.ts +4 -4
- package/resources/http-request-definition.d.ts.map +1 -1
- package/resources/index.d.mts +2 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/metric-variant.d.mts +5 -0
- package/resources/metric-variant.d.mts.map +1 -1
- package/resources/metric-variant.d.ts +5 -0
- package/resources/metric-variant.d.ts.map +1 -1
- package/resources/metric.d.mts +90 -0
- package/resources/metric.d.mts.map +1 -1
- package/resources/metric.d.ts +90 -0
- package/resources/metric.d.ts.map +1 -1
- package/resources/tool.d.mts +671 -0
- package/resources/tool.d.mts.map +1 -0
- package/resources/tool.d.ts +671 -0
- package/resources/tool.d.ts.map +1 -0
- package/resources/tool.js +83 -0
- package/resources/tool.js.map +1 -0
- package/resources/tool.mjs +79 -0
- package/resources/tool.mjs.map +1 -0
- package/src/client.ts +58 -0
- package/src/lib/config.ts +22 -0
- package/src/resources/calendar-connection.ts +1103 -0
- package/src/resources/call.ts +4 -0
- package/src/resources/config.ts +937 -23
- package/src/resources/http-request-definition.ts +4 -4
- package/src/resources/index.ts +26 -0
- package/src/resources/metric-variant.ts +6 -0
- package/src/resources/metric.ts +108 -0
- package/src/resources/tool.ts +884 -0
- 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
|
@@ -0,0 +1,884 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Tool extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a tool and declares its first version. A tool only recorded from calls
|
|
11
|
+
* under the same name is adopted; one already declared returns 409. Give it a
|
|
12
|
+
* `runtime` for a hosted agent to call your endpoint. Header values are returned
|
|
13
|
+
* on read, so keep secrets out of them.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const tool = await client.tool.create({
|
|
18
|
+
* description: 'x',
|
|
19
|
+
* name: 'book_appointment',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
create(body: ToolCreateParams, options?: RequestOptions): APIPromise<ToolCreateResponse> {
|
|
24
|
+
return this._client.post('/v1/tool', { body, ...options });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Replaces the tool: its name, scope, inputs, description, grading hints and
|
|
29
|
+
* runtime. A field left out is cleared, so omitting agentId makes the tool
|
|
30
|
+
* project-wide. A change declares a new version; agent versions pinned to an older
|
|
31
|
+
* one keep it.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const tool = await client.tool.update(
|
|
36
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
37
|
+
* { description: 'x', name: 'book_appointment' },
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
update(toolID: string, body: ToolUpdateParams, options?: RequestOptions): APIPromise<ToolUpdateResponse> {
|
|
42
|
+
return this._client.put(path`/v1/tool/${toolID}`, { body, ...options });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The project's tools and the built-in ones, each with its latest version: inputs,
|
|
47
|
+
* description and, for a tool a hosted agent runs, its request. Attach one to an
|
|
48
|
+
* agent draft by id.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const tools = await client.tool.list();
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
list(
|
|
56
|
+
query: ToolListParams | null | undefined = {},
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): APIPromise<ToolListResponse> {
|
|
59
|
+
return this._client.get('/v1/tool', { query, ...options });
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Deletes a tool no agent version uses. A tool an agent version uses returns 409.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const tool = await client.tool.delete(
|
|
68
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
69
|
+
* );
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
delete(toolID: string, options?: RequestOptions): APIPromise<ToolDeleteResponse> {
|
|
73
|
+
return this._client.delete(path`/v1/tool/${toolID}`, options);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Get a tool
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* const response = await client.tool.getByID(
|
|
82
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
83
|
+
* );
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
getByID(toolID: string, options?: RequestOptions): APIPromise<ToolGetByIDResponse> {
|
|
87
|
+
return this._client.get(path`/v1/tool/${toolID}`, options);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface ToolCreateResponse {
|
|
92
|
+
data: ToolCreateResponse.Data;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export namespace ToolCreateResponse {
|
|
96
|
+
export interface Data {
|
|
97
|
+
id: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The agent the tool is scoped to; null for the project
|
|
101
|
+
*/
|
|
102
|
+
agentId: string | null;
|
|
103
|
+
|
|
104
|
+
createdAt: string;
|
|
105
|
+
|
|
106
|
+
description: string | null;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* How it should handle the result, for grading
|
|
110
|
+
*/
|
|
111
|
+
expectedResult: string | null;
|
|
112
|
+
|
|
113
|
+
inputs: Array<Data.Input>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* When the agent should call it, for grading
|
|
117
|
+
*/
|
|
118
|
+
invocationCriteria: string | null;
|
|
119
|
+
|
|
120
|
+
name: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* What a hosted agent sends and says when it calls the tool
|
|
124
|
+
*/
|
|
125
|
+
runtime: Data.Runtime | null;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* SYSTEM for a built-in tool every project can attach
|
|
129
|
+
*/
|
|
130
|
+
source: 'CUSTOM' | 'SYSTEM';
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The stable key of a built-in tool, such as dtmf
|
|
134
|
+
*/
|
|
135
|
+
systemKey: string | null;
|
|
136
|
+
|
|
137
|
+
updatedAt: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The latest version; null before any is declared
|
|
141
|
+
*/
|
|
142
|
+
version: number | null;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export namespace Data {
|
|
146
|
+
export interface Input {
|
|
147
|
+
/**
|
|
148
|
+
* What the input is, so the agent fills it in right
|
|
149
|
+
*/
|
|
150
|
+
description: string | null;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The input name, as the agent passes it
|
|
154
|
+
*/
|
|
155
|
+
name: string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The agent must pass it
|
|
159
|
+
*/
|
|
160
|
+
required: boolean;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* string, number or boolean
|
|
164
|
+
*/
|
|
165
|
+
type: 'string' | 'number' | 'boolean';
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* What a hosted agent sends and says when it calls the tool
|
|
170
|
+
*/
|
|
171
|
+
export interface Runtime {
|
|
172
|
+
/**
|
|
173
|
+
* The tool books, cancels or sends something: its call is not abandoned when the
|
|
174
|
+
* caller interrupts, and each request carries an Idempotency-Key.
|
|
175
|
+
*/
|
|
176
|
+
changesData: boolean;
|
|
177
|
+
|
|
178
|
+
messages: Runtime.Messages;
|
|
179
|
+
|
|
180
|
+
request: Runtime.Request;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Dot paths into the JSON response the agent is given. Null gives it the whole
|
|
184
|
+
* response.
|
|
185
|
+
*/
|
|
186
|
+
responseFields: Array<string> | null;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export namespace Runtime {
|
|
190
|
+
export interface Messages {
|
|
191
|
+
/**
|
|
192
|
+
* Said as the request goes out
|
|
193
|
+
*/
|
|
194
|
+
before: string | null;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Given to the agent to say when the request fails
|
|
198
|
+
*/
|
|
199
|
+
failure: string | null;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Said once if the request is slow
|
|
203
|
+
*/
|
|
204
|
+
slow: string | null;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface Request {
|
|
208
|
+
/**
|
|
209
|
+
* JSON body template. Null sends the inputs as the body (POST, PUT, PATCH) or the
|
|
210
|
+
* query (GET, DELETE).
|
|
211
|
+
*/
|
|
212
|
+
body: string | null;
|
|
213
|
+
|
|
214
|
+
headers: Array<Request.Header>;
|
|
215
|
+
|
|
216
|
+
method: 'POST' | 'PUT' | 'PATCH' | 'GET' | 'DELETE';
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* How long the agent waits, 1000 to 30000 ms
|
|
220
|
+
*/
|
|
221
|
+
timeoutMs: number | null;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* https URL. Placeholders {{args.<input>}} and {{conversation.\*}} (id, direction,
|
|
225
|
+
* modality, agentNumber, customerNumber, startedAt) may appear in the path and
|
|
226
|
+
* query.
|
|
227
|
+
*/
|
|
228
|
+
url: string;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export namespace Request {
|
|
232
|
+
export interface Header {
|
|
233
|
+
name: string;
|
|
234
|
+
|
|
235
|
+
value: string;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface ToolUpdateResponse {
|
|
243
|
+
data: ToolUpdateResponse.Data;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export namespace ToolUpdateResponse {
|
|
247
|
+
export interface Data {
|
|
248
|
+
id: string;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* The agent the tool is scoped to; null for the project
|
|
252
|
+
*/
|
|
253
|
+
agentId: string | null;
|
|
254
|
+
|
|
255
|
+
createdAt: string;
|
|
256
|
+
|
|
257
|
+
description: string | null;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* How it should handle the result, for grading
|
|
261
|
+
*/
|
|
262
|
+
expectedResult: string | null;
|
|
263
|
+
|
|
264
|
+
inputs: Array<Data.Input>;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* When the agent should call it, for grading
|
|
268
|
+
*/
|
|
269
|
+
invocationCriteria: string | null;
|
|
270
|
+
|
|
271
|
+
name: string;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* What a hosted agent sends and says when it calls the tool
|
|
275
|
+
*/
|
|
276
|
+
runtime: Data.Runtime | null;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* SYSTEM for a built-in tool every project can attach
|
|
280
|
+
*/
|
|
281
|
+
source: 'CUSTOM' | 'SYSTEM';
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* The stable key of a built-in tool, such as dtmf
|
|
285
|
+
*/
|
|
286
|
+
systemKey: string | null;
|
|
287
|
+
|
|
288
|
+
updatedAt: string;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* The latest version; null before any is declared
|
|
292
|
+
*/
|
|
293
|
+
version: number | null;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export namespace Data {
|
|
297
|
+
export interface Input {
|
|
298
|
+
/**
|
|
299
|
+
* What the input is, so the agent fills it in right
|
|
300
|
+
*/
|
|
301
|
+
description: string | null;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* The input name, as the agent passes it
|
|
305
|
+
*/
|
|
306
|
+
name: string;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* The agent must pass it
|
|
310
|
+
*/
|
|
311
|
+
required: boolean;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* string, number or boolean
|
|
315
|
+
*/
|
|
316
|
+
type: 'string' | 'number' | 'boolean';
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* What a hosted agent sends and says when it calls the tool
|
|
321
|
+
*/
|
|
322
|
+
export interface Runtime {
|
|
323
|
+
/**
|
|
324
|
+
* The tool books, cancels or sends something: its call is not abandoned when the
|
|
325
|
+
* caller interrupts, and each request carries an Idempotency-Key.
|
|
326
|
+
*/
|
|
327
|
+
changesData: boolean;
|
|
328
|
+
|
|
329
|
+
messages: Runtime.Messages;
|
|
330
|
+
|
|
331
|
+
request: Runtime.Request;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Dot paths into the JSON response the agent is given. Null gives it the whole
|
|
335
|
+
* response.
|
|
336
|
+
*/
|
|
337
|
+
responseFields: Array<string> | null;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export namespace Runtime {
|
|
341
|
+
export interface Messages {
|
|
342
|
+
/**
|
|
343
|
+
* Said as the request goes out
|
|
344
|
+
*/
|
|
345
|
+
before: string | null;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Given to the agent to say when the request fails
|
|
349
|
+
*/
|
|
350
|
+
failure: string | null;
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Said once if the request is slow
|
|
354
|
+
*/
|
|
355
|
+
slow: string | null;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export interface Request {
|
|
359
|
+
/**
|
|
360
|
+
* JSON body template. Null sends the inputs as the body (POST, PUT, PATCH) or the
|
|
361
|
+
* query (GET, DELETE).
|
|
362
|
+
*/
|
|
363
|
+
body: string | null;
|
|
364
|
+
|
|
365
|
+
headers: Array<Request.Header>;
|
|
366
|
+
|
|
367
|
+
method: 'POST' | 'PUT' | 'PATCH' | 'GET' | 'DELETE';
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* How long the agent waits, 1000 to 30000 ms
|
|
371
|
+
*/
|
|
372
|
+
timeoutMs: number | null;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* https URL. Placeholders {{args.<input>}} and {{conversation.\*}} (id, direction,
|
|
376
|
+
* modality, agentNumber, customerNumber, startedAt) may appear in the path and
|
|
377
|
+
* query.
|
|
378
|
+
*/
|
|
379
|
+
url: string;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export namespace Request {
|
|
383
|
+
export interface Header {
|
|
384
|
+
name: string;
|
|
385
|
+
|
|
386
|
+
value: string;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export interface ToolListResponse {
|
|
394
|
+
data: Array<ToolListResponse.Data>;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export namespace ToolListResponse {
|
|
398
|
+
export interface Data {
|
|
399
|
+
id: string;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* The agent the tool is scoped to; null for the project
|
|
403
|
+
*/
|
|
404
|
+
agentId: string | null;
|
|
405
|
+
|
|
406
|
+
createdAt: string;
|
|
407
|
+
|
|
408
|
+
description: string | null;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* How it should handle the result, for grading
|
|
412
|
+
*/
|
|
413
|
+
expectedResult: string | null;
|
|
414
|
+
|
|
415
|
+
inputs: Array<Data.Input>;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* When the agent should call it, for grading
|
|
419
|
+
*/
|
|
420
|
+
invocationCriteria: string | null;
|
|
421
|
+
|
|
422
|
+
name: string;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* What a hosted agent sends and says when it calls the tool
|
|
426
|
+
*/
|
|
427
|
+
runtime: Data.Runtime | null;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* SYSTEM for a built-in tool every project can attach
|
|
431
|
+
*/
|
|
432
|
+
source: 'CUSTOM' | 'SYSTEM';
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* The stable key of a built-in tool, such as dtmf
|
|
436
|
+
*/
|
|
437
|
+
systemKey: string | null;
|
|
438
|
+
|
|
439
|
+
updatedAt: string;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* The latest version; null before any is declared
|
|
443
|
+
*/
|
|
444
|
+
version: number | null;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export namespace Data {
|
|
448
|
+
export interface Input {
|
|
449
|
+
/**
|
|
450
|
+
* What the input is, so the agent fills it in right
|
|
451
|
+
*/
|
|
452
|
+
description: string | null;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* The input name, as the agent passes it
|
|
456
|
+
*/
|
|
457
|
+
name: string;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* The agent must pass it
|
|
461
|
+
*/
|
|
462
|
+
required: boolean;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* string, number or boolean
|
|
466
|
+
*/
|
|
467
|
+
type: 'string' | 'number' | 'boolean';
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* What a hosted agent sends and says when it calls the tool
|
|
472
|
+
*/
|
|
473
|
+
export interface Runtime {
|
|
474
|
+
/**
|
|
475
|
+
* The tool books, cancels or sends something: its call is not abandoned when the
|
|
476
|
+
* caller interrupts, and each request carries an Idempotency-Key.
|
|
477
|
+
*/
|
|
478
|
+
changesData: boolean;
|
|
479
|
+
|
|
480
|
+
messages: Runtime.Messages;
|
|
481
|
+
|
|
482
|
+
request: Runtime.Request;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Dot paths into the JSON response the agent is given. Null gives it the whole
|
|
486
|
+
* response.
|
|
487
|
+
*/
|
|
488
|
+
responseFields: Array<string> | null;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
export namespace Runtime {
|
|
492
|
+
export interface Messages {
|
|
493
|
+
/**
|
|
494
|
+
* Said as the request goes out
|
|
495
|
+
*/
|
|
496
|
+
before: string | null;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Given to the agent to say when the request fails
|
|
500
|
+
*/
|
|
501
|
+
failure: string | null;
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Said once if the request is slow
|
|
505
|
+
*/
|
|
506
|
+
slow: string | null;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
export interface Request {
|
|
510
|
+
/**
|
|
511
|
+
* JSON body template. Null sends the inputs as the body (POST, PUT, PATCH) or the
|
|
512
|
+
* query (GET, DELETE).
|
|
513
|
+
*/
|
|
514
|
+
body: string | null;
|
|
515
|
+
|
|
516
|
+
headers: Array<Request.Header>;
|
|
517
|
+
|
|
518
|
+
method: 'POST' | 'PUT' | 'PATCH' | 'GET' | 'DELETE';
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* How long the agent waits, 1000 to 30000 ms
|
|
522
|
+
*/
|
|
523
|
+
timeoutMs: number | null;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* https URL. Placeholders {{args.<input>}} and {{conversation.\*}} (id, direction,
|
|
527
|
+
* modality, agentNumber, customerNumber, startedAt) may appear in the path and
|
|
528
|
+
* query.
|
|
529
|
+
*/
|
|
530
|
+
url: string;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export namespace Request {
|
|
534
|
+
export interface Header {
|
|
535
|
+
name: string;
|
|
536
|
+
|
|
537
|
+
value: string;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
export interface ToolDeleteResponse {
|
|
545
|
+
data: ToolDeleteResponse.Data;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
export namespace ToolDeleteResponse {
|
|
549
|
+
export interface Data {
|
|
550
|
+
id: string;
|
|
551
|
+
|
|
552
|
+
deleted: true;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
export interface ToolGetByIDResponse {
|
|
557
|
+
data: ToolGetByIDResponse.Data;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
export namespace ToolGetByIDResponse {
|
|
561
|
+
export interface Data {
|
|
562
|
+
id: string;
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* The agent the tool is scoped to; null for the project
|
|
566
|
+
*/
|
|
567
|
+
agentId: string | null;
|
|
568
|
+
|
|
569
|
+
createdAt: string;
|
|
570
|
+
|
|
571
|
+
description: string | null;
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* How it should handle the result, for grading
|
|
575
|
+
*/
|
|
576
|
+
expectedResult: string | null;
|
|
577
|
+
|
|
578
|
+
inputs: Array<Data.Input>;
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* When the agent should call it, for grading
|
|
582
|
+
*/
|
|
583
|
+
invocationCriteria: string | null;
|
|
584
|
+
|
|
585
|
+
name: string;
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* What a hosted agent sends and says when it calls the tool
|
|
589
|
+
*/
|
|
590
|
+
runtime: Data.Runtime | null;
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* SYSTEM for a built-in tool every project can attach
|
|
594
|
+
*/
|
|
595
|
+
source: 'CUSTOM' | 'SYSTEM';
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* The stable key of a built-in tool, such as dtmf
|
|
599
|
+
*/
|
|
600
|
+
systemKey: string | null;
|
|
601
|
+
|
|
602
|
+
updatedAt: string;
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* The latest version; null before any is declared
|
|
606
|
+
*/
|
|
607
|
+
version: number | null;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
export namespace Data {
|
|
611
|
+
export interface Input {
|
|
612
|
+
/**
|
|
613
|
+
* What the input is, so the agent fills it in right
|
|
614
|
+
*/
|
|
615
|
+
description: string | null;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* The input name, as the agent passes it
|
|
619
|
+
*/
|
|
620
|
+
name: string;
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* The agent must pass it
|
|
624
|
+
*/
|
|
625
|
+
required: boolean;
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* string, number or boolean
|
|
629
|
+
*/
|
|
630
|
+
type: 'string' | 'number' | 'boolean';
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* What a hosted agent sends and says when it calls the tool
|
|
635
|
+
*/
|
|
636
|
+
export interface Runtime {
|
|
637
|
+
/**
|
|
638
|
+
* The tool books, cancels or sends something: its call is not abandoned when the
|
|
639
|
+
* caller interrupts, and each request carries an Idempotency-Key.
|
|
640
|
+
*/
|
|
641
|
+
changesData: boolean;
|
|
642
|
+
|
|
643
|
+
messages: Runtime.Messages;
|
|
644
|
+
|
|
645
|
+
request: Runtime.Request;
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Dot paths into the JSON response the agent is given. Null gives it the whole
|
|
649
|
+
* response.
|
|
650
|
+
*/
|
|
651
|
+
responseFields: Array<string> | null;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
export namespace Runtime {
|
|
655
|
+
export interface Messages {
|
|
656
|
+
/**
|
|
657
|
+
* Said as the request goes out
|
|
658
|
+
*/
|
|
659
|
+
before: string | null;
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Given to the agent to say when the request fails
|
|
663
|
+
*/
|
|
664
|
+
failure: string | null;
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Said once if the request is slow
|
|
668
|
+
*/
|
|
669
|
+
slow: string | null;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
export interface Request {
|
|
673
|
+
/**
|
|
674
|
+
* JSON body template. Null sends the inputs as the body (POST, PUT, PATCH) or the
|
|
675
|
+
* query (GET, DELETE).
|
|
676
|
+
*/
|
|
677
|
+
body: string | null;
|
|
678
|
+
|
|
679
|
+
headers: Array<Request.Header>;
|
|
680
|
+
|
|
681
|
+
method: 'POST' | 'PUT' | 'PATCH' | 'GET' | 'DELETE';
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* How long the agent waits, 1000 to 30000 ms
|
|
685
|
+
*/
|
|
686
|
+
timeoutMs: number | null;
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* https URL. Placeholders {{args.<input>}} and {{conversation.\*}} (id, direction,
|
|
690
|
+
* modality, agentNumber, customerNumber, startedAt) may appear in the path and
|
|
691
|
+
* query.
|
|
692
|
+
*/
|
|
693
|
+
url: string;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
export namespace Request {
|
|
697
|
+
export interface Header {
|
|
698
|
+
name: string;
|
|
699
|
+
|
|
700
|
+
value: string;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
export interface ToolCreateParams {
|
|
708
|
+
/**
|
|
709
|
+
* When the agent should use the tool
|
|
710
|
+
*/
|
|
711
|
+
description: string;
|
|
712
|
+
|
|
713
|
+
name: string;
|
|
714
|
+
|
|
715
|
+
agentId?: string | null;
|
|
716
|
+
|
|
717
|
+
expectedResult?: string | null;
|
|
718
|
+
|
|
719
|
+
inputs?: Array<ToolCreateParams.Input>;
|
|
720
|
+
|
|
721
|
+
invocationCriteria?: string | null;
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Omit or null for a tool that is only graded
|
|
725
|
+
*/
|
|
726
|
+
runtime?: ToolCreateParams.Runtime | null;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
export namespace ToolCreateParams {
|
|
730
|
+
export interface Input {
|
|
731
|
+
name: string;
|
|
732
|
+
|
|
733
|
+
type: 'string' | 'number' | 'boolean';
|
|
734
|
+
|
|
735
|
+
description?: string;
|
|
736
|
+
|
|
737
|
+
required?: boolean;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Omit or null for a tool that is only graded
|
|
742
|
+
*/
|
|
743
|
+
export interface Runtime {
|
|
744
|
+
request: Runtime.Request;
|
|
745
|
+
|
|
746
|
+
changesData?: boolean;
|
|
747
|
+
|
|
748
|
+
messages?: Runtime.Messages;
|
|
749
|
+
|
|
750
|
+
responseFields?: Array<string> | null;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
export namespace Runtime {
|
|
754
|
+
export interface Request {
|
|
755
|
+
url: string;
|
|
756
|
+
|
|
757
|
+
body?: string | null;
|
|
758
|
+
|
|
759
|
+
headers?: Array<Request.Header>;
|
|
760
|
+
|
|
761
|
+
method?: 'POST' | 'PUT' | 'PATCH' | 'GET' | 'DELETE';
|
|
762
|
+
|
|
763
|
+
timeoutMs?: number | null;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
export namespace Request {
|
|
767
|
+
export interface Header {
|
|
768
|
+
name: string;
|
|
769
|
+
|
|
770
|
+
value: string;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
export interface Messages {
|
|
775
|
+
before?: string | null;
|
|
776
|
+
|
|
777
|
+
failure?: string | null;
|
|
778
|
+
|
|
779
|
+
slow?: string | null;
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
export interface ToolUpdateParams {
|
|
785
|
+
/**
|
|
786
|
+
* When the agent should use the tool
|
|
787
|
+
*/
|
|
788
|
+
description: string;
|
|
789
|
+
|
|
790
|
+
name: string;
|
|
791
|
+
|
|
792
|
+
agentId?: string | null;
|
|
793
|
+
|
|
794
|
+
expectedResult?: string | null;
|
|
795
|
+
|
|
796
|
+
inputs?: Array<ToolUpdateParams.Input>;
|
|
797
|
+
|
|
798
|
+
invocationCriteria?: string | null;
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Omit or null for a tool that is only graded
|
|
802
|
+
*/
|
|
803
|
+
runtime?: ToolUpdateParams.Runtime | null;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
export namespace ToolUpdateParams {
|
|
807
|
+
export interface Input {
|
|
808
|
+
name: string;
|
|
809
|
+
|
|
810
|
+
type: 'string' | 'number' | 'boolean';
|
|
811
|
+
|
|
812
|
+
description?: string;
|
|
813
|
+
|
|
814
|
+
required?: boolean;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* Omit or null for a tool that is only graded
|
|
819
|
+
*/
|
|
820
|
+
export interface Runtime {
|
|
821
|
+
request: Runtime.Request;
|
|
822
|
+
|
|
823
|
+
changesData?: boolean;
|
|
824
|
+
|
|
825
|
+
messages?: Runtime.Messages;
|
|
826
|
+
|
|
827
|
+
responseFields?: Array<string> | null;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
export namespace Runtime {
|
|
831
|
+
export interface Request {
|
|
832
|
+
url: string;
|
|
833
|
+
|
|
834
|
+
body?: string | null;
|
|
835
|
+
|
|
836
|
+
headers?: Array<Request.Header>;
|
|
837
|
+
|
|
838
|
+
method?: 'POST' | 'PUT' | 'PATCH' | 'GET' | 'DELETE';
|
|
839
|
+
|
|
840
|
+
timeoutMs?: number | null;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
export namespace Request {
|
|
844
|
+
export interface Header {
|
|
845
|
+
name: string;
|
|
846
|
+
|
|
847
|
+
value: string;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
export interface Messages {
|
|
852
|
+
before?: string | null;
|
|
853
|
+
|
|
854
|
+
failure?: string | null;
|
|
855
|
+
|
|
856
|
+
slow?: string | null;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
export interface ToolListParams {
|
|
862
|
+
/**
|
|
863
|
+
* Only tools scoped to this agent
|
|
864
|
+
*/
|
|
865
|
+
agentId?: string;
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Include the built-in tools (default true)
|
|
869
|
+
*/
|
|
870
|
+
includeBuiltIn?: 'true' | 'false';
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
export declare namespace Tool {
|
|
874
|
+
export {
|
|
875
|
+
type ToolCreateResponse as ToolCreateResponse,
|
|
876
|
+
type ToolUpdateResponse as ToolUpdateResponse,
|
|
877
|
+
type ToolListResponse as ToolListResponse,
|
|
878
|
+
type ToolDeleteResponse as ToolDeleteResponse,
|
|
879
|
+
type ToolGetByIDResponse as ToolGetByIDResponse,
|
|
880
|
+
type ToolCreateParams as ToolCreateParams,
|
|
881
|
+
type ToolUpdateParams as ToolUpdateParams,
|
|
882
|
+
type ToolListParams as ToolListParams,
|
|
883
|
+
};
|
|
884
|
+
}
|