@coval/sdk 0.4.0 → 0.4.2

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 (149) hide show
  1. package/README.md +42 -0
  2. package/dist/CovalClient.d.ts +12 -0
  3. package/dist/CovalClient.d.ts.map +1 -1
  4. package/dist/CovalClient.js +13 -1
  5. package/dist/CovalClient.js.map +1 -1
  6. package/dist/generated/apis/ConversationsApi.d.ts +8 -8
  7. package/dist/generated/apis/ConversationsApi.js +4 -4
  8. package/dist/generated/apis/ReportsApi.d.ts +17 -14
  9. package/dist/generated/apis/ReportsApi.d.ts.map +1 -1
  10. package/dist/generated/apis/ReportsApi.js +9 -6
  11. package/dist/generated/apis/ReportsApi.js.map +1 -1
  12. package/dist/generated/apis/TracesApi.d.ts +40 -0
  13. package/dist/generated/apis/TracesApi.d.ts.map +1 -1
  14. package/dist/generated/apis/TracesApi.js +38 -0
  15. package/dist/generated/apis/TracesApi.js.map +1 -1
  16. package/dist/generated/models/CovalAgentsAPICreateAgentRequest.d.ts +23 -0
  17. package/dist/generated/models/CovalAgentsAPICreateAgentRequest.d.ts.map +1 -1
  18. package/dist/generated/models/CovalAgentsAPICreateAgentRequest.js.map +1 -1
  19. package/dist/generated/models/CovalAgentsAPISimulatorType.d.ts +4 -0
  20. package/dist/generated/models/CovalAgentsAPISimulatorType.d.ts.map +1 -1
  21. package/dist/generated/models/CovalAgentsAPISimulatorType.js +4 -0
  22. package/dist/generated/models/CovalAgentsAPISimulatorType.js.map +1 -1
  23. package/dist/generated/models/CovalConversationsAPIPatchConversationRequest.d.ts +27 -4
  24. package/dist/generated/models/CovalConversationsAPIPatchConversationRequest.d.ts.map +1 -1
  25. package/dist/generated/models/CovalConversationsAPIPatchConversationRequest.js +2 -0
  26. package/dist/generated/models/CovalConversationsAPIPatchConversationRequest.js.map +1 -1
  27. package/dist/generated/models/CovalOrganizationAPIConversationMetricRule.d.ts +2 -1
  28. package/dist/generated/models/CovalOrganizationAPIConversationMetricRule.d.ts.map +1 -1
  29. package/dist/generated/models/CovalOrganizationAPIConversationMetricRule.js +2 -1
  30. package/dist/generated/models/CovalOrganizationAPIConversationMetricRule.js.map +1 -1
  31. package/dist/generated/models/CovalOrganizationAPIConversationMetricRuleMetadataValue.d.ts +1 -1
  32. package/dist/generated/models/CovalReportsAPIError.d.ts +1 -0
  33. package/dist/generated/models/CovalReportsAPIError.d.ts.map +1 -1
  34. package/dist/generated/models/CovalReportsAPIError.js +1 -0
  35. package/dist/generated/models/CovalReportsAPIError.js.map +1 -1
  36. package/dist/generated/models/CovalReportsAPIGetReportResponse.d.ts +3 -3
  37. package/dist/generated/models/CovalReportsAPIGetReportResponse.d.ts.map +1 -1
  38. package/dist/generated/models/CovalReportsAPIGetReportResponse.js +3 -3
  39. package/dist/generated/models/CovalReportsAPIGetReportResponse.js.map +1 -1
  40. package/dist/generated/models/CovalReportsAPIMonitoringFiltersConfiguration.d.ts +45 -0
  41. package/dist/generated/models/CovalReportsAPIMonitoringFiltersConfiguration.d.ts.map +1 -0
  42. package/dist/generated/models/CovalReportsAPIMonitoringFiltersConfiguration.js +52 -0
  43. package/dist/generated/models/CovalReportsAPIMonitoringFiltersConfiguration.js.map +1 -0
  44. package/dist/generated/models/CovalReportsAPIMonitoringFiltersPatch.d.ts +45 -0
  45. package/dist/generated/models/CovalReportsAPIMonitoringFiltersPatch.d.ts.map +1 -0
  46. package/dist/generated/models/CovalReportsAPIMonitoringFiltersPatch.js +46 -0
  47. package/dist/generated/models/CovalReportsAPIMonitoringFiltersPatch.js.map +1 -0
  48. package/dist/generated/models/CovalReportsAPIReportDetail.d.ts +126 -0
  49. package/dist/generated/models/CovalReportsAPIReportDetail.d.ts.map +1 -0
  50. package/dist/generated/models/CovalReportsAPIReportDetail.js +104 -0
  51. package/dist/generated/models/CovalReportsAPIReportDetail.js.map +1 -0
  52. package/dist/generated/models/CovalReportsAPIReportMetricConfigurationEntry.d.ts +40 -0
  53. package/dist/generated/models/CovalReportsAPIReportMetricConfigurationEntry.d.ts.map +1 -0
  54. package/dist/generated/models/CovalReportsAPIReportMetricConfigurationEntry.js +46 -0
  55. package/dist/generated/models/CovalReportsAPIReportMetricConfigurationEntry.js.map +1 -0
  56. package/dist/generated/models/CovalReportsAPIReportMetricOutput.d.ts +1 -1
  57. package/dist/generated/models/CovalReportsAPIReportMetricOutput.d.ts.map +1 -1
  58. package/dist/generated/models/CovalReportsAPIReportMetricOutputValue.d.ts +3 -8
  59. package/dist/generated/models/CovalReportsAPIReportMetricOutputValue.d.ts.map +1 -1
  60. package/dist/generated/models/CovalReportsAPIReportMetricOutputValue.js +30 -8
  61. package/dist/generated/models/CovalReportsAPIReportMetricOutputValue.js.map +1 -1
  62. package/dist/generated/models/CovalReportsAPIReportViewConfiguration.d.ts +104 -0
  63. package/dist/generated/models/CovalReportsAPIReportViewConfiguration.d.ts.map +1 -0
  64. package/dist/generated/models/CovalReportsAPIReportViewConfiguration.js +100 -0
  65. package/dist/generated/models/CovalReportsAPIReportViewConfiguration.js.map +1 -0
  66. package/dist/generated/models/CovalReportsAPIReportViewConfigurationPatch.d.ts +104 -0
  67. package/dist/generated/models/CovalReportsAPIReportViewConfigurationPatch.d.ts.map +1 -0
  68. package/dist/generated/models/CovalReportsAPIReportViewConfigurationPatch.js +84 -0
  69. package/dist/generated/models/CovalReportsAPIReportViewConfigurationPatch.js.map +1 -0
  70. package/dist/generated/models/CovalReportsAPIUpdateReportRequest.d.ts +10 -0
  71. package/dist/generated/models/CovalReportsAPIUpdateReportRequest.d.ts.map +1 -1
  72. package/dist/generated/models/CovalReportsAPIUpdateReportRequest.js +3 -0
  73. package/dist/generated/models/CovalReportsAPIUpdateReportRequest.js.map +1 -1
  74. package/dist/generated/models/CovalReportsAPIUpdateReportResponse.d.ts +3 -3
  75. package/dist/generated/models/CovalReportsAPIUpdateReportResponse.d.ts.map +1 -1
  76. package/dist/generated/models/CovalReportsAPIUpdateReportResponse.js +3 -3
  77. package/dist/generated/models/CovalReportsAPIUpdateReportResponse.js.map +1 -1
  78. package/dist/generated/models/TracesAPITraceSearchAggregateStats.d.ts +39 -0
  79. package/dist/generated/models/TracesAPITraceSearchAggregateStats.d.ts.map +1 -0
  80. package/dist/generated/models/TracesAPITraceSearchAggregateStats.js +48 -0
  81. package/dist/generated/models/TracesAPITraceSearchAggregateStats.js.map +1 -0
  82. package/dist/generated/models/TracesAPITraceSearchAttributeFilter.d.ts +58 -0
  83. package/dist/generated/models/TracesAPITraceSearchAttributeFilter.d.ts.map +1 -0
  84. package/dist/generated/models/TracesAPITraceSearchAttributeFilter.js +60 -0
  85. package/dist/generated/models/TracesAPITraceSearchAttributeFilter.js.map +1 -0
  86. package/dist/generated/models/TracesAPITraceSearchCallResult.d.ts +120 -0
  87. package/dist/generated/models/TracesAPITraceSearchCallResult.d.ts.map +1 -0
  88. package/dist/generated/models/TracesAPITraceSearchCallResult.js +96 -0
  89. package/dist/generated/models/TracesAPITraceSearchCallResult.js.map +1 -0
  90. package/dist/generated/models/TracesAPITraceSearchFilters.d.ts +113 -0
  91. package/dist/generated/models/TracesAPITraceSearchFilters.d.ts.map +1 -0
  92. package/dist/generated/models/TracesAPITraceSearchFilters.js +80 -0
  93. package/dist/generated/models/TracesAPITraceSearchFilters.js.map +1 -0
  94. package/dist/generated/models/TracesAPITraceSearchRequest.d.ts +46 -0
  95. package/dist/generated/models/TracesAPITraceSearchRequest.d.ts.map +1 -0
  96. package/dist/generated/models/TracesAPITraceSearchRequest.js +47 -0
  97. package/dist/generated/models/TracesAPITraceSearchRequest.js.map +1 -0
  98. package/dist/generated/models/TracesAPITraceSearchResponse.d.ts +53 -0
  99. package/dist/generated/models/TracesAPITraceSearchResponse.d.ts.map +1 -0
  100. package/dist/generated/models/TracesAPITraceSearchResponse.js +56 -0
  101. package/dist/generated/models/TracesAPITraceSearchResponse.js.map +1 -0
  102. package/dist/generated/models/index.d.ts +12 -0
  103. package/dist/generated/models/index.d.ts.map +1 -1
  104. package/dist/generated/models/index.js +12 -0
  105. package/dist/generated/models/index.js.map +1 -1
  106. package/dist/index.d.ts +2 -0
  107. package/dist/index.d.ts.map +1 -1
  108. package/dist/index.js +1 -0
  109. package/dist/index.js.map +1 -1
  110. package/dist/retry.d.ts +5 -0
  111. package/dist/retry.d.ts.map +1 -1
  112. package/dist/retry.js +20 -0
  113. package/dist/retry.js.map +1 -1
  114. package/dist/stats.d.ts +13 -0
  115. package/dist/stats.d.ts.map +1 -0
  116. package/dist/stats.js +13 -0
  117. package/dist/stats.js.map +1 -0
  118. package/package.json +1 -1
  119. package/src/CovalClient.ts +20 -1
  120. package/src/generated/apis/ConversationsApi.ts +8 -8
  121. package/src/generated/apis/ReportsApi.ts +21 -14
  122. package/src/generated/apis/TracesApi.ts +84 -0
  123. package/src/generated/models/CovalAgentsAPICreateAgentRequest.ts +23 -0
  124. package/src/generated/models/CovalAgentsAPISimulatorType.ts +4 -0
  125. package/src/generated/models/CovalConversationsAPIPatchConversationRequest.ts +27 -4
  126. package/src/generated/models/CovalOrganizationAPIConversationMetricRule.ts +3 -2
  127. package/src/generated/models/CovalOrganizationAPIConversationMetricRuleMetadataValue.ts +1 -1
  128. package/src/generated/models/CovalReportsAPIError.ts +1 -0
  129. package/src/generated/models/CovalReportsAPIGetReportResponse.ts +10 -10
  130. package/src/generated/models/CovalReportsAPIMonitoringFiltersConfiguration.ts +84 -0
  131. package/src/generated/models/CovalReportsAPIMonitoringFiltersPatch.ts +81 -0
  132. package/src/generated/models/CovalReportsAPIReportDetail.ts +204 -0
  133. package/src/generated/models/CovalReportsAPIReportMetricConfigurationEntry.ts +76 -0
  134. package/src/generated/models/CovalReportsAPIReportMetricOutput.ts +1 -1
  135. package/src/generated/models/CovalReportsAPIReportMetricOutputValue.ts +33 -14
  136. package/src/generated/models/CovalReportsAPIReportViewConfiguration.ts +167 -0
  137. package/src/generated/models/CovalReportsAPIReportViewConfigurationPatch.ts +158 -0
  138. package/src/generated/models/CovalReportsAPIUpdateReportRequest.ts +18 -0
  139. package/src/generated/models/CovalReportsAPIUpdateReportResponse.ts +10 -10
  140. package/src/generated/models/TracesAPITraceSearchAggregateStats.ts +75 -0
  141. package/src/generated/models/TracesAPITraceSearchAttributeFilter.ts +98 -0
  142. package/src/generated/models/TracesAPITraceSearchCallResult.ts +191 -0
  143. package/src/generated/models/TracesAPITraceSearchFilters.ts +176 -0
  144. package/src/generated/models/TracesAPITraceSearchRequest.ts +89 -0
  145. package/src/generated/models/TracesAPITraceSearchResponse.ts +107 -0
  146. package/src/generated/models/index.ts +12 -0
  147. package/src/index.ts +2 -0
  148. package/src/retry.ts +24 -0
  149. package/src/stats.ts +25 -0
@@ -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
+ *
18
+ * @export
19
+ * @interface CovalReportsAPIMonitoringFiltersPatch
20
+ */
21
+ export interface CovalReportsAPIMonitoringFiltersPatch {
22
+ /**
23
+ * Inclusive cohort start. Send null to clear the saved bound.
24
+ * @type {Date}
25
+ * @memberof CovalReportsAPIMonitoringFiltersPatch
26
+ */
27
+ start_date?: Date | null;
28
+ /**
29
+ * Inclusive cohort end. Send null to clear the saved bound.
30
+ * @type {Date}
31
+ * @memberof CovalReportsAPIMonitoringFiltersPatch
32
+ */
33
+ end_date?: Date | null;
34
+ /**
35
+ * Select monitoring (`true`) or simulation (`false`) summaries.
36
+ * @type {boolean}
37
+ * @memberof CovalReportsAPIMonitoringFiltersPatch
38
+ */
39
+ monitoring_filter?: boolean;
40
+ }
41
+
42
+ /**
43
+ * Check if a given object implements the CovalReportsAPIMonitoringFiltersPatch interface.
44
+ */
45
+ export function instanceOfCovalReportsAPIMonitoringFiltersPatch(value: object): value is CovalReportsAPIMonitoringFiltersPatch {
46
+ return true;
47
+ }
48
+
49
+ export function CovalReportsAPIMonitoringFiltersPatchFromJSON(json: any): CovalReportsAPIMonitoringFiltersPatch {
50
+ return CovalReportsAPIMonitoringFiltersPatchFromJSONTyped(json, false);
51
+ }
52
+
53
+ export function CovalReportsAPIMonitoringFiltersPatchFromJSONTyped(json: any, ignoreDiscriminator: boolean): CovalReportsAPIMonitoringFiltersPatch {
54
+ if (json == null) {
55
+ return json;
56
+ }
57
+ return {
58
+
59
+ 'start_date': json['start_date'] == null ? undefined : (new Date(json['start_date'])),
60
+ 'end_date': json['end_date'] == null ? undefined : (new Date(json['end_date'])),
61
+ 'monitoring_filter': json['monitoring_filter'] == null ? undefined : json['monitoring_filter'],
62
+ };
63
+ }
64
+
65
+ export function CovalReportsAPIMonitoringFiltersPatchToJSON(json: any): CovalReportsAPIMonitoringFiltersPatch {
66
+ return CovalReportsAPIMonitoringFiltersPatchToJSONTyped(json, false);
67
+ }
68
+
69
+ export function CovalReportsAPIMonitoringFiltersPatchToJSONTyped(value?: CovalReportsAPIMonitoringFiltersPatch | null, ignoreDiscriminator: boolean = false): any {
70
+ if (value == null) {
71
+ return value;
72
+ }
73
+
74
+ return {
75
+
76
+ 'start_date': value['start_date'] == null ? value['start_date'] : value['start_date'].toISOString(),
77
+ 'end_date': value['end_date'] == null ? value['end_date'] : value['end_date'].toISOString(),
78
+ 'monitoring_filter': value['monitoring_filter'],
79
+ };
80
+ }
81
+
@@ -0,0 +1,204 @@
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 { CovalReportsAPIReportViewConfiguration } from './CovalReportsAPIReportViewConfiguration.js';
17
+ import {
18
+ CovalReportsAPIReportViewConfigurationFromJSON,
19
+ CovalReportsAPIReportViewConfigurationFromJSONTyped,
20
+ CovalReportsAPIReportViewConfigurationToJSON,
21
+ CovalReportsAPIReportViewConfigurationToJSONTyped,
22
+ } from './CovalReportsAPIReportViewConfiguration.js';
23
+ import type { CovalReportsAPIReportMetricConfigurationEntry } from './CovalReportsAPIReportMetricConfigurationEntry.js';
24
+ import {
25
+ CovalReportsAPIReportMetricConfigurationEntryFromJSON,
26
+ CovalReportsAPIReportMetricConfigurationEntryFromJSONTyped,
27
+ CovalReportsAPIReportMetricConfigurationEntryToJSON,
28
+ CovalReportsAPIReportMetricConfigurationEntryToJSONTyped,
29
+ } from './CovalReportsAPIReportMetricConfigurationEntry.js';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface CovalReportsAPIReportDetail
35
+ */
36
+ export interface CovalReportsAPIReportDetail {
37
+ /**
38
+ * The report's ULID.
39
+ * @type {string}
40
+ * @memberof CovalReportsAPIReportDetail
41
+ */
42
+ id: string;
43
+ /**
44
+ * Display name for the saved report.
45
+ * @type {string}
46
+ * @memberof CovalReportsAPIReportDetail
47
+ */
48
+ name: string;
49
+ /**
50
+ * Empty for a dynamic monitoring report.
51
+ * @type {Array<string>}
52
+ * @memberof CovalReportsAPIReportDetail
53
+ */
54
+ run_ids: Array<string>;
55
+ /**
56
+ *
57
+ * @type {Array<string>}
58
+ * @memberof CovalReportsAPIReportDetail
59
+ */
60
+ simulation_output_ids?: Array<string>;
61
+ /**
62
+ *
63
+ * @type {string}
64
+ * @memberof CovalReportsAPIReportDetail
65
+ */
66
+ source_human_review_project_id?: string | null;
67
+ /**
68
+ *
69
+ * @type {CovalReportsAPIReportDetailCompareByEnum}
70
+ * @memberof CovalReportsAPIReportDetail
71
+ */
72
+ compare_by: CovalReportsAPIReportDetailCompareByEnum;
73
+ /**
74
+ *
75
+ * @type {string}
76
+ * @memberof CovalReportsAPIReportDetail
77
+ */
78
+ metadata_key?: string | null;
79
+ /**
80
+ *
81
+ * @type {CovalReportsAPIReportDetailPermissionsEnum}
82
+ * @memberof CovalReportsAPIReportDetail
83
+ */
84
+ permissions: CovalReportsAPIReportDetailPermissionsEnum;
85
+ /**
86
+ * Last report mutation time.
87
+ * @type {Date}
88
+ * @memberof CovalReportsAPIReportDetail
89
+ */
90
+ updated_at: Date;
91
+ /**
92
+ * Opaque revision also returned as the response `ETag`. Send the
93
+ * quoted ETag value in `If-Match` for `view_config` updates.
94
+ *
95
+ * @type {string}
96
+ * @memberof CovalReportsAPIReportDetail
97
+ */
98
+ revision: string;
99
+ /**
100
+ *
101
+ * @type {CovalReportsAPIReportViewConfiguration}
102
+ * @memberof CovalReportsAPIReportDetail
103
+ */
104
+ view_config: CovalReportsAPIReportViewConfiguration;
105
+ /**
106
+ * Saved per-metric display configuration keyed by metric ID.
107
+ * @type {{ [key: string]: CovalReportsAPIReportMetricConfigurationEntry; }}
108
+ * @memberof CovalReportsAPIReportDetail
109
+ */
110
+ metric_config: { [key: string]: CovalReportsAPIReportMetricConfigurationEntry; };
111
+ }
112
+
113
+
114
+ /**
115
+ * @export
116
+ */
117
+ export const CovalReportsAPIReportDetailCompareByEnum = {
118
+ None: 'none',
119
+ Run: 'run',
120
+ Agent: 'agent',
121
+ Mutation: 'mutation',
122
+ Persona: 'persona',
123
+ TestCase: 'test_case',
124
+ Metadata: 'metadata'
125
+ } as const;
126
+ export type CovalReportsAPIReportDetailCompareByEnum = typeof CovalReportsAPIReportDetailCompareByEnum[keyof typeof CovalReportsAPIReportDetailCompareByEnum];
127
+
128
+ /**
129
+ * @export
130
+ */
131
+ export const CovalReportsAPIReportDetailPermissionsEnum = {
132
+ Public: 'PUBLIC',
133
+ Private: 'PRIVATE'
134
+ } as const;
135
+ export type CovalReportsAPIReportDetailPermissionsEnum = typeof CovalReportsAPIReportDetailPermissionsEnum[keyof typeof CovalReportsAPIReportDetailPermissionsEnum];
136
+
137
+
138
+ /**
139
+ * Check if a given object implements the CovalReportsAPIReportDetail interface.
140
+ */
141
+ export function instanceOfCovalReportsAPIReportDetail(value: object): value is CovalReportsAPIReportDetail {
142
+ if (!('id' in value) || value['id'] === undefined) return false;
143
+ if (!('name' in value) || value['name'] === undefined) return false;
144
+ if (!('run_ids' in value) || value['run_ids'] === undefined) return false;
145
+ if (!('compare_by' in value) || value['compare_by'] === undefined) return false;
146
+ if (!('permissions' in value) || value['permissions'] === undefined) return false;
147
+ if (!('updated_at' in value) || value['updated_at'] === undefined) return false;
148
+ if (!('revision' in value) || value['revision'] === undefined) return false;
149
+ if (!('view_config' in value) || value['view_config'] === undefined) return false;
150
+ if (!('metric_config' in value) || value['metric_config'] === undefined) return false;
151
+ return true;
152
+ }
153
+
154
+ export function CovalReportsAPIReportDetailFromJSON(json: any): CovalReportsAPIReportDetail {
155
+ return CovalReportsAPIReportDetailFromJSONTyped(json, false);
156
+ }
157
+
158
+ export function CovalReportsAPIReportDetailFromJSONTyped(json: any, ignoreDiscriminator: boolean): CovalReportsAPIReportDetail {
159
+ if (json == null) {
160
+ return json;
161
+ }
162
+ return {
163
+
164
+ 'id': json['id'],
165
+ 'name': json['name'],
166
+ 'run_ids': json['run_ids'],
167
+ 'simulation_output_ids': json['simulation_output_ids'] == null ? undefined : json['simulation_output_ids'],
168
+ 'source_human_review_project_id': json['source_human_review_project_id'] == null ? undefined : json['source_human_review_project_id'],
169
+ 'compare_by': json['compare_by'],
170
+ 'metadata_key': json['metadata_key'] == null ? undefined : json['metadata_key'],
171
+ 'permissions': json['permissions'],
172
+ 'updated_at': (new Date(json['updated_at'])),
173
+ 'revision': json['revision'],
174
+ 'view_config': CovalReportsAPIReportViewConfigurationFromJSON(json['view_config']),
175
+ 'metric_config': (mapValues(json['metric_config'], CovalReportsAPIReportMetricConfigurationEntryFromJSON)),
176
+ };
177
+ }
178
+
179
+ export function CovalReportsAPIReportDetailToJSON(json: any): CovalReportsAPIReportDetail {
180
+ return CovalReportsAPIReportDetailToJSONTyped(json, false);
181
+ }
182
+
183
+ export function CovalReportsAPIReportDetailToJSONTyped(value?: CovalReportsAPIReportDetail | null, ignoreDiscriminator: boolean = false): any {
184
+ if (value == null) {
185
+ return value;
186
+ }
187
+
188
+ return {
189
+
190
+ 'id': value['id'],
191
+ 'name': value['name'],
192
+ 'run_ids': value['run_ids'],
193
+ 'simulation_output_ids': value['simulation_output_ids'],
194
+ 'source_human_review_project_id': value['source_human_review_project_id'],
195
+ 'compare_by': value['compare_by'],
196
+ 'metadata_key': value['metadata_key'],
197
+ 'permissions': value['permissions'],
198
+ 'updated_at': value['updated_at'].toISOString(),
199
+ 'revision': value['revision'],
200
+ 'view_config': CovalReportsAPIReportViewConfigurationToJSON(value['view_config']),
201
+ 'metric_config': (mapValues(value['metric_config'], CovalReportsAPIReportMetricConfigurationEntryToJSON)),
202
+ };
203
+ }
204
+
@@ -0,0 +1,76 @@
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 CovalReportsAPIReportMetricConfigurationEntry
20
+ */
21
+ export interface CovalReportsAPIReportMetricConfigurationEntry {
22
+ [key: string]: any | any;
23
+ /**
24
+ * Whether the metric is visible in the report.
25
+ * @type {boolean}
26
+ * @memberof CovalReportsAPIReportMetricConfigurationEntry
27
+ */
28
+ visible?: boolean;
29
+ /**
30
+ * Optional report-specific passing threshold.
31
+ * @type {number}
32
+ * @memberof CovalReportsAPIReportMetricConfigurationEntry
33
+ */
34
+ passing_threshold?: number | null;
35
+ }
36
+
37
+ /**
38
+ * Check if a given object implements the CovalReportsAPIReportMetricConfigurationEntry interface.
39
+ */
40
+ export function instanceOfCovalReportsAPIReportMetricConfigurationEntry(value: object): value is CovalReportsAPIReportMetricConfigurationEntry {
41
+ return true;
42
+ }
43
+
44
+ export function CovalReportsAPIReportMetricConfigurationEntryFromJSON(json: any): CovalReportsAPIReportMetricConfigurationEntry {
45
+ return CovalReportsAPIReportMetricConfigurationEntryFromJSONTyped(json, false);
46
+ }
47
+
48
+ export function CovalReportsAPIReportMetricConfigurationEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): CovalReportsAPIReportMetricConfigurationEntry {
49
+ if (json == null) {
50
+ return json;
51
+ }
52
+ return {
53
+
54
+ ...json,
55
+ 'visible': json['visible'] == null ? undefined : json['visible'],
56
+ 'passing_threshold': json['passing_threshold'] == null ? undefined : json['passing_threshold'],
57
+ };
58
+ }
59
+
60
+ export function CovalReportsAPIReportMetricConfigurationEntryToJSON(json: any): CovalReportsAPIReportMetricConfigurationEntry {
61
+ return CovalReportsAPIReportMetricConfigurationEntryToJSONTyped(json, false);
62
+ }
63
+
64
+ export function CovalReportsAPIReportMetricConfigurationEntryToJSONTyped(value?: CovalReportsAPIReportMetricConfigurationEntry | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+
69
+ return {
70
+
71
+ ...value,
72
+ 'visible': value['visible'],
73
+ 'passing_threshold': value['passing_threshold'],
74
+ };
75
+ }
76
+
@@ -50,7 +50,7 @@ export interface CovalReportsAPIReportMetricOutput {
50
50
  * @type {CovalReportsAPIReportMetricOutputValue}
51
51
  * @memberof CovalReportsAPIReportMetricOutput
52
52
  */
53
- value?: CovalReportsAPIReportMetricOutputValue | null;
53
+ value?: CovalReportsAPIReportMetricOutputValue;
54
54
  /**
55
55
  *
56
56
  * @type {string}
@@ -12,35 +12,54 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
 
15
- import { mapValues } from '../runtime.js';
16
15
  /**
16
+ * @type CovalReportsAPIReportMetricOutputValue
17
17
  * Metric value (float, string, or list of strings).
18
18
  * @export
19
- * @interface CovalReportsAPIReportMetricOutputValue
20
19
  */
21
- export interface CovalReportsAPIReportMetricOutputValue {
22
- }
23
-
24
- /**
25
- * Check if a given object implements the CovalReportsAPIReportMetricOutputValue interface.
26
- */
27
- export function instanceOfCovalReportsAPIReportMetricOutputValue(value: object): value is CovalReportsAPIReportMetricOutputValue {
28
- return true;
29
- }
20
+ export type CovalReportsAPIReportMetricOutputValue = Array<string> | number | string;
30
21
 
31
22
  export function CovalReportsAPIReportMetricOutputValueFromJSON(json: any): CovalReportsAPIReportMetricOutputValue {
32
23
  return CovalReportsAPIReportMetricOutputValueFromJSONTyped(json, false);
33
24
  }
34
25
 
35
26
  export function CovalReportsAPIReportMetricOutputValueFromJSONTyped(json: any, ignoreDiscriminator: boolean): CovalReportsAPIReportMetricOutputValue {
36
- return json;
27
+ if (json == null) {
28
+ return json;
29
+ }
30
+ if (Array.isArray(json)) {
31
+ if (json.every(item => typeof item === 'string')) {
32
+ return json;
33
+ }
34
+ }
35
+ if (typeof json === 'number') {
36
+ return json;
37
+ }
38
+ if (typeof json === 'string') {
39
+ return json;
40
+ }
41
+ return {} as any;
37
42
  }
38
43
 
39
- export function CovalReportsAPIReportMetricOutputValueToJSON(json: any): CovalReportsAPIReportMetricOutputValue {
44
+ export function CovalReportsAPIReportMetricOutputValueToJSON(json: any): any {
40
45
  return CovalReportsAPIReportMetricOutputValueToJSONTyped(json, false);
41
46
  }
42
47
 
43
48
  export function CovalReportsAPIReportMetricOutputValueToJSONTyped(value?: CovalReportsAPIReportMetricOutputValue | null, ignoreDiscriminator: boolean = false): any {
44
- return value;
49
+ if (value == null) {
50
+ return value;
51
+ }
52
+ if (Array.isArray(value)) {
53
+ if (value.every(item => typeof item === 'string')) {
54
+ return value;
55
+ }
56
+ }
57
+ if (typeof value === 'number') {
58
+ return value;
59
+ }
60
+ if (typeof value === 'string') {
61
+ return value;
62
+ }
63
+ return {};
45
64
  }
46
65
 
@@ -0,0 +1,167 @@
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 { CovalReportsAPIMonitoringFiltersConfiguration } from './CovalReportsAPIMonitoringFiltersConfiguration.js';
17
+ import {
18
+ CovalReportsAPIMonitoringFiltersConfigurationFromJSON,
19
+ CovalReportsAPIMonitoringFiltersConfigurationFromJSONTyped,
20
+ CovalReportsAPIMonitoringFiltersConfigurationToJSON,
21
+ CovalReportsAPIMonitoringFiltersConfigurationToJSONTyped,
22
+ } from './CovalReportsAPIMonitoringFiltersConfiguration.js';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface CovalReportsAPIReportViewConfiguration
28
+ */
29
+ export interface CovalReportsAPIReportViewConfiguration {
30
+ /**
31
+ * True when rows are resolved dynamically from monitoring data.
32
+ * @type {boolean}
33
+ * @memberof CovalReportsAPIReportViewConfiguration
34
+ */
35
+ is_monitoring: boolean;
36
+ /**
37
+ *
38
+ * @type {CovalReportsAPIReportViewConfigurationCompareByEnum}
39
+ * @memberof CovalReportsAPIReportViewConfiguration
40
+ */
41
+ compare_by: CovalReportsAPIReportViewConfigurationCompareByEnum;
42
+ /**
43
+ * Required when `compare_by` is `metadata`; null otherwise.
44
+ * @type {string}
45
+ * @memberof CovalReportsAPIReportViewConfiguration
46
+ */
47
+ metadata_key: string | null;
48
+ /**
49
+ *
50
+ * @type {CovalReportsAPIReportViewConfigurationViewModeEnum}
51
+ * @memberof CovalReportsAPIReportViewConfiguration
52
+ */
53
+ view_mode: CovalReportsAPIReportViewConfigurationViewModeEnum;
54
+ /**
55
+ *
56
+ * @type {CovalReportsAPIReportViewConfigurationSecondaryCompareByEnum}
57
+ * @memberof CovalReportsAPIReportViewConfiguration
58
+ */
59
+ secondary_compare_by: CovalReportsAPIReportViewConfigurationSecondaryCompareByEnum;
60
+ /**
61
+ * Required when `secondary_compare_by` is `metadata`; null otherwise.
62
+ * @type {string}
63
+ * @memberof CovalReportsAPIReportViewConfiguration
64
+ */
65
+ secondary_metadata_key: string | null;
66
+ /**
67
+ * Saved supported cohort filters; null for reports without monitoring filters.
68
+ * @type {CovalReportsAPIMonitoringFiltersConfiguration}
69
+ * @memberof CovalReportsAPIReportViewConfiguration
70
+ */
71
+ monitoring_filters: CovalReportsAPIMonitoringFiltersConfiguration | null;
72
+ }
73
+
74
+
75
+ /**
76
+ * @export
77
+ */
78
+ export const CovalReportsAPIReportViewConfigurationCompareByEnum = {
79
+ None: 'none',
80
+ Run: 'run',
81
+ Agent: 'agent',
82
+ Mutation: 'mutation',
83
+ Persona: 'persona',
84
+ TestCase: 'test_case',
85
+ Metadata: 'metadata'
86
+ } as const;
87
+ export type CovalReportsAPIReportViewConfigurationCompareByEnum = typeof CovalReportsAPIReportViewConfigurationCompareByEnum[keyof typeof CovalReportsAPIReportViewConfigurationCompareByEnum];
88
+
89
+ /**
90
+ * @export
91
+ */
92
+ export const CovalReportsAPIReportViewConfigurationViewModeEnum = {
93
+ Rows: 'rows',
94
+ Grouped: 'grouped'
95
+ } as const;
96
+ export type CovalReportsAPIReportViewConfigurationViewModeEnum = typeof CovalReportsAPIReportViewConfigurationViewModeEnum[keyof typeof CovalReportsAPIReportViewConfigurationViewModeEnum];
97
+
98
+ /**
99
+ * @export
100
+ */
101
+ export const CovalReportsAPIReportViewConfigurationSecondaryCompareByEnum = {
102
+ None: 'none',
103
+ Run: 'run',
104
+ Agent: 'agent',
105
+ Mutation: 'mutation',
106
+ Persona: 'persona',
107
+ TestCase: 'test_case',
108
+ Metadata: 'metadata'
109
+ } as const;
110
+ export type CovalReportsAPIReportViewConfigurationSecondaryCompareByEnum = typeof CovalReportsAPIReportViewConfigurationSecondaryCompareByEnum[keyof typeof CovalReportsAPIReportViewConfigurationSecondaryCompareByEnum];
111
+
112
+
113
+ /**
114
+ * Check if a given object implements the CovalReportsAPIReportViewConfiguration interface.
115
+ */
116
+ export function instanceOfCovalReportsAPIReportViewConfiguration(value: object): value is CovalReportsAPIReportViewConfiguration {
117
+ if (!('is_monitoring' in value) || value['is_monitoring'] === undefined) return false;
118
+ if (!('compare_by' in value) || value['compare_by'] === undefined) return false;
119
+ if (!('metadata_key' in value) || value['metadata_key'] === undefined) return false;
120
+ if (!('view_mode' in value) || value['view_mode'] === undefined) return false;
121
+ if (!('secondary_compare_by' in value) || value['secondary_compare_by'] === undefined) return false;
122
+ if (!('secondary_metadata_key' in value) || value['secondary_metadata_key'] === undefined) return false;
123
+ if (!('monitoring_filters' in value) || value['monitoring_filters'] === undefined) return false;
124
+ return true;
125
+ }
126
+
127
+ export function CovalReportsAPIReportViewConfigurationFromJSON(json: any): CovalReportsAPIReportViewConfiguration {
128
+ return CovalReportsAPIReportViewConfigurationFromJSONTyped(json, false);
129
+ }
130
+
131
+ export function CovalReportsAPIReportViewConfigurationFromJSONTyped(json: any, ignoreDiscriminator: boolean): CovalReportsAPIReportViewConfiguration {
132
+ if (json == null) {
133
+ return json;
134
+ }
135
+ return {
136
+
137
+ 'is_monitoring': json['is_monitoring'],
138
+ 'compare_by': json['compare_by'],
139
+ 'metadata_key': json['metadata_key'],
140
+ 'view_mode': json['view_mode'],
141
+ 'secondary_compare_by': json['secondary_compare_by'],
142
+ 'secondary_metadata_key': json['secondary_metadata_key'],
143
+ 'monitoring_filters': CovalReportsAPIMonitoringFiltersConfigurationFromJSON(json['monitoring_filters']),
144
+ };
145
+ }
146
+
147
+ export function CovalReportsAPIReportViewConfigurationToJSON(json: any): CovalReportsAPIReportViewConfiguration {
148
+ return CovalReportsAPIReportViewConfigurationToJSONTyped(json, false);
149
+ }
150
+
151
+ export function CovalReportsAPIReportViewConfigurationToJSONTyped(value?: CovalReportsAPIReportViewConfiguration | null, ignoreDiscriminator: boolean = false): any {
152
+ if (value == null) {
153
+ return value;
154
+ }
155
+
156
+ return {
157
+
158
+ 'is_monitoring': value['is_monitoring'],
159
+ 'compare_by': value['compare_by'],
160
+ 'metadata_key': value['metadata_key'],
161
+ 'view_mode': value['view_mode'],
162
+ 'secondary_compare_by': value['secondary_compare_by'],
163
+ 'secondary_metadata_key': value['secondary_metadata_key'],
164
+ 'monitoring_filters': CovalReportsAPIMonitoringFiltersConfigurationToJSON(value['monitoring_filters']),
165
+ };
166
+ }
167
+