@coval/sdk 0.7.2 → 0.9.4

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.
Files changed (124) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +5 -0
  3. package/README.md +2 -2
  4. package/dist/CovalClient.d.ts +3 -2
  5. package/dist/CovalClient.d.ts.map +1 -1
  6. package/dist/CovalClient.js +4 -1
  7. package/dist/CovalClient.js.map +1 -1
  8. package/dist/generated/apis/PythonMetricsApi.d.ts +290 -0
  9. package/dist/generated/apis/PythonMetricsApi.d.ts.map +1 -0
  10. package/dist/generated/apis/PythonMetricsApi.js +291 -0
  11. package/dist/generated/apis/PythonMetricsApi.js.map +1 -0
  12. package/dist/generated/apis/SimulatedConversationsApi.d.ts +4 -4
  13. package/dist/generated/apis/SimulatedConversationsApi.js +2 -2
  14. package/dist/generated/apis/index.d.ts +1 -0
  15. package/dist/generated/apis/index.d.ts.map +1 -1
  16. package/dist/generated/apis/index.js +1 -0
  17. package/dist/generated/apis/index.js.map +1 -1
  18. package/dist/generated/models/CovalMetricsAPIMetricType.d.ts +2 -0
  19. package/dist/generated/models/CovalMetricsAPIMetricType.d.ts.map +1 -1
  20. package/dist/generated/models/CovalMetricsAPIMetricType.js +2 -0
  21. package/dist/generated/models/CovalMetricsAPIMetricType.js.map +1 -1
  22. package/dist/generated/models/CovalPersonasAPICreatePersonaRequest.d.ts +10 -1
  23. package/dist/generated/models/CovalPersonasAPICreatePersonaRequest.d.ts.map +1 -1
  24. package/dist/generated/models/CovalPersonasAPICreatePersonaRequest.js +2 -0
  25. package/dist/generated/models/CovalPersonasAPICreatePersonaRequest.js.map +1 -1
  26. package/dist/generated/models/CovalPersonasAPIPersonaResource.d.ts +9 -0
  27. package/dist/generated/models/CovalPersonasAPIPersonaResource.d.ts.map +1 -1
  28. package/dist/generated/models/CovalPersonasAPIPersonaResource.js +2 -0
  29. package/dist/generated/models/CovalPersonasAPIPersonaResource.js.map +1 -1
  30. package/dist/generated/models/CovalPersonasAPIUpdatePersonaRequest.d.ts +11 -1
  31. package/dist/generated/models/CovalPersonasAPIUpdatePersonaRequest.d.ts.map +1 -1
  32. package/dist/generated/models/CovalPersonasAPIUpdatePersonaRequest.js +2 -0
  33. package/dist/generated/models/CovalPersonasAPIUpdatePersonaRequest.js.map +1 -1
  34. package/dist/generated/models/CovalReviewsAPIReviewProjectResource.d.ts +1 -1
  35. package/dist/generated/models/CovalReviewsAPIUpdateReviewProjectRequest.d.ts +1 -1
  36. package/dist/generated/models/CovalUploadedConversationsAPISubmitUploadedConversationRequest.d.ts +8 -2
  37. package/dist/generated/models/CovalUploadedConversationsAPISubmitUploadedConversationRequest.d.ts.map +1 -1
  38. package/dist/generated/models/CovalUploadedConversationsAPISubmitUploadedConversationRequest.js.map +1 -1
  39. package/dist/generated/models/CovalUploadedConversationsAPITranscriptMessage.d.ts +53 -0
  40. package/dist/generated/models/CovalUploadedConversationsAPITranscriptMessage.d.ts.map +1 -1
  41. package/dist/generated/models/CovalUploadedConversationsAPITranscriptMessage.js +17 -0
  42. package/dist/generated/models/CovalUploadedConversationsAPITranscriptMessage.js.map +1 -1
  43. package/dist/generated/models/CovalUploadedConversationsAPIUploadedConversationResource.d.ts +4 -1
  44. package/dist/generated/models/CovalUploadedConversationsAPIUploadedConversationResource.d.ts.map +1 -1
  45. package/dist/generated/models/CovalUploadedConversationsAPIUploadedConversationResource.js.map +1 -1
  46. package/dist/generated/models/PythonMetricsAPICreatePythonMetricDraftRequest.d.ts +84 -0
  47. package/dist/generated/models/PythonMetricsAPICreatePythonMetricDraftRequest.d.ts.map +1 -0
  48. package/dist/generated/models/PythonMetricsAPICreatePythonMetricDraftRequest.js +70 -0
  49. package/dist/generated/models/PythonMetricsAPICreatePythonMetricDraftRequest.js.map +1 -0
  50. package/dist/generated/models/PythonMetricsAPIInputRequirements.d.ts +45 -0
  51. package/dist/generated/models/PythonMetricsAPIInputRequirements.d.ts.map +1 -0
  52. package/dist/generated/models/PythonMetricsAPIInputRequirements.js +46 -0
  53. package/dist/generated/models/PythonMetricsAPIInputRequirements.js.map +1 -0
  54. package/dist/generated/models/PythonMetricsAPIPreviewPythonMetricBody.d.ts +33 -0
  55. package/dist/generated/models/PythonMetricsAPIPreviewPythonMetricBody.d.ts.map +1 -0
  56. package/dist/generated/models/PythonMetricsAPIPreviewPythonMetricBody.js +44 -0
  57. package/dist/generated/models/PythonMetricsAPIPreviewPythonMetricBody.js.map +1 -0
  58. package/dist/generated/models/PythonMetricsAPIPublishPythonMetricBody.d.ts +39 -0
  59. package/dist/generated/models/PythonMetricsAPIPublishPythonMetricBody.d.ts.map +1 -0
  60. package/dist/generated/models/PythonMetricsAPIPublishPythonMetricBody.js +48 -0
  61. package/dist/generated/models/PythonMetricsAPIPublishPythonMetricBody.js.map +1 -0
  62. package/dist/generated/models/PythonMetricsAPIPublishPythonMetricResponse.d.ts +39 -0
  63. package/dist/generated/models/PythonMetricsAPIPublishPythonMetricResponse.d.ts.map +1 -0
  64. package/dist/generated/models/PythonMetricsAPIPublishPythonMetricResponse.js +48 -0
  65. package/dist/generated/models/PythonMetricsAPIPublishPythonMetricResponse.js.map +1 -0
  66. package/dist/generated/models/PythonMetricsAPIPythonMetricDraftResource.d.ts +108 -0
  67. package/dist/generated/models/PythonMetricsAPIPythonMetricDraftResource.d.ts.map +1 -0
  68. package/dist/generated/models/PythonMetricsAPIPythonMetricDraftResource.js +92 -0
  69. package/dist/generated/models/PythonMetricsAPIPythonMetricDraftResource.js.map +1 -0
  70. package/dist/generated/models/PythonMetricsAPIPythonMetricDraftResponse.d.ts +34 -0
  71. package/dist/generated/models/PythonMetricsAPIPythonMetricDraftResponse.d.ts.map +1 -0
  72. package/dist/generated/models/PythonMetricsAPIPythonMetricDraftResponse.js +45 -0
  73. package/dist/generated/models/PythonMetricsAPIPythonMetricDraftResponse.js.map +1 -0
  74. package/dist/generated/models/PythonMetricsAPIPythonMetricPreviewResource.d.ts +64 -0
  75. package/dist/generated/models/PythonMetricsAPIPythonMetricPreviewResource.d.ts.map +1 -0
  76. package/dist/generated/models/PythonMetricsAPIPythonMetricPreviewResource.js +59 -0
  77. package/dist/generated/models/PythonMetricsAPIPythonMetricPreviewResource.js.map +1 -0
  78. package/dist/generated/models/PythonMetricsAPIPythonMetricPreviewResourceValue.d.ts +27 -0
  79. package/dist/generated/models/PythonMetricsAPIPythonMetricPreviewResourceValue.d.ts.map +1 -0
  80. package/dist/generated/models/PythonMetricsAPIPythonMetricPreviewResourceValue.js +32 -0
  81. package/dist/generated/models/PythonMetricsAPIPythonMetricPreviewResourceValue.js.map +1 -0
  82. package/dist/generated/models/PythonMetricsAPIPythonMetricPreviewsResponse.d.ts +34 -0
  83. package/dist/generated/models/PythonMetricsAPIPythonMetricPreviewsResponse.d.ts.map +1 -0
  84. package/dist/generated/models/PythonMetricsAPIPythonMetricPreviewsResponse.js +45 -0
  85. package/dist/generated/models/PythonMetricsAPIPythonMetricPreviewsResponse.js.map +1 -0
  86. package/dist/generated/models/index.d.ts +10 -2
  87. package/dist/generated/models/index.d.ts.map +1 -1
  88. package/dist/generated/models/index.js +10 -2
  89. package/dist/generated/models/index.js.map +1 -1
  90. package/package.json +7 -5
  91. package/src/CovalClient.ts +4 -0
  92. package/src/generated/apis/PythonMetricsApi.ts +627 -0
  93. package/src/generated/apis/SimulatedConversationsApi.ts +4 -4
  94. package/src/generated/apis/index.ts +1 -0
  95. package/src/generated/models/CovalMetricsAPIMetricType.ts +2 -0
  96. package/src/generated/models/CovalPersonasAPICreatePersonaRequest.ts +12 -15
  97. package/src/generated/models/CovalPersonasAPIPersonaResource.ts +11 -0
  98. package/src/generated/models/CovalPersonasAPIUpdatePersonaRequest.ts +13 -1
  99. package/src/generated/models/CovalReviewsAPIReviewProjectResource.ts +1 -1
  100. package/src/generated/models/CovalReviewsAPIUpdateReviewProjectRequest.ts +1 -1
  101. package/src/generated/models/CovalUploadedConversationsAPISubmitUploadedConversationRequest.ts +8 -2
  102. package/src/generated/models/CovalUploadedConversationsAPITranscriptMessage.ts +64 -0
  103. package/src/generated/models/CovalUploadedConversationsAPIUploadedConversationResource.ts +4 -1
  104. package/src/generated/models/PythonMetricsAPICreatePythonMetricDraftRequest.ts +143 -0
  105. package/src/generated/models/PythonMetricsAPIInputRequirements.ts +81 -0
  106. package/src/generated/models/PythonMetricsAPIPreviewPythonMetricBody.ts +66 -0
  107. package/src/generated/models/PythonMetricsAPIPublishPythonMetricBody.ts +75 -0
  108. package/src/generated/models/PythonMetricsAPIPublishPythonMetricResponse.ts +75 -0
  109. package/src/generated/models/PythonMetricsAPIPythonMetricDraftResource.ts +182 -0
  110. package/src/generated/models/PythonMetricsAPIPythonMetricDraftResponse.ts +74 -0
  111. package/src/generated/models/PythonMetricsAPIPythonMetricPreviewResource.ts +116 -0
  112. package/src/generated/models/PythonMetricsAPIPythonMetricPreviewResourceValue.ts +46 -0
  113. package/src/generated/models/PythonMetricsAPIPythonMetricPreviewsResponse.ts +74 -0
  114. package/src/generated/models/index.ts +10 -2
  115. package/dist/generated/models/PersonaWithPrompt.d.ts +0 -33
  116. package/dist/generated/models/PersonaWithPrompt.d.ts.map +0 -1
  117. package/dist/generated/models/PersonaWithPrompt.js +0 -44
  118. package/dist/generated/models/PersonaWithPrompt.js.map +0 -1
  119. package/dist/generated/models/SilentPersona.d.ts +0 -40
  120. package/dist/generated/models/SilentPersona.d.ts.map +0 -1
  121. package/dist/generated/models/SilentPersona.js +0 -50
  122. package/dist/generated/models/SilentPersona.js.map +0 -1
  123. package/src/generated/models/PersonaWithPrompt.ts +0 -66
  124. package/src/generated/models/SilentPersona.ts +0 -76
@@ -30,6 +30,7 @@
30
30
  * - `METRIC_TRANSCRIPT_REGEX` - Regex pattern matching
31
31
  * - `METRIC_PAUSE_ANALYSIS` - Speech pause detection
32
32
  * - `METRIC_SQL_FLOAT` - Custom SQL query over the simulation's data (set `sql_query`)
33
+ * - `METRIC_PYTHON` - Tested Python metric; create and edit through the Python draft publication API.
33
34
  * - `METRIC_COMPOSITE_EVALUATION` - Judges a list of criteria independently and reports how
34
35
  * many were met (set `criteria_source`, and `criteria_path` or `criteria` to match)
35
36
  *
@@ -52,6 +53,7 @@ export const CovalMetricsAPIMetricType = {
52
53
  MetricAgentRefusal: 'METRIC_AGENT_REFUSAL',
53
54
  MetricPauseAnalysis: 'METRIC_PAUSE_ANALYSIS',
54
55
  MetricSqlFloat: 'METRIC_SQL_FLOAT',
56
+ MetricPython: 'METRIC_PYTHON',
55
57
  MetricCompositeEvaluation: 'METRIC_COMPOSITE_EVALUATION',
56
58
  MetricLlmTtfb: 'METRIC_LLM_TTFB',
57
59
  MetricTtsTtfb: 'METRIC_TTS_TTFB',
@@ -13,13 +13,6 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime.js';
16
- import type { SilentPersona } from './SilentPersona.js';
17
- import {
18
- SilentPersonaFromJSON,
19
- SilentPersonaFromJSONTyped,
20
- SilentPersonaToJSON,
21
- SilentPersonaToJSONTyped,
22
- } from './SilentPersona.js';
23
16
  import type { CovalPersonasAPIMultiPhoneConfig } from './CovalPersonasAPIMultiPhoneConfig.js';
24
17
  import {
25
18
  CovalPersonasAPIMultiPhoneConfigFromJSON,
@@ -34,13 +27,6 @@ import {
34
27
  CovalPersonasAPIAudioDegradationConfigToJSON,
35
28
  CovalPersonasAPIAudioDegradationConfigToJSONTyped,
36
29
  } from './CovalPersonasAPIAudioDegradationConfig.js';
37
- import type { PersonaWithPrompt } from './PersonaWithPrompt.js';
38
- import {
39
- PersonaWithPromptFromJSON,
40
- PersonaWithPromptFromJSONTyped,
41
- PersonaWithPromptToJSON,
42
- PersonaWithPromptToJSONTyped,
43
- } from './PersonaWithPrompt.js';
44
30
 
45
31
  /**
46
32
  *
@@ -91,7 +77,7 @@ export interface CovalPersonasAPICreatePersonaRequest {
91
77
  */
92
78
  name: string;
93
79
  /**
94
- * Instructions describing persona behavior and personality. Required unless silent_mode is true.
80
+ * Optional instructions describing persona behavior and personality. Null or an empty string leaves behavior to the test case.
95
81
  * @type {string}
96
82
  * @memberof CovalPersonasAPICreatePersonaRequest
97
83
  */
@@ -159,6 +145,15 @@ export interface CovalPersonasAPICreatePersonaRequest {
159
145
  * @memberof CovalPersonasAPICreatePersonaRequest
160
146
  */
161
147
  interruption_rate?: CovalPersonasAPICreatePersonaRequestInterruptionRateEnum | null;
148
+ /**
149
+ * Whether the persona follows interruption instructions in the test case or the
150
+ * persona prompt, interrupting the agent mid-utterance when one is met. Takes effect
151
+ * only for organizations with prompted interruptions enabled. Defaults to false.
152
+ *
153
+ * @type {boolean}
154
+ * @memberof CovalPersonasAPICreatePersonaRequest
155
+ */
156
+ interruption_instructions_enabled?: boolean | null;
162
157
  /**
163
158
  * Enable multilingual speech-to-text so callers speaking languages
164
159
  * other than the primary language_code are still transcribed accurately.
@@ -281,6 +276,7 @@ export function CovalPersonasAPICreatePersonaRequestFromJSONTyped(json: any, ign
281
276
  'wait_seconds': json['wait_seconds'] == null ? undefined : json['wait_seconds'],
282
277
  'conversation_initiation': json['conversation_initiation'] == null ? undefined : json['conversation_initiation'],
283
278
  'interruption_rate': json['interruption_rate'] == null ? undefined : json['interruption_rate'],
279
+ 'interruption_instructions_enabled': json['interruption_instructions_enabled'] == null ? undefined : json['interruption_instructions_enabled'],
284
280
  'multi_language_stt': json['multi_language_stt'] == null ? undefined : json['multi_language_stt'],
285
281
  'hold_music_timeout_seconds': json['hold_music_timeout_seconds'] == null ? undefined : json['hold_music_timeout_seconds'],
286
282
  'situate_speaker': json['situate_speaker'] == null ? undefined : json['situate_speaker'],
@@ -317,6 +313,7 @@ export function CovalPersonasAPICreatePersonaRequestToJSONTyped(value?: CovalPer
317
313
  'wait_seconds': value['wait_seconds'],
318
314
  'conversation_initiation': value['conversation_initiation'],
319
315
  'interruption_rate': value['interruption_rate'],
316
+ 'interruption_instructions_enabled': value['interruption_instructions_enabled'],
320
317
  'multi_language_stt': value['multi_language_stt'],
321
318
  'hold_music_timeout_seconds': value['hold_music_timeout_seconds'],
322
319
  'situate_speaker': value['situate_speaker'],
@@ -181,6 +181,15 @@ export interface CovalPersonasAPIPersonaResource {
181
181
  * @memberof CovalPersonasAPIPersonaResource
182
182
  */
183
183
  interruption_rate?: CovalPersonasAPIPersonaResourceInterruptionRateEnum;
184
+ /**
185
+ * Whether the persona follows interruption instructions in the test case or the
186
+ * persona prompt, interrupting the agent mid-utterance when one is met. Takes effect
187
+ * only for organizations with prompted interruptions enabled. Defaults to false.
188
+ *
189
+ * @type {boolean}
190
+ * @memberof CovalPersonasAPIPersonaResource
191
+ */
192
+ interruption_instructions_enabled?: boolean;
184
193
  /**
185
194
  * Enable multilingual speech-to-text so callers speaking languages
186
195
  * other than the primary language_code are still transcribed accurately.
@@ -327,6 +336,7 @@ export function CovalPersonasAPIPersonaResourceFromJSONTyped(json: any, ignoreDi
327
336
  'wait_seconds': json['wait_seconds'] == null ? undefined : json['wait_seconds'],
328
337
  'conversation_initiation': json['conversation_initiation'] == null ? undefined : json['conversation_initiation'],
329
338
  'interruption_rate': json['interruption_rate'] == null ? undefined : json['interruption_rate'],
339
+ 'interruption_instructions_enabled': json['interruption_instructions_enabled'] == null ? undefined : json['interruption_instructions_enabled'],
330
340
  'multi_language_stt': json['multi_language_stt'] == null ? undefined : json['multi_language_stt'],
331
341
  'hold_music_timeout_seconds': json['hold_music_timeout_seconds'] == null ? undefined : json['hold_music_timeout_seconds'],
332
342
  'situate_speaker': json['situate_speaker'] == null ? undefined : json['situate_speaker'],
@@ -367,6 +377,7 @@ export function CovalPersonasAPIPersonaResourceToJSONTyped(value?: Omit<CovalPer
367
377
  'wait_seconds': value['wait_seconds'],
368
378
  'conversation_initiation': value['conversation_initiation'],
369
379
  'interruption_rate': value['interruption_rate'],
380
+ 'interruption_instructions_enabled': value['interruption_instructions_enabled'],
370
381
  'multi_language_stt': value['multi_language_stt'],
371
382
  'hold_music_timeout_seconds': value['hold_music_timeout_seconds'],
372
383
  'situate_speaker': value['situate_speaker'],
@@ -77,7 +77,7 @@ export interface CovalPersonasAPIUpdatePersonaRequest {
77
77
  */
78
78
  name?: string | null;
79
79
  /**
80
- * Instructions describing persona behavior and personality. Send null to clear only when the persona's resulting silent_mode is true; otherwise the request is rejected.
80
+ * Optional instructions for persona behavior. Send null or an empty string to clear; omit the field to leave it unchanged.
81
81
  * @type {string}
82
82
  * @memberof CovalPersonasAPIUpdatePersonaRequest
83
83
  */
@@ -146,6 +146,16 @@ export interface CovalPersonasAPIUpdatePersonaRequest {
146
146
  * @memberof CovalPersonasAPIUpdatePersonaRequest
147
147
  */
148
148
  interruption_rate?: CovalPersonasAPIUpdatePersonaRequestInterruptionRateEnum | null;
149
+ /**
150
+ * Whether the persona follows interruption instructions in the test case or the
151
+ * persona prompt, interrupting the agent mid-utterance when one is met. Takes effect
152
+ * only for organizations with prompted interruptions enabled. Defaults to false. null
153
+ * is ignored; send false to disable.
154
+ *
155
+ * @type {boolean}
156
+ * @memberof CovalPersonasAPIUpdatePersonaRequest
157
+ */
158
+ interruption_instructions_enabled?: boolean | null;
149
159
  /**
150
160
  * Enable multilingual speech-to-text so callers speaking languages other than the primary language_code are still transcribed accurately. Send null to clear an existing override.
151
161
  * @type {boolean}
@@ -264,6 +274,7 @@ export function CovalPersonasAPIUpdatePersonaRequestFromJSONTyped(json: any, ign
264
274
  'wait_seconds': json['wait_seconds'] == null ? undefined : json['wait_seconds'],
265
275
  'conversation_initiation': json['conversation_initiation'] == null ? undefined : json['conversation_initiation'],
266
276
  'interruption_rate': json['interruption_rate'] == null ? undefined : json['interruption_rate'],
277
+ 'interruption_instructions_enabled': json['interruption_instructions_enabled'] == null ? undefined : json['interruption_instructions_enabled'],
267
278
  'multi_language_stt': json['multi_language_stt'] == null ? undefined : json['multi_language_stt'],
268
279
  'hold_music_timeout_seconds': json['hold_music_timeout_seconds'] == null ? undefined : json['hold_music_timeout_seconds'],
269
280
  'situate_speaker': json['situate_speaker'] == null ? undefined : json['situate_speaker'],
@@ -300,6 +311,7 @@ export function CovalPersonasAPIUpdatePersonaRequestToJSONTyped(value?: CovalPer
300
311
  'wait_seconds': value['wait_seconds'],
301
312
  'conversation_initiation': value['conversation_initiation'],
302
313
  'interruption_rate': value['interruption_rate'],
314
+ 'interruption_instructions_enabled': value['interruption_instructions_enabled'],
303
315
  'multi_language_stt': value['multi_language_stt'],
304
316
  'hold_music_timeout_seconds': value['hold_music_timeout_seconds'],
305
317
  'situate_speaker': value['situate_speaker'],
@@ -137,7 +137,7 @@ export interface CovalReviewsAPIReviewProjectResource {
137
137
  */
138
138
  enforced_collaboration?: boolean;
139
139
  /**
140
- * Allow reviewers to skip linked metrics
140
+ * Allow reviewers to skip linked metrics. Rejected on collaborative projects unless enforced_collaboration is true.
141
141
  * @type {boolean}
142
142
  * @memberof CovalReviewsAPIReviewProjectResource
143
143
  */
@@ -118,7 +118,7 @@ export interface CovalReviewsAPIUpdateReviewProjectRequest {
118
118
  */
119
119
  enforced_collaboration?: boolean;
120
120
  /**
121
- * Allow reviewers to skip linked metrics
121
+ * Allow reviewers to skip linked metrics. Rejected on collaborative projects unless enforced_collaboration is true.
122
122
  * @type {boolean}
123
123
  * @memberof CovalReviewsAPIUpdateReviewProjectRequest
124
124
  */
@@ -109,7 +109,10 @@ export interface CovalUploadedConversationsAPISubmitUploadedConversationRequest
109
109
  */
110
110
  upload_id?: string;
111
111
  /**
112
- * List of metric IDs to evaluate (22–26 character IDs).
112
+ * Metric IDs or exact legacy metric_name values to evaluate. IDs take precedence.
113
+ * Legacy names must resolve to a unique active metric visible in the request workspace.
114
+ * Display names are not accepted. Unknown, ambiguous, inactive, hidden, deleted, or
115
+ * inaccessible selections return 400 INVALID_ARGUMENT.
113
116
  *
114
117
  * If not provided, uses your default metrics configured in the Coval dashboard.
115
118
  *
@@ -157,7 +160,10 @@ export interface CovalUploadedConversationsAPISubmitUploadedConversationRequest
157
160
  */
158
161
  external_conversation_id?: string;
159
162
  /**
160
- * When the conversation actually occurred (ISO 8601)
163
+ * The instant the audio recording begins, in ISO 8601 with sub-second precision. Coval uses it to align the recording with trace spans in the trace viewer and to locate traces around the call.
164
+ *
165
+ * Optional. Without it, the trace viewer draws the recording without aligning it to spans.
166
+ *
161
167
  * @type {Date}
162
168
  * @memberof CovalUploadedConversationsAPISubmitUploadedConversationRequest
163
169
  */
@@ -34,6 +34,11 @@ import {
34
34
  * 2. Each tool call has a unique `id` and function details
35
35
  * 3. Tool responses use `role: tool` with matching `tool_call_id`
36
36
  *
37
+ * **Coval Tool Entries:**
38
+ * - A `role: tool` message with `is_tool_call` set is an entry recorded by Coval's simulator: a tool
39
+ * invocation (`true`) or a setup payload record (`false`)
40
+ * - It carries `name` and `tool_call_owner` and needs no `tool_call_id`
41
+ *
37
42
  * **Timing Information:**
38
43
  * - `start_time` and `end_time` are measured in seconds from the start of the audio (e.g., 0.0, 3.5, 7.2)
39
44
  * - Both `start_time` and `end_time` are **required** if:
@@ -96,6 +101,46 @@ export interface CovalUploadedConversationsAPITranscriptMessage {
96
101
  * @memberof CovalUploadedConversationsAPITranscriptMessage
97
102
  */
98
103
  tool_call_id?: string | null;
104
+ /**
105
+ * Tool or record name for a Coval tool entry (`role: tool` with `is_tool_call` set).
106
+ *
107
+ * Coval's own simulator records each tool call made during a simulation, such as a persona
108
+ * keypad press (`dtmf_tool`), and each setup payload exchanged with the agent, as a `role: tool`
109
+ * message in this form.
110
+ *
111
+ * @type {string}
112
+ * @memberof CovalUploadedConversationsAPITranscriptMessage
113
+ */
114
+ name?: string | null;
115
+ /**
116
+ * Present on a Coval tool entry: `true` for a tool invocation, `false` for a setup payload record.
117
+ *
118
+ * A Coval tool entry needs no `tool_call_id`; the message `content` carries the call's arguments and
119
+ * result, or the recorded payload. `true` is only valid with `role: tool`.
120
+ *
121
+ * @type {boolean}
122
+ * @memberof CovalUploadedConversationsAPITranscriptMessage
123
+ */
124
+ is_tool_call?: boolean | null;
125
+ /**
126
+ * Which side produced a Coval tool entry. Only valid with `role: tool`.
127
+ *
128
+ * @type {CovalUploadedConversationsAPITranscriptMessageToolCallOwnerEnum}
129
+ * @memberof CovalUploadedConversationsAPITranscriptMessage
130
+ */
131
+ tool_call_owner?: CovalUploadedConversationsAPITranscriptMessageToolCallOwnerEnum | null;
132
+ /**
133
+ * `true` when the speaker was interrupted before finishing this message.
134
+ * @type {boolean}
135
+ * @memberof CovalUploadedConversationsAPITranscriptMessage
136
+ */
137
+ is_interrupted?: boolean | null;
138
+ /**
139
+ * `true` when `start_time` and `end_time` are estimated rather than measured.
140
+ * @type {boolean}
141
+ * @memberof CovalUploadedConversationsAPITranscriptMessage
142
+ */
143
+ is_estimated?: boolean | null;
99
144
  /**
100
145
  * When this message started, in seconds from the beginning of the conversation.
101
146
  *
@@ -152,6 +197,15 @@ export const CovalUploadedConversationsAPITranscriptMessageRoleEnum = {
152
197
  } as const;
153
198
  export type CovalUploadedConversationsAPITranscriptMessageRoleEnum = typeof CovalUploadedConversationsAPITranscriptMessageRoleEnum[keyof typeof CovalUploadedConversationsAPITranscriptMessageRoleEnum];
154
199
 
200
+ /**
201
+ * @export
202
+ */
203
+ export const CovalUploadedConversationsAPITranscriptMessageToolCallOwnerEnum = {
204
+ User: 'user',
205
+ Assistant: 'assistant'
206
+ } as const;
207
+ export type CovalUploadedConversationsAPITranscriptMessageToolCallOwnerEnum = typeof CovalUploadedConversationsAPITranscriptMessageToolCallOwnerEnum[keyof typeof CovalUploadedConversationsAPITranscriptMessageToolCallOwnerEnum];
208
+
155
209
 
156
210
  /**
157
211
  * Check if a given object implements the CovalUploadedConversationsAPITranscriptMessage interface.
@@ -176,6 +230,11 @@ export function CovalUploadedConversationsAPITranscriptMessageFromJSONTyped(json
176
230
  'message': json['message'] == null ? undefined : json['message'],
177
231
  'tool_calls': json['tool_calls'] == null ? undefined : ((json['tool_calls'] as Array<any>).map(CovalUploadedConversationsAPIToolCallFromJSON)),
178
232
  'tool_call_id': json['tool_call_id'] == null ? undefined : json['tool_call_id'],
233
+ 'name': json['name'] == null ? undefined : json['name'],
234
+ 'is_tool_call': json['is_tool_call'] == null ? undefined : json['is_tool_call'],
235
+ 'tool_call_owner': json['tool_call_owner'] == null ? undefined : json['tool_call_owner'],
236
+ 'is_interrupted': json['is_interrupted'] == null ? undefined : json['is_interrupted'],
237
+ 'is_estimated': json['is_estimated'] == null ? undefined : json['is_estimated'],
179
238
  'start_time': json['start_time'] == null ? undefined : json['start_time'],
180
239
  'end_time': json['end_time'] == null ? undefined : json['end_time'],
181
240
  'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
@@ -200,6 +259,11 @@ export function CovalUploadedConversationsAPITranscriptMessageToJSONTyped(value?
200
259
  'message': value['message'],
201
260
  'tool_calls': value['tool_calls'] == null ? undefined : ((value['tool_calls'] as Array<any>).map(CovalUploadedConversationsAPIToolCallToJSON)),
202
261
  'tool_call_id': value['tool_call_id'],
262
+ 'name': value['name'],
263
+ 'is_tool_call': value['is_tool_call'],
264
+ 'tool_call_owner': value['tool_call_owner'],
265
+ 'is_interrupted': value['is_interrupted'],
266
+ 'is_estimated': value['is_estimated'],
203
267
  'start_time': value['start_time'],
204
268
  'end_time': value['end_time'],
205
269
  'timestamp': value['timestamp'] == null ? value['timestamp'] : value['timestamp'].toISOString(),
@@ -100,7 +100,10 @@ export interface CovalUploadedConversationsAPIUploadedConversationResource {
100
100
  */
101
101
  external_conversation_id?: string | null;
102
102
  /**
103
- * When the conversation actually occurred (ISO 8601)
103
+ * The instant the audio recording begins, in ISO 8601 with sub-second precision. Coval uses it to align the recording with trace spans in the trace viewer and to locate traces around the call.
104
+ *
105
+ * When it was not provided at submit, this is the time Coval received the conversation, and the trace viewer draws the recording without aligning it to spans.
106
+ *
104
107
  * @type {Date}
105
108
  * @memberof CovalUploadedConversationsAPIUploadedConversationResource
106
109
  */
@@ -0,0 +1,143 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Coval Agents API
5
+ * Manage configurations for simulations and evaluations.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@coval.dev
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime.js';
16
+ import type { PythonMetricsAPIInputRequirements } from './PythonMetricsAPIInputRequirements.js';
17
+ import {
18
+ PythonMetricsAPIInputRequirementsFromJSON,
19
+ PythonMetricsAPIInputRequirementsFromJSONTyped,
20
+ PythonMetricsAPIInputRequirementsToJSON,
21
+ PythonMetricsAPIInputRequirementsToJSONTyped,
22
+ } from './PythonMetricsAPIInputRequirements.js';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface PythonMetricsAPICreatePythonMetricDraftRequest
28
+ */
29
+ export interface PythonMetricsAPICreatePythonMetricDraftRequest {
30
+ /**
31
+ * Existing Python metric to revise; null creates a new metric.
32
+ * @type {string}
33
+ * @memberof PythonMetricsAPICreatePythonMetricDraftRequest
34
+ */
35
+ target_metric_id?: string | null;
36
+ /**
37
+ * Expected current version when revising a metric; null for a new metric.
38
+ * @type {string}
39
+ * @memberof PythonMetricsAPICreatePythonMetricDraftRequest
40
+ */
41
+ target_version_id?: string | null;
42
+ /**
43
+ * Display name for the metric.
44
+ * @type {string}
45
+ * @memberof PythonMetricsAPICreatePythonMetricDraftRequest
46
+ */
47
+ display_name: string;
48
+ /**
49
+ * What this metric measures.
50
+ * @type {string}
51
+ * @memberof PythonMetricsAPICreatePythonMetricDraftRequest
52
+ */
53
+ description?: string;
54
+ /**
55
+ * Python defining evaluate(conversation).
56
+ * @type {string}
57
+ * @memberof PythonMetricsAPICreatePythonMetricDraftRequest
58
+ */
59
+ source: string;
60
+ /**
61
+ * Scalar return type.
62
+ * @type {PythonMetricsAPICreatePythonMetricDraftRequestOutputTypeEnum}
63
+ * @memberof PythonMetricsAPICreatePythonMetricDraftRequest
64
+ */
65
+ output_type: PythonMetricsAPICreatePythonMetricDraftRequestOutputTypeEnum;
66
+ /**
67
+ * Optional numeric unit; null means unitless.
68
+ * @type {string}
69
+ * @memberof PythonMetricsAPICreatePythonMetricDraftRequest
70
+ */
71
+ unit?: string | null;
72
+ /**
73
+ * Inputs required to evaluate a conversation.
74
+ * @type {PythonMetricsAPIInputRequirements}
75
+ * @memberof PythonMetricsAPICreatePythonMetricDraftRequest
76
+ */
77
+ requirements?: PythonMetricsAPIInputRequirements;
78
+ }
79
+
80
+
81
+ /**
82
+ * @export
83
+ */
84
+ export const PythonMetricsAPICreatePythonMetricDraftRequestOutputTypeEnum = {
85
+ Number: 'number',
86
+ Boolean: 'boolean'
87
+ } as const;
88
+ export type PythonMetricsAPICreatePythonMetricDraftRequestOutputTypeEnum = typeof PythonMetricsAPICreatePythonMetricDraftRequestOutputTypeEnum[keyof typeof PythonMetricsAPICreatePythonMetricDraftRequestOutputTypeEnum];
89
+
90
+
91
+ /**
92
+ * Check if a given object implements the PythonMetricsAPICreatePythonMetricDraftRequest interface.
93
+ */
94
+ export function instanceOfPythonMetricsAPICreatePythonMetricDraftRequest(value: object): value is PythonMetricsAPICreatePythonMetricDraftRequest {
95
+ if (!('display_name' in value) || value['display_name'] === undefined) return false;
96
+ if (!('source' in value) || value['source'] === undefined) return false;
97
+ if (!('output_type' in value) || value['output_type'] === undefined) return false;
98
+ return true;
99
+ }
100
+
101
+ export function PythonMetricsAPICreatePythonMetricDraftRequestFromJSON(json: any): PythonMetricsAPICreatePythonMetricDraftRequest {
102
+ return PythonMetricsAPICreatePythonMetricDraftRequestFromJSONTyped(json, false);
103
+ }
104
+
105
+ export function PythonMetricsAPICreatePythonMetricDraftRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PythonMetricsAPICreatePythonMetricDraftRequest {
106
+ if (json == null) {
107
+ return json;
108
+ }
109
+ return {
110
+
111
+ 'target_metric_id': json['target_metric_id'] == null ? undefined : json['target_metric_id'],
112
+ 'target_version_id': json['target_version_id'] == null ? undefined : json['target_version_id'],
113
+ 'display_name': json['display_name'],
114
+ 'description': json['description'] == null ? undefined : json['description'],
115
+ 'source': json['source'],
116
+ 'output_type': json['output_type'],
117
+ 'unit': json['unit'] == null ? undefined : json['unit'],
118
+ 'requirements': json['requirements'] == null ? undefined : PythonMetricsAPIInputRequirementsFromJSON(json['requirements']),
119
+ };
120
+ }
121
+
122
+ export function PythonMetricsAPICreatePythonMetricDraftRequestToJSON(json: any): PythonMetricsAPICreatePythonMetricDraftRequest {
123
+ return PythonMetricsAPICreatePythonMetricDraftRequestToJSONTyped(json, false);
124
+ }
125
+
126
+ export function PythonMetricsAPICreatePythonMetricDraftRequestToJSONTyped(value?: PythonMetricsAPICreatePythonMetricDraftRequest | null, ignoreDiscriminator: boolean = false): any {
127
+ if (value == null) {
128
+ return value;
129
+ }
130
+
131
+ return {
132
+
133
+ 'target_metric_id': value['target_metric_id'],
134
+ 'target_version_id': value['target_version_id'],
135
+ 'display_name': value['display_name'],
136
+ 'description': value['description'],
137
+ 'source': value['source'],
138
+ 'output_type': value['output_type'],
139
+ 'unit': value['unit'],
140
+ 'requirements': PythonMetricsAPIInputRequirementsToJSON(value['requirements']),
141
+ };
142
+ }
143
+
@@ -0,0 +1,81 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Coval Agents API
5
+ * Manage configurations for simulations and evaluations.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@coval.dev
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime.js';
16
+ /**
17
+ * Distinguish required inputs from optional, unavailable conversation data.
18
+ * @export
19
+ * @interface PythonMetricsAPIInputRequirements
20
+ */
21
+ export interface PythonMetricsAPIInputRequirements {
22
+ /**
23
+ *
24
+ * @type {boolean}
25
+ * @memberof PythonMetricsAPIInputRequirements
26
+ */
27
+ audio?: boolean;
28
+ /**
29
+ *
30
+ * @type {boolean}
31
+ * @memberof PythonMetricsAPIInputRequirements
32
+ */
33
+ traces?: boolean;
34
+ /**
35
+ *
36
+ * @type {Array<string>}
37
+ * @memberof PythonMetricsAPIInputRequirements
38
+ */
39
+ frame_tables?: Array<string>;
40
+ }
41
+
42
+ /**
43
+ * Check if a given object implements the PythonMetricsAPIInputRequirements interface.
44
+ */
45
+ export function instanceOfPythonMetricsAPIInputRequirements(value: object): value is PythonMetricsAPIInputRequirements {
46
+ return true;
47
+ }
48
+
49
+ export function PythonMetricsAPIInputRequirementsFromJSON(json: any): PythonMetricsAPIInputRequirements {
50
+ return PythonMetricsAPIInputRequirementsFromJSONTyped(json, false);
51
+ }
52
+
53
+ export function PythonMetricsAPIInputRequirementsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PythonMetricsAPIInputRequirements {
54
+ if (json == null) {
55
+ return json;
56
+ }
57
+ return {
58
+
59
+ 'audio': json['audio'] == null ? undefined : json['audio'],
60
+ 'traces': json['traces'] == null ? undefined : json['traces'],
61
+ 'frame_tables': json['frame_tables'] == null ? undefined : json['frame_tables'],
62
+ };
63
+ }
64
+
65
+ export function PythonMetricsAPIInputRequirementsToJSON(json: any): PythonMetricsAPIInputRequirements {
66
+ return PythonMetricsAPIInputRequirementsToJSONTyped(json, false);
67
+ }
68
+
69
+ export function PythonMetricsAPIInputRequirementsToJSONTyped(value?: PythonMetricsAPIInputRequirements | null, ignoreDiscriminator: boolean = false): any {
70
+ if (value == null) {
71
+ return value;
72
+ }
73
+
74
+ return {
75
+
76
+ 'audio': value['audio'],
77
+ 'traces': value['traces'],
78
+ 'frame_tables': value['frame_tables'],
79
+ };
80
+ }
81
+
@@ -0,0 +1,66 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Coval Agents API
5
+ * Manage configurations for simulations and evaluations.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@coval.dev
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime.js';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface PythonMetricsAPIPreviewPythonMetricBody
20
+ */
21
+ export interface PythonMetricsAPIPreviewPythonMetricBody {
22
+ /**
23
+ * Historical simulation or uploaded-conversation IDs to evaluate.
24
+ * @type {Array<string>}
25
+ * @memberof PythonMetricsAPIPreviewPythonMetricBody
26
+ */
27
+ simulation_output_ids: Array<string>;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the PythonMetricsAPIPreviewPythonMetricBody interface.
32
+ */
33
+ export function instanceOfPythonMetricsAPIPreviewPythonMetricBody(value: object): value is PythonMetricsAPIPreviewPythonMetricBody {
34
+ if (!('simulation_output_ids' in value) || value['simulation_output_ids'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function PythonMetricsAPIPreviewPythonMetricBodyFromJSON(json: any): PythonMetricsAPIPreviewPythonMetricBody {
39
+ return PythonMetricsAPIPreviewPythonMetricBodyFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function PythonMetricsAPIPreviewPythonMetricBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PythonMetricsAPIPreviewPythonMetricBody {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'simulation_output_ids': json['simulation_output_ids'],
49
+ };
50
+ }
51
+
52
+ export function PythonMetricsAPIPreviewPythonMetricBodyToJSON(json: any): PythonMetricsAPIPreviewPythonMetricBody {
53
+ return PythonMetricsAPIPreviewPythonMetricBodyToJSONTyped(json, false);
54
+ }
55
+
56
+ export function PythonMetricsAPIPreviewPythonMetricBodyToJSONTyped(value?: PythonMetricsAPIPreviewPythonMetricBody | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'simulation_output_ids': value['simulation_output_ids'],
64
+ };
65
+ }
66
+