@roarkanalytics/sdk 5.7.0 → 5.9.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 +26 -0
- package/client.d.mts +9 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +9 -0
- package/client.d.ts.map +1 -1
- package/client.js +9 -0
- package/client.js.map +1 -1
- package/client.mjs +9 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/analytics.d.mts +354 -0
- package/resources/analytics.d.mts.map +1 -0
- package/resources/analytics.d.ts +354 -0
- package/resources/analytics.d.ts.map +1 -0
- package/resources/analytics.js +55 -0
- package/resources/analytics.js.map +1 -0
- package/resources/analytics.mjs +51 -0
- package/resources/analytics.mjs.map +1 -0
- package/resources/config.d.mts +626 -14
- package/resources/config.d.mts.map +1 -1
- package/resources/config.d.ts +626 -14
- package/resources/config.d.ts.map +1 -1
- package/resources/dashboard.d.mts +2280 -0
- package/resources/dashboard.d.mts.map +1 -0
- package/resources/dashboard.d.ts +2280 -0
- package/resources/dashboard.d.ts.map +1 -0
- package/resources/dashboard.js +170 -0
- package/resources/dashboard.js.map +1 -0
- package/resources/dashboard.mjs +166 -0
- package/resources/dashboard.mjs.map +1 -0
- package/resources/index.d.mts +3 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/metric-policy.d.mts +311 -2
- package/resources/metric-policy.d.mts.map +1 -1
- package/resources/metric-policy.d.ts +311 -2
- package/resources/metric-policy.d.ts.map +1 -1
- package/resources/usage.d.mts +114 -0
- package/resources/usage.d.mts.map +1 -0
- package/resources/usage.d.ts +114 -0
- package/resources/usage.d.ts.map +1 -0
- package/resources/usage.js +27 -0
- package/resources/usage.js.map +1 -0
- package/resources/usage.mjs +23 -0
- package/resources/usage.mjs.map +1 -0
- package/src/client.ts +63 -0
- package/src/resources/analytics.ts +573 -0
- package/src/resources/config.ts +1498 -26
- package/src/resources/dashboard.ts +3752 -0
- package/src/resources/index.ts +27 -0
- package/src/resources/metric-policy.ts +353 -2
- package/src/resources/usage.ts +147 -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
package/src/resources/index.ts
CHANGED
|
@@ -42,6 +42,12 @@ export {
|
|
|
42
42
|
type AgentPromptUpdateParams,
|
|
43
43
|
type AgentPromptListVersionsParams,
|
|
44
44
|
} from './agent-prompt';
|
|
45
|
+
export {
|
|
46
|
+
Analytics,
|
|
47
|
+
type AnalyticsGetSchemaResponse,
|
|
48
|
+
type AnalyticsQueryResponse,
|
|
49
|
+
type AnalyticsQueryParams,
|
|
50
|
+
} from './analytics';
|
|
45
51
|
export {
|
|
46
52
|
AutoimproveJob,
|
|
47
53
|
type AutoimproveLogEntry,
|
|
@@ -126,6 +132,26 @@ export {
|
|
|
126
132
|
type CustomerFlowEdgeCasePromoteParams,
|
|
127
133
|
type CustomerFlowEdgeCaseRemoveParams,
|
|
128
134
|
} from './customer-flow-edge-case';
|
|
135
|
+
export {
|
|
136
|
+
Dashboard,
|
|
137
|
+
type DashboardCreateResponse,
|
|
138
|
+
type DashboardUpdateResponse,
|
|
139
|
+
type DashboardListResponse,
|
|
140
|
+
type DashboardDeleteResponse,
|
|
141
|
+
type DashboardCreateWidgetResponse,
|
|
142
|
+
type DashboardDeleteWidgetResponse,
|
|
143
|
+
type DashboardGetByIDResponse,
|
|
144
|
+
type DashboardGetDataResponse,
|
|
145
|
+
type DashboardGetWidgetDataResponse,
|
|
146
|
+
type DashboardUpdateWidgetResponse,
|
|
147
|
+
type DashboardCreateParams,
|
|
148
|
+
type DashboardUpdateParams,
|
|
149
|
+
type DashboardCreateWidgetParams,
|
|
150
|
+
type DashboardDeleteWidgetParams,
|
|
151
|
+
type DashboardGetDataParams,
|
|
152
|
+
type DashboardGetWidgetDataParams,
|
|
153
|
+
type DashboardUpdateWidgetParams,
|
|
154
|
+
} from './dashboard';
|
|
129
155
|
export {
|
|
130
156
|
HTTPRequestDefinition,
|
|
131
157
|
type HTTPRequestDefinitionCreateResponse,
|
|
@@ -279,6 +305,7 @@ export {
|
|
|
279
305
|
type SimulationToolFixtureUpdateParams,
|
|
280
306
|
type SimulationToolFixtureListParams,
|
|
281
307
|
} from './simulation-tool-fixture';
|
|
308
|
+
export { Usage, type UsageGetResponse, type UsageGetParams } from './usage';
|
|
282
309
|
export {
|
|
283
310
|
Webhook,
|
|
284
311
|
type WebhookCreateResponse,
|
|
@@ -181,6 +181,63 @@ export namespace MetricPolicyCreateResponse {
|
|
|
181
181
|
|
|
182
182
|
export interface Metric {
|
|
183
183
|
id: string;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The metric's per-collector setting. A metric takes at most one field, and which
|
|
187
|
+
* one depends on the metric: verifiedProperties for Property Verification,
|
|
188
|
+
* excludedPhrases for voice consistency, voicemailScript for voicemail,
|
|
189
|
+
* screeningBrief for call screening, toolDefinitionIds for tool invocation,
|
|
190
|
+
* knowledgeBaseDocumentIds for knowledge grounding. A field the metric doesn't
|
|
191
|
+
* take is rejected with a 400.
|
|
192
|
+
*/
|
|
193
|
+
settings: Metric.Settings | null;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export namespace Metric {
|
|
197
|
+
/**
|
|
198
|
+
* The metric's per-collector setting. A metric takes at most one field, and which
|
|
199
|
+
* one depends on the metric: verifiedProperties for Property Verification,
|
|
200
|
+
* excludedPhrases for voice consistency, voicemailScript for voicemail,
|
|
201
|
+
* screeningBrief for call screening, toolDefinitionIds for tool invocation,
|
|
202
|
+
* knowledgeBaseDocumentIds for knowledge grounding. A field the metric doesn't
|
|
203
|
+
* take is rejected with a 400.
|
|
204
|
+
*/
|
|
205
|
+
export interface Settings {
|
|
206
|
+
/**
|
|
207
|
+
* Voice consistency metrics: phrases whose agent lines are not judged, such as a
|
|
208
|
+
* recorded prompt in a different voice.
|
|
209
|
+
*/
|
|
210
|
+
excludedPhrases?: Array<string>;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Knowledge grounding metrics: the knowledge base documents to ground against, in
|
|
214
|
+
* priority order. Empty or omitted uses every knowledge base in the project.
|
|
215
|
+
*/
|
|
216
|
+
knowledgeBaseDocumentIds?: Array<string>;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Call screening metrics: what the agent should say when a screener asks who is
|
|
220
|
+
* calling and why.
|
|
221
|
+
*/
|
|
222
|
+
screeningBrief?: string;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Tool invocation metrics: the tool definitions to score. Empty or omitted scores
|
|
226
|
+
* every tool the agent has.
|
|
227
|
+
*/
|
|
228
|
+
toolDefinitionIds?: Array<string>;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Property Verification metrics: the conversation properties to check against the
|
|
232
|
+
* transcript. Empty or omitted checks every custom property.
|
|
233
|
+
*/
|
|
234
|
+
verifiedProperties?: Array<string>;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Voicemail metrics: the message the agent is expected to leave on voicemail.
|
|
238
|
+
*/
|
|
239
|
+
voicemailScript?: string;
|
|
240
|
+
}
|
|
184
241
|
}
|
|
185
242
|
}
|
|
186
243
|
}
|
|
@@ -280,6 +337,63 @@ export namespace MetricPolicyUpdateResponse {
|
|
|
280
337
|
|
|
281
338
|
export interface Metric {
|
|
282
339
|
id: string;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* The metric's per-collector setting. A metric takes at most one field, and which
|
|
343
|
+
* one depends on the metric: verifiedProperties for Property Verification,
|
|
344
|
+
* excludedPhrases for voice consistency, voicemailScript for voicemail,
|
|
345
|
+
* screeningBrief for call screening, toolDefinitionIds for tool invocation,
|
|
346
|
+
* knowledgeBaseDocumentIds for knowledge grounding. A field the metric doesn't
|
|
347
|
+
* take is rejected with a 400.
|
|
348
|
+
*/
|
|
349
|
+
settings: Metric.Settings | null;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export namespace Metric {
|
|
353
|
+
/**
|
|
354
|
+
* The metric's per-collector setting. A metric takes at most one field, and which
|
|
355
|
+
* one depends on the metric: verifiedProperties for Property Verification,
|
|
356
|
+
* excludedPhrases for voice consistency, voicemailScript for voicemail,
|
|
357
|
+
* screeningBrief for call screening, toolDefinitionIds for tool invocation,
|
|
358
|
+
* knowledgeBaseDocumentIds for knowledge grounding. A field the metric doesn't
|
|
359
|
+
* take is rejected with a 400.
|
|
360
|
+
*/
|
|
361
|
+
export interface Settings {
|
|
362
|
+
/**
|
|
363
|
+
* Voice consistency metrics: phrases whose agent lines are not judged, such as a
|
|
364
|
+
* recorded prompt in a different voice.
|
|
365
|
+
*/
|
|
366
|
+
excludedPhrases?: Array<string>;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Knowledge grounding metrics: the knowledge base documents to ground against, in
|
|
370
|
+
* priority order. Empty or omitted uses every knowledge base in the project.
|
|
371
|
+
*/
|
|
372
|
+
knowledgeBaseDocumentIds?: Array<string>;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Call screening metrics: what the agent should say when a screener asks who is
|
|
376
|
+
* calling and why.
|
|
377
|
+
*/
|
|
378
|
+
screeningBrief?: string;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Tool invocation metrics: the tool definitions to score. Empty or omitted scores
|
|
382
|
+
* every tool the agent has.
|
|
383
|
+
*/
|
|
384
|
+
toolDefinitionIds?: Array<string>;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Property Verification metrics: the conversation properties to check against the
|
|
388
|
+
* transcript. Empty or omitted checks every custom property.
|
|
389
|
+
*/
|
|
390
|
+
verifiedProperties?: Array<string>;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Voicemail metrics: the message the agent is expected to leave on voicemail.
|
|
394
|
+
*/
|
|
395
|
+
voicemailScript?: string;
|
|
396
|
+
}
|
|
283
397
|
}
|
|
284
398
|
}
|
|
285
399
|
}
|
|
@@ -381,6 +495,63 @@ export namespace MetricPolicyListResponse {
|
|
|
381
495
|
|
|
382
496
|
export interface Metric {
|
|
383
497
|
id: string;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* The metric's per-collector setting. A metric takes at most one field, and which
|
|
501
|
+
* one depends on the metric: verifiedProperties for Property Verification,
|
|
502
|
+
* excludedPhrases for voice consistency, voicemailScript for voicemail,
|
|
503
|
+
* screeningBrief for call screening, toolDefinitionIds for tool invocation,
|
|
504
|
+
* knowledgeBaseDocumentIds for knowledge grounding. A field the metric doesn't
|
|
505
|
+
* take is rejected with a 400.
|
|
506
|
+
*/
|
|
507
|
+
settings: Metric.Settings | null;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export namespace Metric {
|
|
511
|
+
/**
|
|
512
|
+
* The metric's per-collector setting. A metric takes at most one field, and which
|
|
513
|
+
* one depends on the metric: verifiedProperties for Property Verification,
|
|
514
|
+
* excludedPhrases for voice consistency, voicemailScript for voicemail,
|
|
515
|
+
* screeningBrief for call screening, toolDefinitionIds for tool invocation,
|
|
516
|
+
* knowledgeBaseDocumentIds for knowledge grounding. A field the metric doesn't
|
|
517
|
+
* take is rejected with a 400.
|
|
518
|
+
*/
|
|
519
|
+
export interface Settings {
|
|
520
|
+
/**
|
|
521
|
+
* Voice consistency metrics: phrases whose agent lines are not judged, such as a
|
|
522
|
+
* recorded prompt in a different voice.
|
|
523
|
+
*/
|
|
524
|
+
excludedPhrases?: Array<string>;
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Knowledge grounding metrics: the knowledge base documents to ground against, in
|
|
528
|
+
* priority order. Empty or omitted uses every knowledge base in the project.
|
|
529
|
+
*/
|
|
530
|
+
knowledgeBaseDocumentIds?: Array<string>;
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Call screening metrics: what the agent should say when a screener asks who is
|
|
534
|
+
* calling and why.
|
|
535
|
+
*/
|
|
536
|
+
screeningBrief?: string;
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Tool invocation metrics: the tool definitions to score. Empty or omitted scores
|
|
540
|
+
* every tool the agent has.
|
|
541
|
+
*/
|
|
542
|
+
toolDefinitionIds?: Array<string>;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Property Verification metrics: the conversation properties to check against the
|
|
546
|
+
* transcript. Empty or omitted checks every custom property.
|
|
547
|
+
*/
|
|
548
|
+
verifiedProperties?: Array<string>;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Voicemail metrics: the message the agent is expected to leave on voicemail.
|
|
552
|
+
*/
|
|
553
|
+
voicemailScript?: string;
|
|
554
|
+
}
|
|
384
555
|
}
|
|
385
556
|
}
|
|
386
557
|
|
|
@@ -510,13 +681,71 @@ export namespace MetricPolicyGetByIDResponse {
|
|
|
510
681
|
|
|
511
682
|
export interface Metric {
|
|
512
683
|
id: string;
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* The metric's per-collector setting. A metric takes at most one field, and which
|
|
687
|
+
* one depends on the metric: verifiedProperties for Property Verification,
|
|
688
|
+
* excludedPhrases for voice consistency, voicemailScript for voicemail,
|
|
689
|
+
* screeningBrief for call screening, toolDefinitionIds for tool invocation,
|
|
690
|
+
* knowledgeBaseDocumentIds for knowledge grounding. A field the metric doesn't
|
|
691
|
+
* take is rejected with a 400.
|
|
692
|
+
*/
|
|
693
|
+
settings: Metric.Settings | null;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
export namespace Metric {
|
|
697
|
+
/**
|
|
698
|
+
* The metric's per-collector setting. A metric takes at most one field, and which
|
|
699
|
+
* one depends on the metric: verifiedProperties for Property Verification,
|
|
700
|
+
* excludedPhrases for voice consistency, voicemailScript for voicemail,
|
|
701
|
+
* screeningBrief for call screening, toolDefinitionIds for tool invocation,
|
|
702
|
+
* knowledgeBaseDocumentIds for knowledge grounding. A field the metric doesn't
|
|
703
|
+
* take is rejected with a 400.
|
|
704
|
+
*/
|
|
705
|
+
export interface Settings {
|
|
706
|
+
/**
|
|
707
|
+
* Voice consistency metrics: phrases whose agent lines are not judged, such as a
|
|
708
|
+
* recorded prompt in a different voice.
|
|
709
|
+
*/
|
|
710
|
+
excludedPhrases?: Array<string>;
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* Knowledge grounding metrics: the knowledge base documents to ground against, in
|
|
714
|
+
* priority order. Empty or omitted uses every knowledge base in the project.
|
|
715
|
+
*/
|
|
716
|
+
knowledgeBaseDocumentIds?: Array<string>;
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Call screening metrics: what the agent should say when a screener asks who is
|
|
720
|
+
* calling and why.
|
|
721
|
+
*/
|
|
722
|
+
screeningBrief?: string;
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Tool invocation metrics: the tool definitions to score. Empty or omitted scores
|
|
726
|
+
* every tool the agent has.
|
|
727
|
+
*/
|
|
728
|
+
toolDefinitionIds?: Array<string>;
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* Property Verification metrics: the conversation properties to check against the
|
|
732
|
+
* transcript. Empty or omitted checks every custom property.
|
|
733
|
+
*/
|
|
734
|
+
verifiedProperties?: Array<string>;
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* Voicemail metrics: the message the agent is expected to leave on voicemail.
|
|
738
|
+
*/
|
|
739
|
+
voicemailScript?: string;
|
|
740
|
+
}
|
|
513
741
|
}
|
|
514
742
|
}
|
|
515
743
|
}
|
|
516
744
|
|
|
517
745
|
export interface MetricPolicyCreateParams {
|
|
518
746
|
/**
|
|
519
|
-
* Metric definitions to collect when this policy matches
|
|
747
|
+
* Metric definitions to collect when this policy matches, each with an optional
|
|
748
|
+
* setting
|
|
520
749
|
*/
|
|
521
750
|
metrics: Array<MetricPolicyCreateParams.Metric>;
|
|
522
751
|
|
|
@@ -544,7 +773,67 @@ export interface MetricPolicyCreateParams {
|
|
|
544
773
|
|
|
545
774
|
export namespace MetricPolicyCreateParams {
|
|
546
775
|
export interface Metric {
|
|
776
|
+
/**
|
|
777
|
+
* The metric definition to collect
|
|
778
|
+
*/
|
|
547
779
|
id: string;
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* The metric's per-collector setting. A metric takes at most one field, and which
|
|
783
|
+
* one depends on the metric: verifiedProperties for Property Verification,
|
|
784
|
+
* excludedPhrases for voice consistency, voicemailScript for voicemail,
|
|
785
|
+
* screeningBrief for call screening, toolDefinitionIds for tool invocation,
|
|
786
|
+
* knowledgeBaseDocumentIds for knowledge grounding. A field the metric doesn't
|
|
787
|
+
* take is rejected with a 400.
|
|
788
|
+
*/
|
|
789
|
+
settings?: Metric.Settings | null;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
export namespace Metric {
|
|
793
|
+
/**
|
|
794
|
+
* The metric's per-collector setting. A metric takes at most one field, and which
|
|
795
|
+
* one depends on the metric: verifiedProperties for Property Verification,
|
|
796
|
+
* excludedPhrases for voice consistency, voicemailScript for voicemail,
|
|
797
|
+
* screeningBrief for call screening, toolDefinitionIds for tool invocation,
|
|
798
|
+
* knowledgeBaseDocumentIds for knowledge grounding. A field the metric doesn't
|
|
799
|
+
* take is rejected with a 400.
|
|
800
|
+
*/
|
|
801
|
+
export interface Settings {
|
|
802
|
+
/**
|
|
803
|
+
* Voice consistency metrics: phrases whose agent lines are not judged, such as a
|
|
804
|
+
* recorded prompt in a different voice.
|
|
805
|
+
*/
|
|
806
|
+
excludedPhrases?: Array<string>;
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* Knowledge grounding metrics: the knowledge base documents to ground against, in
|
|
810
|
+
* priority order. Empty or omitted uses every knowledge base in the project.
|
|
811
|
+
*/
|
|
812
|
+
knowledgeBaseDocumentIds?: Array<string>;
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* Call screening metrics: what the agent should say when a screener asks who is
|
|
816
|
+
* calling and why.
|
|
817
|
+
*/
|
|
818
|
+
screeningBrief?: string;
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* Tool invocation metrics: the tool definitions to score. Empty or omitted scores
|
|
822
|
+
* every tool the agent has.
|
|
823
|
+
*/
|
|
824
|
+
toolDefinitionIds?: Array<string>;
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Property Verification metrics: the conversation properties to check against the
|
|
828
|
+
* transcript. Empty or omitted checks every custom property.
|
|
829
|
+
*/
|
|
830
|
+
verifiedProperties?: Array<string>;
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Voicemail metrics: the message the agent is expected to leave on voicemail.
|
|
834
|
+
*/
|
|
835
|
+
voicemailScript?: string;
|
|
836
|
+
}
|
|
548
837
|
}
|
|
549
838
|
|
|
550
839
|
export interface Condition {
|
|
@@ -595,7 +884,9 @@ export interface MetricPolicyUpdateParams {
|
|
|
595
884
|
conditions?: Array<MetricPolicyUpdateParams.Condition>;
|
|
596
885
|
|
|
597
886
|
/**
|
|
598
|
-
* Metric definitions to collect when this policy matches
|
|
887
|
+
* Metric definitions to collect when this policy matches. Replaces the policy's
|
|
888
|
+
* whole metric list: a metric sent without settings goes back to its default, so
|
|
889
|
+
* resend a metric's settings to keep them. Omit to keep the current metrics.
|
|
599
890
|
*/
|
|
600
891
|
metrics?: Array<MetricPolicyUpdateParams.Metric>;
|
|
601
892
|
|
|
@@ -651,7 +942,67 @@ export namespace MetricPolicyUpdateParams {
|
|
|
651
942
|
}
|
|
652
943
|
|
|
653
944
|
export interface Metric {
|
|
945
|
+
/**
|
|
946
|
+
* The metric definition to collect
|
|
947
|
+
*/
|
|
654
948
|
id: string;
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* The metric's per-collector setting. A metric takes at most one field, and which
|
|
952
|
+
* one depends on the metric: verifiedProperties for Property Verification,
|
|
953
|
+
* excludedPhrases for voice consistency, voicemailScript for voicemail,
|
|
954
|
+
* screeningBrief for call screening, toolDefinitionIds for tool invocation,
|
|
955
|
+
* knowledgeBaseDocumentIds for knowledge grounding. A field the metric doesn't
|
|
956
|
+
* take is rejected with a 400.
|
|
957
|
+
*/
|
|
958
|
+
settings?: Metric.Settings | null;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
export namespace Metric {
|
|
962
|
+
/**
|
|
963
|
+
* The metric's per-collector setting. A metric takes at most one field, and which
|
|
964
|
+
* one depends on the metric: verifiedProperties for Property Verification,
|
|
965
|
+
* excludedPhrases for voice consistency, voicemailScript for voicemail,
|
|
966
|
+
* screeningBrief for call screening, toolDefinitionIds for tool invocation,
|
|
967
|
+
* knowledgeBaseDocumentIds for knowledge grounding. A field the metric doesn't
|
|
968
|
+
* take is rejected with a 400.
|
|
969
|
+
*/
|
|
970
|
+
export interface Settings {
|
|
971
|
+
/**
|
|
972
|
+
* Voice consistency metrics: phrases whose agent lines are not judged, such as a
|
|
973
|
+
* recorded prompt in a different voice.
|
|
974
|
+
*/
|
|
975
|
+
excludedPhrases?: Array<string>;
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* Knowledge grounding metrics: the knowledge base documents to ground against, in
|
|
979
|
+
* priority order. Empty or omitted uses every knowledge base in the project.
|
|
980
|
+
*/
|
|
981
|
+
knowledgeBaseDocumentIds?: Array<string>;
|
|
982
|
+
|
|
983
|
+
/**
|
|
984
|
+
* Call screening metrics: what the agent should say when a screener asks who is
|
|
985
|
+
* calling and why.
|
|
986
|
+
*/
|
|
987
|
+
screeningBrief?: string;
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* Tool invocation metrics: the tool definitions to score. Empty or omitted scores
|
|
991
|
+
* every tool the agent has.
|
|
992
|
+
*/
|
|
993
|
+
toolDefinitionIds?: Array<string>;
|
|
994
|
+
|
|
995
|
+
/**
|
|
996
|
+
* Property Verification metrics: the conversation properties to check against the
|
|
997
|
+
* transcript. Empty or omitted checks every custom property.
|
|
998
|
+
*/
|
|
999
|
+
verifiedProperties?: Array<string>;
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* Voicemail metrics: the message the agent is expected to leave on voicemail.
|
|
1003
|
+
*/
|
|
1004
|
+
voicemailScript?: string;
|
|
1005
|
+
}
|
|
655
1006
|
}
|
|
656
1007
|
}
|
|
657
1008
|
|
|
@@ -0,0 +1,147 @@
|
|
|
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
|
+
|
|
7
|
+
export class Usage extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Report billable usage and cost for the organization over a time window, broken
|
|
10
|
+
* down by project (highest spend first). Pass `from`/`to` as ISO 8601 timestamps;
|
|
11
|
+
* optionally pass `projectId` to scope the report to one project. Amounts are
|
|
12
|
+
* billable spend only (what we absorb is never included). Authenticated by an
|
|
13
|
+
* organization API key with the `usage:read` permission.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const usage = await client.usage.get({
|
|
18
|
+
* from: '2026-09-01T00:00:00Z',
|
|
19
|
+
* to: '2026-10-01T00:00:00Z',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
get(query: UsageGetParams, options?: RequestOptions): APIPromise<UsageGetResponse> {
|
|
24
|
+
return this._client.get('/v1/usage', { query, ...options });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface UsageGetResponse {
|
|
29
|
+
data: UsageGetResponse.Data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export namespace UsageGetResponse {
|
|
33
|
+
export interface Data {
|
|
34
|
+
currency: 'usd';
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The resolved window start, echoed back as ISO 8601.
|
|
38
|
+
*/
|
|
39
|
+
from: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Per-project billable spend, highest first. Only projects with spend in the
|
|
43
|
+
* window appear.
|
|
44
|
+
*/
|
|
45
|
+
projects: Array<Data.Project>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The resolved window end, echoed back as ISO 8601.
|
|
49
|
+
*/
|
|
50
|
+
to: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The same total in US dollars.
|
|
54
|
+
*/
|
|
55
|
+
totalUsd: number;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Total billable spend across the organization (or the single project) in
|
|
59
|
+
* micro-dollars.
|
|
60
|
+
*/
|
|
61
|
+
totalUsdMicros: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export namespace Data {
|
|
65
|
+
export interface Project {
|
|
66
|
+
/**
|
|
67
|
+
* The same billable spend in US dollars. For display; use amountUsdMicros to
|
|
68
|
+
* reconcile.
|
|
69
|
+
*/
|
|
70
|
+
amountUsd: number;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Billable spend in integer micro-dollars (1,000,000 = $1). The exact value.
|
|
74
|
+
*/
|
|
75
|
+
amountUsdMicros: number;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* This project's spend split by cost type, highest first. Sums to amountUsdMicros.
|
|
79
|
+
*/
|
|
80
|
+
breakdown: Array<Project.Breakdown>;
|
|
81
|
+
|
|
82
|
+
projectId: string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Null only if the project no longer exists in this organization.
|
|
86
|
+
*/
|
|
87
|
+
projectName: string | null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export namespace Project {
|
|
91
|
+
export interface Breakdown {
|
|
92
|
+
/**
|
|
93
|
+
* The same figure in US dollars.
|
|
94
|
+
*/
|
|
95
|
+
amountUsd: number;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Billable spend for this type, in micro-dollars.
|
|
99
|
+
*/
|
|
100
|
+
amountUsdMicros: number;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The cost source, e.g. SIM*PLATFORM_FEE, SIM_LLM, SIM_TTS, SIM_STT,
|
|
104
|
+
* SIM_TELEPHONY, METRIC, or TRANSCRIPTION. These are the granular sources behind
|
|
105
|
+
* the Billing screen categories (SIM*\* roll up into "Simulation").
|
|
106
|
+
*/
|
|
107
|
+
source:
|
|
108
|
+
| 'SIM_PLATFORM_FEE'
|
|
109
|
+
| 'SIM_TTS'
|
|
110
|
+
| 'SIM_STT'
|
|
111
|
+
| 'SIM_LLM'
|
|
112
|
+
| 'SIM_TELEPHONY'
|
|
113
|
+
| 'METRIC'
|
|
114
|
+
| 'TRANSCRIPTION'
|
|
115
|
+
| 'INTERNAL_LLM'
|
|
116
|
+
| 'INTERNAL_STT';
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Whether this cost came from a SIMULATION or a production call (POST_CALL).
|
|
120
|
+
*/
|
|
121
|
+
surface: 'SIMULATION' | 'POST_CALL';
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface UsageGetParams {
|
|
128
|
+
/**
|
|
129
|
+
* Start of the window (inclusive), ISO 8601.
|
|
130
|
+
*/
|
|
131
|
+
from: string;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* End of the window (exclusive), ISO 8601. Must be after `from`, and the window
|
|
135
|
+
* may not exceed 366 days.
|
|
136
|
+
*/
|
|
137
|
+
to: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Limit the report to a single project. Omit for the whole organization.
|
|
141
|
+
*/
|
|
142
|
+
projectId?: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export declare namespace Usage {
|
|
146
|
+
export { type UsageGetResponse as UsageGetResponse, type UsageGetParams as UsageGetParams };
|
|
147
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '5.
|
|
1
|
+
export const VERSION = '5.9.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "5.
|
|
1
|
+
export declare const VERSION = "5.9.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "5.
|
|
1
|
+
export declare const VERSION = "5.9.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '5.
|
|
1
|
+
export const VERSION = '5.9.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|