openlayer 0.7.0 → 0.8.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.
Files changed (155) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +50 -40
  3. package/_shims/node-runtime.d.ts.map +1 -1
  4. package/_shims/node-runtime.js +2 -3
  5. package/_shims/node-runtime.js.map +1 -1
  6. package/_shims/node-runtime.mjs +1 -1
  7. package/_shims/node-runtime.mjs.map +1 -1
  8. package/_shims/node-types.d.ts +1 -1
  9. package/core.d.ts +9 -6
  10. package/core.d.ts.map +1 -1
  11. package/core.js +31 -9
  12. package/core.js.map +1 -1
  13. package/core.mjs +28 -7
  14. package/core.mjs.map +1 -1
  15. package/error.d.ts +1 -1
  16. package/error.d.ts.map +1 -1
  17. package/error.js +1 -1
  18. package/error.js.map +1 -1
  19. package/error.mjs +1 -1
  20. package/error.mjs.map +1 -1
  21. package/index.d.mts +14 -17
  22. package/index.d.ts +14 -17
  23. package/index.d.ts.map +1 -1
  24. package/index.js +28 -11
  25. package/index.js.map +1 -1
  26. package/index.mjs +12 -10
  27. package/index.mjs.map +1 -1
  28. package/lib/core/openai-monitor.d.ts +3 -3
  29. package/lib/core/openai-monitor.d.ts.map +1 -1
  30. package/lib/core/openai-monitor.js.map +1 -1
  31. package/lib/core/openai-monitor.mjs.map +1 -1
  32. package/package.json +3 -3
  33. package/resources/commits/commits.d.ts +2 -3
  34. package/resources/commits/commits.d.ts.map +1 -1
  35. package/resources/commits/commits.js +2 -3
  36. package/resources/commits/commits.js.map +1 -1
  37. package/resources/commits/commits.mjs +2 -3
  38. package/resources/commits/commits.mjs.map +1 -1
  39. package/resources/commits/index.d.ts +1 -1
  40. package/resources/commits/index.d.ts.map +1 -1
  41. package/resources/commits/index.js.map +1 -1
  42. package/resources/commits/index.mjs.map +1 -1
  43. package/resources/commits/test-results.d.ts +1 -22
  44. package/resources/commits/test-results.d.ts.map +1 -1
  45. package/resources/commits/test-results.js +0 -2
  46. package/resources/commits/test-results.js.map +1 -1
  47. package/resources/commits/test-results.mjs +0 -2
  48. package/resources/commits/test-results.mjs.map +1 -1
  49. package/resources/index.d.ts +2 -2
  50. package/resources/index.d.ts.map +1 -1
  51. package/resources/index.js.map +1 -1
  52. package/resources/index.mjs.map +1 -1
  53. package/resources/inference-pipelines/data.d.ts +1 -3
  54. package/resources/inference-pipelines/data.d.ts.map +1 -1
  55. package/resources/inference-pipelines/data.js +0 -2
  56. package/resources/inference-pipelines/data.js.map +1 -1
  57. package/resources/inference-pipelines/data.mjs +0 -2
  58. package/resources/inference-pipelines/data.mjs.map +1 -1
  59. package/resources/inference-pipelines/index.d.ts +4 -4
  60. package/resources/inference-pipelines/index.d.ts.map +1 -1
  61. package/resources/inference-pipelines/index.js.map +1 -1
  62. package/resources/inference-pipelines/index.mjs.map +1 -1
  63. package/resources/inference-pipelines/inference-pipelines.d.ts +7 -13
  64. package/resources/inference-pipelines/inference-pipelines.d.ts.map +1 -1
  65. package/resources/inference-pipelines/inference-pipelines.js +6 -5
  66. package/resources/inference-pipelines/inference-pipelines.js.map +1 -1
  67. package/resources/inference-pipelines/inference-pipelines.mjs +6 -5
  68. package/resources/inference-pipelines/inference-pipelines.mjs.map +1 -1
  69. package/resources/inference-pipelines/rows.d.ts +1 -3
  70. package/resources/inference-pipelines/rows.d.ts.map +1 -1
  71. package/resources/inference-pipelines/rows.js +0 -2
  72. package/resources/inference-pipelines/rows.js.map +1 -1
  73. package/resources/inference-pipelines/rows.mjs +0 -2
  74. package/resources/inference-pipelines/rows.mjs.map +1 -1
  75. package/resources/inference-pipelines/test-results.d.ts +1 -22
  76. package/resources/inference-pipelines/test-results.d.ts.map +1 -1
  77. package/resources/inference-pipelines/test-results.js +0 -2
  78. package/resources/inference-pipelines/test-results.js.map +1 -1
  79. package/resources/inference-pipelines/test-results.mjs +0 -2
  80. package/resources/inference-pipelines/test-results.mjs.map +1 -1
  81. package/resources/projects/commits.d.ts +150 -16
  82. package/resources/projects/commits.d.ts.map +1 -1
  83. package/resources/projects/commits.js +6 -2
  84. package/resources/projects/commits.js.map +1 -1
  85. package/resources/projects/commits.mjs +6 -2
  86. package/resources/projects/commits.mjs.map +1 -1
  87. package/resources/projects/index.d.ts +3 -3
  88. package/resources/projects/index.d.ts.map +1 -1
  89. package/resources/projects/index.js.map +1 -1
  90. package/resources/projects/index.mjs +1 -1
  91. package/resources/projects/index.mjs.map +1 -1
  92. package/resources/projects/inference-pipelines.d.ts +1 -24
  93. package/resources/projects/inference-pipelines.d.ts.map +1 -1
  94. package/resources/projects/inference-pipelines.js +0 -2
  95. package/resources/projects/inference-pipelines.js.map +1 -1
  96. package/resources/projects/inference-pipelines.mjs +0 -2
  97. package/resources/projects/inference-pipelines.mjs.map +1 -1
  98. package/resources/projects/projects.d.ts +5 -32
  99. package/resources/projects/projects.d.ts.map +1 -1
  100. package/resources/projects/projects.js +4 -4
  101. package/resources/projects/projects.js.map +1 -1
  102. package/resources/projects/projects.mjs +4 -4
  103. package/resources/projects/projects.mjs.map +1 -1
  104. package/resources/storage/index.d.ts +1 -1
  105. package/resources/storage/index.d.ts.map +1 -1
  106. package/resources/storage/index.js.map +1 -1
  107. package/resources/storage/index.mjs +1 -1
  108. package/resources/storage/index.mjs.map +1 -1
  109. package/resources/storage/presigned-url.d.ts +2 -4
  110. package/resources/storage/presigned-url.d.ts.map +1 -1
  111. package/resources/storage/presigned-url.js +0 -2
  112. package/resources/storage/presigned-url.js.map +1 -1
  113. package/resources/storage/presigned-url.mjs +0 -2
  114. package/resources/storage/presigned-url.mjs.map +1 -1
  115. package/resources/storage/storage.d.ts +2 -3
  116. package/resources/storage/storage.d.ts.map +1 -1
  117. package/resources/storage/storage.js +2 -3
  118. package/resources/storage/storage.js.map +1 -1
  119. package/resources/storage/storage.mjs +2 -3
  120. package/resources/storage/storage.mjs.map +1 -1
  121. package/shims/node.d.ts +1 -0
  122. package/shims/node.d.ts.map +1 -1
  123. package/src/_shims/node-runtime.ts +1 -3
  124. package/src/_shims/node-types.d.ts +1 -1
  125. package/src/core.ts +44 -13
  126. package/src/error.ts +3 -3
  127. package/src/index.ts +48 -26
  128. package/src/lib/core/openai-monitor.ts +3 -3
  129. package/src/lib/integrations/openAiTracer.ts +1 -1
  130. package/src/resources/commits/commits.ts +9 -4
  131. package/src/resources/commits/index.ts +1 -1
  132. package/src/resources/commits/test-results.ts +5 -28
  133. package/src/resources/index.ts +7 -7
  134. package/src/resources/inference-pipelines/data.ts +2 -4
  135. package/src/resources/inference-pipelines/index.ts +6 -6
  136. package/src/resources/inference-pipelines/inference-pipelines.ts +31 -14
  137. package/src/resources/inference-pipelines/rows.ts +2 -4
  138. package/src/resources/inference-pipelines/test-results.ts +5 -28
  139. package/src/resources/projects/commits.ts +192 -17
  140. package/src/resources/projects/index.ts +15 -9
  141. package/src/resources/projects/inference-pipelines.ts +7 -30
  142. package/src/resources/projects/projects.ts +40 -38
  143. package/src/resources/storage/index.ts +5 -1
  144. package/src/resources/storage/presigned-url.ts +6 -5
  145. package/src/resources/storage/storage.ts +9 -4
  146. package/src/uploads.ts +11 -4
  147. package/src/version.ts +1 -1
  148. package/uploads.d.ts.map +1 -1
  149. package/uploads.js +10 -4
  150. package/uploads.js.map +1 -1
  151. package/uploads.mjs +10 -4
  152. package/uploads.mjs.map +1 -1
  153. package/version.d.ts +1 -1
  154. package/version.js +1 -1
  155. package/version.mjs +1 -1
package/src/index.ts CHANGED
@@ -1,10 +1,25 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import * as Errors from './error';
4
- import * as Uploads from './uploads';
5
3
  import { type Agent } from './_shims/index';
6
4
  import * as Core from './core';
5
+ import * as Errors from './error';
6
+ import * as Uploads from './uploads';
7
7
  import * as API from './resources/index';
8
+ import { Commits } from './resources/commits/commits';
9
+ import {
10
+ InferencePipelineRetrieveResponse,
11
+ InferencePipelineUpdateParams,
12
+ InferencePipelineUpdateResponse,
13
+ InferencePipelines,
14
+ } from './resources/inference-pipelines/inference-pipelines';
15
+ import {
16
+ ProjectCreateParams,
17
+ ProjectCreateResponse,
18
+ ProjectListParams,
19
+ ProjectListResponse,
20
+ Projects,
21
+ } from './resources/projects/projects';
22
+ import { Storage } from './resources/storage/storage';
8
23
 
9
24
  export interface ClientOptions {
10
25
  /**
@@ -150,6 +165,7 @@ export class Openlayer extends Core.APIClient {
150
165
  }
151
166
 
152
167
  static Openlayer = this;
168
+ static DEFAULT_TIMEOUT = 60000; // 1 minute
153
169
 
154
170
  static OpenlayerError = Errors.OpenlayerError;
155
171
  static APIError = Errors.APIError;
@@ -169,7 +185,35 @@ export class Openlayer extends Core.APIClient {
169
185
  static fileFromPath = Uploads.fileFromPath;
170
186
  }
171
187
 
172
- export const {
188
+ Openlayer.Projects = Projects;
189
+ Openlayer.Commits = Commits;
190
+ Openlayer.InferencePipelines = InferencePipelines;
191
+ Openlayer.Storage = Storage;
192
+ export declare namespace Openlayer {
193
+ export type RequestOptions = Core.RequestOptions;
194
+
195
+ export {
196
+ Projects as Projects,
197
+ type ProjectCreateResponse as ProjectCreateResponse,
198
+ type ProjectListResponse as ProjectListResponse,
199
+ type ProjectCreateParams as ProjectCreateParams,
200
+ type ProjectListParams as ProjectListParams,
201
+ };
202
+
203
+ export { Commits as Commits };
204
+
205
+ export {
206
+ InferencePipelines as InferencePipelines,
207
+ type InferencePipelineRetrieveResponse as InferencePipelineRetrieveResponse,
208
+ type InferencePipelineUpdateResponse as InferencePipelineUpdateResponse,
209
+ type InferencePipelineUpdateParams as InferencePipelineUpdateParams,
210
+ };
211
+
212
+ export { Storage as Storage };
213
+ }
214
+
215
+ export { toFile, fileFromPath } from './uploads';
216
+ export {
173
217
  OpenlayerError,
174
218
  APIError,
175
219
  APIConnectionError,
@@ -183,28 +227,6 @@ export const {
183
227
  InternalServerError,
184
228
  PermissionDeniedError,
185
229
  UnprocessableEntityError,
186
- } = Errors;
187
-
188
- export import toFile = Uploads.toFile;
189
- export import fileFromPath = Uploads.fileFromPath;
190
-
191
- export namespace Openlayer {
192
- export import RequestOptions = Core.RequestOptions;
193
-
194
- export import Projects = API.Projects;
195
- export import ProjectCreateResponse = API.ProjectCreateResponse;
196
- export import ProjectListResponse = API.ProjectListResponse;
197
- export import ProjectCreateParams = API.ProjectCreateParams;
198
- export import ProjectListParams = API.ProjectListParams;
199
-
200
- export import Commits = API.Commits;
201
-
202
- export import InferencePipelines = API.InferencePipelines;
203
- export import InferencePipelineRetrieveResponse = API.InferencePipelineRetrieveResponse;
204
- export import InferencePipelineUpdateResponse = API.InferencePipelineUpdateResponse;
205
- export import InferencePipelineUpdateParams = API.InferencePipelineUpdateParams;
206
-
207
- export import Storage = API.Storage;
208
- }
230
+ } from './error';
209
231
 
210
232
  export default Openlayer;
@@ -213,7 +213,7 @@ class OpenAIMonitor {
213
213
  public createChatCompletion = async (
214
214
  body: ChatCompletionCreateParams,
215
215
  options?: RequestOptions,
216
- additionalLogs?: Openlayer.RequestOptions<any> | undefined,
216
+ additionalLogs?: Openlayer.RequestOptions | undefined,
217
217
  ): Promise<ChatCompletion | Stream<ChatCompletionChunk>> => {
218
218
  // Start a timer to measure latency
219
219
  const startTime = Date.now();
@@ -309,7 +309,7 @@ class OpenAIMonitor {
309
309
  public createCompletion = async (
310
310
  body: CompletionCreateParams,
311
311
  options?: RequestOptions,
312
- additionalLogs?: Openlayer.RequestOptions<any> | undefined,
312
+ additionalLogs?: Openlayer.RequestOptions | undefined,
313
313
  ): Promise<Completion | Stream<Completion>> => {
314
314
  if (!body.prompt) {
315
315
  console.error('No prompt provided.');
@@ -407,7 +407,7 @@ class OpenAIMonitor {
407
407
  * @param {Openlayer.RequestOptions<any> | undefined} [additionalLogs] - Optional metadata logs to include with the request sent to Openlayer.
408
408
  * @returns {Promise<void>} A promise that resolves when the run data has been successfully published to Openlayer.
409
409
  */
410
- public async monitorThreadRun(run: Run, additionalLogs?: Openlayer.RequestOptions<any> | undefined) {
410
+ public async monitorThreadRun(run: Run, additionalLogs?: Openlayer.RequestOptions | undefined) {
411
411
  if (run.status !== 'completed' || this.openlayerInferencePipelineId.length === 0) {
412
412
  return;
413
413
  }
@@ -1,5 +1,5 @@
1
1
  import OpenAI from 'openai';
2
- import { Stream } from 'openai/src/streaming';
2
+ import { Stream } from 'openai/streaming';
3
3
  import { addChatCompletionStepToTrace } from '../tracing/tracer';
4
4
 
5
5
  export function traceOpenAI(openai: OpenAI): OpenAI {
@@ -2,13 +2,18 @@
2
2
 
3
3
  import { APIResource } from '../../resource';
4
4
  import * as TestResultsAPI from './test-results';
5
+ import { TestResultListParams, TestResultListResponse, TestResults } from './test-results';
5
6
 
6
7
  export class Commits extends APIResource {
7
8
  testResults: TestResultsAPI.TestResults = new TestResultsAPI.TestResults(this._client);
8
9
  }
9
10
 
10
- export namespace Commits {
11
- export import TestResults = TestResultsAPI.TestResults;
12
- export import TestResultListResponse = TestResultsAPI.TestResultListResponse;
13
- export import TestResultListParams = TestResultsAPI.TestResultListParams;
11
+ Commits.TestResults = TestResults;
12
+
13
+ export declare namespace Commits {
14
+ export {
15
+ TestResults as TestResults,
16
+ type TestResultListResponse as TestResultListResponse,
17
+ type TestResultListParams as TestResultListParams,
18
+ };
14
19
  }
@@ -1,4 +1,4 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  export { Commits } from './commits';
4
- export { TestResultListResponse, TestResultListParams, TestResults } from './test-results';
4
+ export { TestResults, type TestResultListResponse, type TestResultListParams } from './test-results';
@@ -3,7 +3,6 @@
3
3
  import { APIResource } from '../../resource';
4
4
  import { isRequestOptions } from '../../core';
5
5
  import * as Core from '../../core';
6
- import * as TestResultsAPI from './test-results';
7
6
 
8
7
  export class TestResults extends APIResource {
9
8
  /**
@@ -28,34 +27,10 @@ export class TestResults extends APIResource {
28
27
  }
29
28
 
30
29
  export interface TestResultListResponse {
31
- _meta: TestResultListResponse._Meta;
32
-
33
30
  items: Array<TestResultListResponse.Item>;
34
31
  }
35
32
 
36
33
  export namespace TestResultListResponse {
37
- export interface _Meta {
38
- /**
39
- * The current page.
40
- */
41
- page: number;
42
-
43
- /**
44
- * The number of items per page.
45
- */
46
- perPage: number;
47
-
48
- /**
49
- * The total number of items.
50
- */
51
- totalItems: number;
52
-
53
- /**
54
- * The total number of pages.
55
- */
56
- totalPages: number;
57
- }
58
-
59
34
  export interface Item {
60
35
  /**
61
36
  * Project version (commit) id.
@@ -278,7 +253,9 @@ export interface TestResultListParams {
278
253
  type?: 'integrity' | 'consistency' | 'performance' | 'fairness' | 'robustness';
279
254
  }
280
255
 
281
- export namespace TestResults {
282
- export import TestResultListResponse = TestResultsAPI.TestResultListResponse;
283
- export import TestResultListParams = TestResultsAPI.TestResultListParams;
256
+ export declare namespace TestResults {
257
+ export {
258
+ type TestResultListResponse as TestResultListResponse,
259
+ type TestResultListParams as TestResultListParams,
260
+ };
284
261
  }
@@ -2,16 +2,16 @@
2
2
 
3
3
  export { Commits } from './commits/commits';
4
4
  export {
5
- InferencePipelineRetrieveResponse,
6
- InferencePipelineUpdateResponse,
7
- InferencePipelineUpdateParams,
8
5
  InferencePipelines,
6
+ type InferencePipelineRetrieveResponse,
7
+ type InferencePipelineUpdateResponse,
8
+ type InferencePipelineUpdateParams,
9
9
  } from './inference-pipelines/inference-pipelines';
10
10
  export {
11
- ProjectCreateResponse,
12
- ProjectListResponse,
13
- ProjectCreateParams,
14
- ProjectListParams,
15
11
  Projects,
12
+ type ProjectCreateResponse,
13
+ type ProjectListResponse,
14
+ type ProjectCreateParams,
15
+ type ProjectListParams,
16
16
  } from './projects/projects';
17
17
  export { Storage } from './storage/storage';
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { APIResource } from '../../resource';
4
4
  import * as Core from '../../core';
5
- import * as DataAPI from './data';
6
5
 
7
6
  export class Data extends APIResource {
8
7
  /**
@@ -279,7 +278,6 @@ export namespace DataStreamParams {
279
278
  }
280
279
  }
281
280
 
282
- export namespace Data {
283
- export import DataStreamResponse = DataAPI.DataStreamResponse;
284
- export import DataStreamParams = DataAPI.DataStreamParams;
281
+ export declare namespace Data {
282
+ export { type DataStreamResponse as DataStreamResponse, type DataStreamParams as DataStreamParams };
285
283
  }
@@ -1,11 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { DataStreamResponse, DataStreamParams, Data } from './data';
3
+ export { Data, type DataStreamResponse, type DataStreamParams } from './data';
4
4
  export {
5
- InferencePipelineRetrieveResponse,
6
- InferencePipelineUpdateResponse,
7
- InferencePipelineUpdateParams,
8
5
  InferencePipelines,
6
+ type InferencePipelineRetrieveResponse,
7
+ type InferencePipelineUpdateResponse,
8
+ type InferencePipelineUpdateParams,
9
9
  } from './inference-pipelines';
10
- export { RowUpdateResponse, RowUpdateParams, Rows } from './rows';
11
- export { TestResultListResponse, TestResultListParams, TestResults } from './test-results';
10
+ export { Rows, type RowUpdateResponse, type RowUpdateParams } from './rows';
11
+ export { TestResults, type TestResultListResponse, type TestResultListParams } from './test-results';
@@ -3,10 +3,12 @@
3
3
  import { APIResource } from '../../resource';
4
4
  import { isRequestOptions } from '../../core';
5
5
  import * as Core from '../../core';
6
- import * as InferencePipelinesAPI from './inference-pipelines';
7
6
  import * as DataAPI from './data';
7
+ import { Data, DataStreamParams, DataStreamResponse } from './data';
8
8
  import * as RowsAPI from './rows';
9
+ import { RowUpdateParams, RowUpdateResponse, Rows } from './rows';
9
10
  import * as TestResultsAPI from './test-results';
11
+ import { TestResultListParams, TestResultListResponse, TestResults } from './test-results';
10
12
 
11
13
  export class InferencePipelines extends APIResource {
12
14
  data: DataAPI.Data = new DataAPI.Data(this._client);
@@ -235,17 +237,32 @@ export interface InferencePipelineUpdateParams {
235
237
  referenceDatasetUri?: string | null;
236
238
  }
237
239
 
238
- export namespace InferencePipelines {
239
- export import InferencePipelineRetrieveResponse = InferencePipelinesAPI.InferencePipelineRetrieveResponse;
240
- export import InferencePipelineUpdateResponse = InferencePipelinesAPI.InferencePipelineUpdateResponse;
241
- export import InferencePipelineUpdateParams = InferencePipelinesAPI.InferencePipelineUpdateParams;
242
- export import Data = DataAPI.Data;
243
- export import DataStreamResponse = DataAPI.DataStreamResponse;
244
- export import DataStreamParams = DataAPI.DataStreamParams;
245
- export import Rows = RowsAPI.Rows;
246
- export import RowUpdateResponse = RowsAPI.RowUpdateResponse;
247
- export import RowUpdateParams = RowsAPI.RowUpdateParams;
248
- export import TestResults = TestResultsAPI.TestResults;
249
- export import TestResultListResponse = TestResultsAPI.TestResultListResponse;
250
- export import TestResultListParams = TestResultsAPI.TestResultListParams;
240
+ InferencePipelines.Data = Data;
241
+ InferencePipelines.Rows = Rows;
242
+ InferencePipelines.TestResults = TestResults;
243
+
244
+ export declare namespace InferencePipelines {
245
+ export {
246
+ type InferencePipelineRetrieveResponse as InferencePipelineRetrieveResponse,
247
+ type InferencePipelineUpdateResponse as InferencePipelineUpdateResponse,
248
+ type InferencePipelineUpdateParams as InferencePipelineUpdateParams,
249
+ };
250
+
251
+ export {
252
+ Data as Data,
253
+ type DataStreamResponse as DataStreamResponse,
254
+ type DataStreamParams as DataStreamParams,
255
+ };
256
+
257
+ export {
258
+ Rows as Rows,
259
+ type RowUpdateResponse as RowUpdateResponse,
260
+ type RowUpdateParams as RowUpdateParams,
261
+ };
262
+
263
+ export {
264
+ TestResults as TestResults,
265
+ type TestResultListResponse as TestResultListResponse,
266
+ type TestResultListParams as TestResultListParams,
267
+ };
251
268
  }
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { APIResource } from '../../resource';
4
4
  import * as Core from '../../core';
5
- import * as RowsAPI from './rows';
6
5
 
7
6
  export class Rows extends APIResource {
8
7
  /**
@@ -75,7 +74,6 @@ export namespace RowUpdateParams {
75
74
  }
76
75
  }
77
76
 
78
- export namespace Rows {
79
- export import RowUpdateResponse = RowsAPI.RowUpdateResponse;
80
- export import RowUpdateParams = RowsAPI.RowUpdateParams;
77
+ export declare namespace Rows {
78
+ export { type RowUpdateResponse as RowUpdateResponse, type RowUpdateParams as RowUpdateParams };
81
79
  }
@@ -3,7 +3,6 @@
3
3
  import { APIResource } from '../../resource';
4
4
  import { isRequestOptions } from '../../core';
5
5
  import * as Core from '../../core';
6
- import * as TestResultsAPI from './test-results';
7
6
 
8
7
  export class TestResults extends APIResource {
9
8
  /**
@@ -28,34 +27,10 @@ export class TestResults extends APIResource {
28
27
  }
29
28
 
30
29
  export interface TestResultListResponse {
31
- _meta: TestResultListResponse._Meta;
32
-
33
30
  items: Array<TestResultListResponse.Item>;
34
31
  }
35
32
 
36
33
  export namespace TestResultListResponse {
37
- export interface _Meta {
38
- /**
39
- * The current page.
40
- */
41
- page: number;
42
-
43
- /**
44
- * The number of items per page.
45
- */
46
- perPage: number;
47
-
48
- /**
49
- * The total number of items.
50
- */
51
- totalItems: number;
52
-
53
- /**
54
- * The total number of pages.
55
- */
56
- totalPages: number;
57
- }
58
-
59
34
  export interface Item {
60
35
  /**
61
36
  * Project version (commit) id.
@@ -273,7 +248,9 @@ export interface TestResultListParams {
273
248
  type?: 'integrity' | 'consistency' | 'performance' | 'fairness' | 'robustness';
274
249
  }
275
250
 
276
- export namespace TestResults {
277
- export import TestResultListResponse = TestResultsAPI.TestResultListResponse;
278
- export import TestResultListParams = TestResultsAPI.TestResultListParams;
251
+ export declare namespace TestResults {
252
+ export {
253
+ type TestResultListResponse as TestResultListResponse,
254
+ type TestResultListParams as TestResultListParams,
255
+ };
279
256
  }
@@ -3,9 +3,19 @@
3
3
  import { APIResource } from '../../resource';
4
4
  import { isRequestOptions } from '../../core';
5
5
  import * as Core from '../../core';
6
- import * as CommitsAPI from './commits';
7
6
 
8
7
  export class Commits extends APIResource {
8
+ /**
9
+ * Create a new commit (project version) in a project.
10
+ */
11
+ create(
12
+ projectId: string,
13
+ body: CommitCreateParams,
14
+ options?: Core.RequestOptions,
15
+ ): Core.APIPromise<CommitCreateResponse> {
16
+ return this._client.post(`/projects/${projectId}/versions`, { body, ...options });
17
+ }
18
+
9
19
  /**
10
20
  * List the commits (project versions) in a project.
11
21
  */
@@ -27,35 +37,162 @@ export class Commits extends APIResource {
27
37
  }
28
38
  }
29
39
 
30
- export interface CommitListResponse {
31
- _meta: CommitListResponse._Meta;
40
+ export interface CommitCreateResponse {
41
+ /**
42
+ * The project version (commit) id.
43
+ */
44
+ id: string;
32
45
 
33
- items: Array<CommitListResponse.Item>;
46
+ /**
47
+ * The details of a commit (project version).
48
+ */
49
+ commit: CommitCreateResponse.Commit;
50
+
51
+ /**
52
+ * The commit archive date.
53
+ */
54
+ dateArchived: string | null;
55
+
56
+ /**
57
+ * The project version (commit) creation date.
58
+ */
59
+ dateCreated: string;
60
+
61
+ /**
62
+ * The number of tests that are failing for the commit.
63
+ */
64
+ failingGoalCount: number;
65
+
66
+ /**
67
+ * The model id.
68
+ */
69
+ mlModelId: string | null;
70
+
71
+ /**
72
+ * The number of tests that are passing for the commit.
73
+ */
74
+ passingGoalCount: number;
75
+
76
+ /**
77
+ * The project id.
78
+ */
79
+ projectId: string;
80
+
81
+ /**
82
+ * The commit status. Initially, the commit is `queued`, then, it switches to
83
+ * `running`. Finally, it can be `paused`, `failed`, or `completed`.
84
+ */
85
+ status: 'queued' | 'running' | 'paused' | 'failed' | 'completed' | 'unknown';
86
+
87
+ /**
88
+ * The commit status message.
89
+ */
90
+ statusMessage: string | null;
91
+
92
+ /**
93
+ * The total number of tests for the commit.
94
+ */
95
+ totalGoalCount: number;
96
+
97
+ /**
98
+ * The training dataset id.
99
+ */
100
+ trainingDatasetId: string | null;
101
+
102
+ /**
103
+ * The validation dataset id.
104
+ */
105
+ validationDatasetId: string | null;
106
+
107
+ /**
108
+ * Whether the commit is archived.
109
+ */
110
+ archived?: boolean | null;
111
+
112
+ /**
113
+ * The deployment status associated with the commit's model.
114
+ */
115
+ deploymentStatus?: string;
116
+
117
+ links?: CommitCreateResponse.Links;
34
118
  }
35
119
 
36
- export namespace CommitListResponse {
37
- export interface _Meta {
120
+ export namespace CommitCreateResponse {
121
+ /**
122
+ * The details of a commit (project version).
123
+ */
124
+ export interface Commit {
125
+ /**
126
+ * The commit id.
127
+ */
128
+ id: string;
129
+
130
+ /**
131
+ * The author id of the commit.
132
+ */
133
+ authorId: string;
134
+
135
+ /**
136
+ * The size of the commit bundle in bytes.
137
+ */
138
+ fileSize: number | null;
139
+
140
+ /**
141
+ * The commit message.
142
+ */
143
+ message: string;
144
+
145
+ /**
146
+ * The model id.
147
+ */
148
+ mlModelId: string | null;
149
+
150
+ /**
151
+ * The storage URI where the commit bundle is stored.
152
+ */
153
+ storageUri: string;
154
+
155
+ /**
156
+ * The training dataset id.
157
+ */
158
+ trainingDatasetId: string | null;
159
+
160
+ /**
161
+ * The validation dataset id.
162
+ */
163
+ validationDatasetId: string | null;
164
+
38
165
  /**
39
- * The current page.
166
+ * The commit creation date.
40
167
  */
41
- page: number;
168
+ dateCreated?: string;
42
169
 
43
170
  /**
44
- * The number of items per page.
171
+ * The ref of the corresponding git commit.
45
172
  */
46
- perPage: number;
173
+ gitCommitRef?: string;
47
174
 
48
175
  /**
49
- * The total number of items.
176
+ * The SHA of the corresponding git commit.
50
177
  */
51
- totalItems: number;
178
+ gitCommitSha?: number;
52
179
 
53
180
  /**
54
- * The total number of pages.
181
+ * The URL of the corresponding git commit.
55
182
  */
56
- totalPages: number;
183
+ gitCommitUrl?: string;
57
184
  }
58
185
 
186
+ export interface Links {
187
+ app: string;
188
+ }
189
+ }
190
+
191
+ export interface CommitListResponse {
192
+ items: Array<CommitListResponse.Item>;
193
+ }
194
+
195
+ export namespace CommitListResponse {
59
196
  export interface Item {
60
197
  /**
61
198
  * The project version (commit) id.
@@ -208,6 +345,40 @@ export namespace CommitListResponse {
208
345
  }
209
346
  }
210
347
 
348
+ export interface CommitCreateParams {
349
+ /**
350
+ * The details of a commit (project version).
351
+ */
352
+ commit: CommitCreateParams.Commit;
353
+
354
+ /**
355
+ * The storage URI where the commit bundle is stored.
356
+ */
357
+ storageUri: string;
358
+
359
+ /**
360
+ * Whether the commit is archived.
361
+ */
362
+ archived?: boolean | null;
363
+
364
+ /**
365
+ * The deployment status associated with the commit's model.
366
+ */
367
+ deploymentStatus?: string;
368
+ }
369
+
370
+ export namespace CommitCreateParams {
371
+ /**
372
+ * The details of a commit (project version).
373
+ */
374
+ export interface Commit {
375
+ /**
376
+ * The commit message.
377
+ */
378
+ message: string;
379
+ }
380
+ }
381
+
211
382
  export interface CommitListParams {
212
383
  /**
213
384
  * The page to return in a paginated query.
@@ -220,7 +391,11 @@ export interface CommitListParams {
220
391
  perPage?: number;
221
392
  }
222
393
 
223
- export namespace Commits {
224
- export import CommitListResponse = CommitsAPI.CommitListResponse;
225
- export import CommitListParams = CommitsAPI.CommitListParams;
394
+ export declare namespace Commits {
395
+ export {
396
+ type CommitCreateResponse as CommitCreateResponse,
397
+ type CommitListResponse as CommitListResponse,
398
+ type CommitCreateParams as CommitCreateParams,
399
+ type CommitListParams as CommitListParams,
400
+ };
226
401
  }