@roarkanalytics/sdk 2.24.0 → 2.25.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 +8 -0
- package/client.d.mts +8 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -2
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +7 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +3 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -1
- 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 +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/metric-collection-job.d.mts +237 -0
- package/resources/metric-collection-job.d.mts.map +1 -0
- package/resources/metric-collection-job.d.ts +237 -0
- package/resources/metric-collection-job.d.ts.map +1 -0
- package/resources/metric-collection-job.js +29 -0
- package/resources/metric-collection-job.js.map +1 -0
- package/resources/metric-collection-job.mjs +25 -0
- package/resources/metric-collection-job.mjs.map +1 -0
- package/resources/metric-policy.d.mts +502 -0
- package/resources/metric-policy.d.mts.map +1 -0
- package/resources/metric-policy.d.ts +502 -0
- package/resources/metric-policy.d.ts.map +1 -0
- package/resources/metric-policy.js +76 -0
- package/resources/metric-policy.js.map +1 -0
- package/resources/metric-policy.mjs +72 -0
- package/resources/metric-policy.mjs.map +1 -0
- package/resources/metric.d.mts +187 -1
- package/resources/metric.d.mts.map +1 -1
- package/resources/metric.d.ts +187 -1
- package/resources/metric.d.ts.map +1 -1
- package/resources/metric.js +21 -0
- package/resources/metric.js.map +1 -1
- package/resources/metric.mjs +21 -0
- package/resources/metric.mjs.map +1 -1
- package/resources/simulation-job.d.mts +2 -2
- package/resources/simulation-job.d.mts.map +1 -1
- package/resources/simulation-job.d.ts +2 -2
- package/resources/simulation-job.d.ts.map +1 -1
- package/resources/simulation-persona.d.mts +6 -6
- package/resources/simulation-persona.d.mts.map +1 -1
- package/resources/simulation-persona.d.ts +6 -6
- package/resources/simulation-persona.d.ts.map +1 -1
- package/resources/simulation-run-plan-job.d.mts +1 -1
- package/resources/simulation-run-plan-job.d.mts.map +1 -1
- package/resources/simulation-run-plan-job.d.ts +1 -1
- package/resources/simulation-run-plan-job.d.ts.map +1 -1
- package/src/client.ts +56 -2
- package/src/resources/index.ts +25 -1
- package/src/resources/metric-collection-job.ts +307 -0
- package/src/resources/metric-policy.ts +679 -0
- package/src/resources/metric.ts +232 -1
- package/src/resources/simulation-job.ts +2 -2
- package/src/resources/simulation-persona.ts +6 -6
- package/src/resources/simulation-run-plan-job.ts +1 -1
- 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
package/src/resources/metric.ts
CHANGED
|
@@ -5,16 +5,112 @@ import { APIPromise } from '../core/api-promise';
|
|
|
5
5
|
import { RequestOptions } from '../internal/request-options';
|
|
6
6
|
|
|
7
7
|
export class Metric extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Create a new custom metric definition. The metric will be added to the specified
|
|
10
|
+
* analysis package and can be used for evaluating calls.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const response = await client.metric.createDefinition({
|
|
15
|
+
* analysisPackageId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
16
|
+
* name: 'Customer Satisfaction',
|
|
17
|
+
* outputType: 'BOOLEAN',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
createDefinition(
|
|
22
|
+
body: MetricCreateDefinitionParams,
|
|
23
|
+
options?: RequestOptions,
|
|
24
|
+
): APIPromise<MetricCreateDefinitionResponse> {
|
|
25
|
+
return this._client.post('/v1/metric/definitions', { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
8
28
|
/**
|
|
9
29
|
* Fetch all metric definitions available in the project, including both
|
|
10
30
|
* system-generated and custom metrics. Only returns metrics from enabled analysis
|
|
11
31
|
* packages.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const response = await client.metric.listDefinitions();
|
|
36
|
+
* ```
|
|
12
37
|
*/
|
|
13
38
|
listDefinitions(options?: RequestOptions): APIPromise<MetricListDefinitionsResponse> {
|
|
14
39
|
return this._client.get('/v1/metric/definitions', options);
|
|
15
40
|
}
|
|
16
41
|
}
|
|
17
42
|
|
|
43
|
+
export interface MetricCreateDefinitionResponse {
|
|
44
|
+
/**
|
|
45
|
+
* Metric definition data
|
|
46
|
+
*/
|
|
47
|
+
data: MetricCreateDefinitionResponse.Data;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export namespace MetricCreateDefinitionResponse {
|
|
51
|
+
/**
|
|
52
|
+
* Metric definition data
|
|
53
|
+
*/
|
|
54
|
+
export interface Data {
|
|
55
|
+
/**
|
|
56
|
+
* Unique identifier for the metric definition
|
|
57
|
+
*/
|
|
58
|
+
id: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Description of what the metric measures
|
|
62
|
+
*/
|
|
63
|
+
description: string;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Stable metric identifier (e.g. "call_reason", "customer_satisfaction")
|
|
67
|
+
*/
|
|
68
|
+
metricId: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Name of the metric
|
|
72
|
+
*/
|
|
73
|
+
name: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Whether metric is global or per-participant
|
|
77
|
+
*/
|
|
78
|
+
scope: 'GLOBAL' | 'PER_PARTICIPANT';
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Which levels this metric can produce values at
|
|
82
|
+
*/
|
|
83
|
+
supportedContexts: Array<'CALL' | 'SEGMENT' | 'TURN'>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Type of value this metric produces
|
|
87
|
+
*/
|
|
88
|
+
type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET';
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Unit information if applicable
|
|
92
|
+
*/
|
|
93
|
+
unit?: Data.Unit;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export namespace Data {
|
|
97
|
+
/**
|
|
98
|
+
* Unit information if applicable
|
|
99
|
+
*/
|
|
100
|
+
export interface Unit {
|
|
101
|
+
/**
|
|
102
|
+
* Name of the unit
|
|
103
|
+
*/
|
|
104
|
+
name: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Symbol for the unit
|
|
108
|
+
*/
|
|
109
|
+
symbol: string | null;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
18
114
|
export interface MetricListDefinitionsResponse {
|
|
19
115
|
/**
|
|
20
116
|
* Metrics response payload
|
|
@@ -86,6 +182,141 @@ export namespace MetricListDefinitionsResponse {
|
|
|
86
182
|
}
|
|
87
183
|
}
|
|
88
184
|
|
|
185
|
+
export interface MetricCreateDefinitionParams {
|
|
186
|
+
/**
|
|
187
|
+
* ID of the analysis package to add this metric to
|
|
188
|
+
*/
|
|
189
|
+
analysisPackageId: string;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Name of the metric
|
|
193
|
+
*/
|
|
194
|
+
name: string;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Type of value this metric produces
|
|
198
|
+
*/
|
|
199
|
+
outputType: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET';
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Label for the false/negative case (only for BOOLEAN type)
|
|
203
|
+
*/
|
|
204
|
+
booleanFalseLabel?: string;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Label for the true/positive case (only for BOOLEAN type)
|
|
208
|
+
*/
|
|
209
|
+
booleanTrueLabel?: string;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Options for classification. Required for CLASSIFICATION type.
|
|
213
|
+
*/
|
|
214
|
+
classificationOptions?: Array<MetricCreateDefinitionParams.ClassificationOption>;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* LLM prompt/criteria for evaluating this metric. Used to instruct the model on
|
|
218
|
+
* how to score. Required for BOOLEAN, NUMERIC, TEXT, and SCALE types.
|
|
219
|
+
*/
|
|
220
|
+
llmPrompt?: string;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Maximum number of classifications that can be selected (only for CLASSIFICATION
|
|
224
|
+
* type)
|
|
225
|
+
*/
|
|
226
|
+
maxClassifications?: number;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Unique identifier for the metric (e.g. "customer_satisfaction"). Auto-generated
|
|
230
|
+
* from name if not provided.
|
|
231
|
+
*/
|
|
232
|
+
metricId?: string;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Participant role to evaluate. Required when scope is PER_PARTICIPANT.
|
|
236
|
+
*/
|
|
237
|
+
participantRole?: 'AGENT' | 'CUSTOMER' | 'SIMULATED_CUSTOMER' | 'BACKGROUND_SPEAKER';
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Labels for scale ranges (only for SCALE type)
|
|
241
|
+
*/
|
|
242
|
+
scaleLabels?: Array<MetricCreateDefinitionParams.ScaleLabel>;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Maximum value for scale. Required for SCALE type.
|
|
246
|
+
*/
|
|
247
|
+
scaleMax?: number;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Minimum value for scale. Required for SCALE type.
|
|
251
|
+
*/
|
|
252
|
+
scaleMin?: number;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Whether metric is global or per-participant (default: GLOBAL)
|
|
256
|
+
*/
|
|
257
|
+
scope?: 'GLOBAL' | 'PER_PARTICIPANT';
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Which levels this metric can produce values at (default: ["CALL"])
|
|
261
|
+
*/
|
|
262
|
+
supportedContexts?: Array<'CALL' | 'SEGMENT' | 'TURN'>;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export namespace MetricCreateDefinitionParams {
|
|
266
|
+
export interface ClassificationOption {
|
|
267
|
+
/**
|
|
268
|
+
* Description of what this option means
|
|
269
|
+
*/
|
|
270
|
+
description: string;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Display order of this option
|
|
274
|
+
*/
|
|
275
|
+
displayOrder: number;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Label for this classification option
|
|
279
|
+
*/
|
|
280
|
+
label: string;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export interface ScaleLabel {
|
|
284
|
+
/**
|
|
285
|
+
* Display order of this label
|
|
286
|
+
*/
|
|
287
|
+
displayOrder: number;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Label for this range
|
|
291
|
+
*/
|
|
292
|
+
label: string;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Maximum value for this label range
|
|
296
|
+
*/
|
|
297
|
+
rangeMax: number;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Minimum value for this label range
|
|
301
|
+
*/
|
|
302
|
+
rangeMin: number;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Hex color code for this label (e.g. "#FF0000")
|
|
306
|
+
*/
|
|
307
|
+
colorHex?: string;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Description of what this range means
|
|
311
|
+
*/
|
|
312
|
+
description?: string;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
89
316
|
export declare namespace Metric {
|
|
90
|
-
export {
|
|
317
|
+
export {
|
|
318
|
+
type MetricCreateDefinitionResponse as MetricCreateDefinitionResponse,
|
|
319
|
+
type MetricListDefinitionsResponse as MetricListDefinitionsResponse,
|
|
320
|
+
type MetricCreateDefinitionParams as MetricCreateDefinitionParams,
|
|
321
|
+
};
|
|
91
322
|
}
|
|
@@ -191,7 +191,7 @@ export namespace SimulationJobGetByIDResponse {
|
|
|
191
191
|
/**
|
|
192
192
|
* Gender of the persona
|
|
193
193
|
*/
|
|
194
|
-
gender: 'MALE' | 'FEMALE'
|
|
194
|
+
gender: 'MALE' | 'FEMALE';
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
197
|
* Whether the persona uses filler words like "um" and "uh"
|
|
@@ -428,7 +428,7 @@ export namespace SimulationJobLookupResponse {
|
|
|
428
428
|
/**
|
|
429
429
|
* Gender of the persona
|
|
430
430
|
*/
|
|
431
|
-
gender: 'MALE' | 'FEMALE'
|
|
431
|
+
gender: 'MALE' | 'FEMALE';
|
|
432
432
|
|
|
433
433
|
/**
|
|
434
434
|
* Whether the persona uses filler words like "um" and "uh"
|
|
@@ -138,7 +138,7 @@ export namespace SimulationPersonaCreateResponse {
|
|
|
138
138
|
/**
|
|
139
139
|
* Gender of the persona
|
|
140
140
|
*/
|
|
141
|
-
gender: 'MALE' | 'FEMALE'
|
|
141
|
+
gender: 'MALE' | 'FEMALE';
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
144
|
* Whether the persona uses filler words like "um" and "uh"
|
|
@@ -271,7 +271,7 @@ export namespace SimulationPersonaUpdateResponse {
|
|
|
271
271
|
/**
|
|
272
272
|
* Gender of the persona
|
|
273
273
|
*/
|
|
274
|
-
gender: 'MALE' | 'FEMALE'
|
|
274
|
+
gender: 'MALE' | 'FEMALE';
|
|
275
275
|
|
|
276
276
|
/**
|
|
277
277
|
* Whether the persona uses filler words like "um" and "uh"
|
|
@@ -406,7 +406,7 @@ export namespace SimulationPersonaListResponse {
|
|
|
406
406
|
/**
|
|
407
407
|
* Gender of the persona
|
|
408
408
|
*/
|
|
409
|
-
gender: 'MALE' | 'FEMALE'
|
|
409
|
+
gender: 'MALE' | 'FEMALE';
|
|
410
410
|
|
|
411
411
|
/**
|
|
412
412
|
* Whether the persona uses filler words like "um" and "uh"
|
|
@@ -556,7 +556,7 @@ export namespace SimulationPersonaGetByIDResponse {
|
|
|
556
556
|
/**
|
|
557
557
|
* Gender of the persona
|
|
558
558
|
*/
|
|
559
|
-
gender: 'MALE' | 'FEMALE'
|
|
559
|
+
gender: 'MALE' | 'FEMALE';
|
|
560
560
|
|
|
561
561
|
/**
|
|
562
562
|
* Whether the persona uses filler words like "um" and "uh"
|
|
@@ -651,7 +651,7 @@ export interface SimulationPersonaCreateParams {
|
|
|
651
651
|
/**
|
|
652
652
|
* Gender of the persona
|
|
653
653
|
*/
|
|
654
|
-
gender: 'MALE' | 'FEMALE'
|
|
654
|
+
gender: 'MALE' | 'FEMALE';
|
|
655
655
|
|
|
656
656
|
/**
|
|
657
657
|
* Primary language ISO 639-1 code for the persona
|
|
@@ -796,7 +796,7 @@ export interface SimulationPersonaUpdateParams {
|
|
|
796
796
|
/**
|
|
797
797
|
* Gender of the persona
|
|
798
798
|
*/
|
|
799
|
-
gender?: 'MALE' | 'FEMALE'
|
|
799
|
+
gender?: 'MALE' | 'FEMALE';
|
|
800
800
|
|
|
801
801
|
/**
|
|
802
802
|
* Whether the persona uses filler words like "um" and "uh"
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.25.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.25.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.25.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.25.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|