openlayer 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/CHANGELOG.md +56 -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/lib/tracing/tracer.js +1 -1
  33. package/lib/tracing/tracer.js.map +1 -1
  34. package/lib/tracing/tracer.mjs +1 -1
  35. package/lib/tracing/tracer.mjs.map +1 -1
  36. package/package.json +3 -3
  37. package/resources/commits/commits.d.ts +2 -3
  38. package/resources/commits/commits.d.ts.map +1 -1
  39. package/resources/commits/commits.js +2 -3
  40. package/resources/commits/commits.js.map +1 -1
  41. package/resources/commits/commits.mjs +2 -3
  42. package/resources/commits/commits.mjs.map +1 -1
  43. package/resources/commits/index.d.ts +1 -1
  44. package/resources/commits/index.d.ts.map +1 -1
  45. package/resources/commits/index.js.map +1 -1
  46. package/resources/commits/index.mjs.map +1 -1
  47. package/resources/commits/test-results.d.ts +1 -22
  48. package/resources/commits/test-results.d.ts.map +1 -1
  49. package/resources/commits/test-results.js +0 -2
  50. package/resources/commits/test-results.js.map +1 -1
  51. package/resources/commits/test-results.mjs +0 -2
  52. package/resources/commits/test-results.mjs.map +1 -1
  53. package/resources/index.d.ts +2 -2
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/index.js.map +1 -1
  56. package/resources/index.mjs.map +1 -1
  57. package/resources/inference-pipelines/data.d.ts +1 -3
  58. package/resources/inference-pipelines/data.d.ts.map +1 -1
  59. package/resources/inference-pipelines/data.js +0 -2
  60. package/resources/inference-pipelines/data.js.map +1 -1
  61. package/resources/inference-pipelines/data.mjs +0 -2
  62. package/resources/inference-pipelines/data.mjs.map +1 -1
  63. package/resources/inference-pipelines/index.d.ts +4 -4
  64. package/resources/inference-pipelines/index.d.ts.map +1 -1
  65. package/resources/inference-pipelines/index.js.map +1 -1
  66. package/resources/inference-pipelines/index.mjs.map +1 -1
  67. package/resources/inference-pipelines/inference-pipelines.d.ts +7 -13
  68. package/resources/inference-pipelines/inference-pipelines.d.ts.map +1 -1
  69. package/resources/inference-pipelines/inference-pipelines.js +6 -5
  70. package/resources/inference-pipelines/inference-pipelines.js.map +1 -1
  71. package/resources/inference-pipelines/inference-pipelines.mjs +6 -5
  72. package/resources/inference-pipelines/inference-pipelines.mjs.map +1 -1
  73. package/resources/inference-pipelines/rows.d.ts +1 -3
  74. package/resources/inference-pipelines/rows.d.ts.map +1 -1
  75. package/resources/inference-pipelines/rows.js +0 -2
  76. package/resources/inference-pipelines/rows.js.map +1 -1
  77. package/resources/inference-pipelines/rows.mjs +0 -2
  78. package/resources/inference-pipelines/rows.mjs.map +1 -1
  79. package/resources/inference-pipelines/test-results.d.ts +1 -22
  80. package/resources/inference-pipelines/test-results.d.ts.map +1 -1
  81. package/resources/inference-pipelines/test-results.js +0 -2
  82. package/resources/inference-pipelines/test-results.js.map +1 -1
  83. package/resources/inference-pipelines/test-results.mjs +0 -2
  84. package/resources/inference-pipelines/test-results.mjs.map +1 -1
  85. package/resources/projects/commits.d.ts +150 -16
  86. package/resources/projects/commits.d.ts.map +1 -1
  87. package/resources/projects/commits.js +6 -2
  88. package/resources/projects/commits.js.map +1 -1
  89. package/resources/projects/commits.mjs +6 -2
  90. package/resources/projects/commits.mjs.map +1 -1
  91. package/resources/projects/index.d.ts +3 -3
  92. package/resources/projects/index.d.ts.map +1 -1
  93. package/resources/projects/index.js.map +1 -1
  94. package/resources/projects/index.mjs +1 -1
  95. package/resources/projects/index.mjs.map +1 -1
  96. package/resources/projects/inference-pipelines.d.ts +1 -24
  97. package/resources/projects/inference-pipelines.d.ts.map +1 -1
  98. package/resources/projects/inference-pipelines.js +0 -2
  99. package/resources/projects/inference-pipelines.js.map +1 -1
  100. package/resources/projects/inference-pipelines.mjs +0 -2
  101. package/resources/projects/inference-pipelines.mjs.map +1 -1
  102. package/resources/projects/projects.d.ts +5 -32
  103. package/resources/projects/projects.d.ts.map +1 -1
  104. package/resources/projects/projects.js +4 -4
  105. package/resources/projects/projects.js.map +1 -1
  106. package/resources/projects/projects.mjs +4 -4
  107. package/resources/projects/projects.mjs.map +1 -1
  108. package/resources/storage/index.d.ts +1 -1
  109. package/resources/storage/index.d.ts.map +1 -1
  110. package/resources/storage/index.js.map +1 -1
  111. package/resources/storage/index.mjs +1 -1
  112. package/resources/storage/index.mjs.map +1 -1
  113. package/resources/storage/presigned-url.d.ts +2 -4
  114. package/resources/storage/presigned-url.d.ts.map +1 -1
  115. package/resources/storage/presigned-url.js +0 -2
  116. package/resources/storage/presigned-url.js.map +1 -1
  117. package/resources/storage/presigned-url.mjs +0 -2
  118. package/resources/storage/presigned-url.mjs.map +1 -1
  119. package/resources/storage/storage.d.ts +2 -3
  120. package/resources/storage/storage.d.ts.map +1 -1
  121. package/resources/storage/storage.js +2 -3
  122. package/resources/storage/storage.js.map +1 -1
  123. package/resources/storage/storage.mjs +2 -3
  124. package/resources/storage/storage.mjs.map +1 -1
  125. package/shims/node.d.ts +1 -0
  126. package/shims/node.d.ts.map +1 -1
  127. package/src/_shims/node-runtime.ts +1 -3
  128. package/src/_shims/node-types.d.ts +1 -1
  129. package/src/core.ts +44 -13
  130. package/src/error.ts +3 -3
  131. package/src/index.ts +48 -26
  132. package/src/lib/core/openai-monitor.ts +3 -3
  133. package/src/lib/integrations/openAiTracer.ts +1 -1
  134. package/src/lib/tracing/tracer.ts +1 -1
  135. package/src/resources/commits/commits.ts +9 -4
  136. package/src/resources/commits/index.ts +1 -1
  137. package/src/resources/commits/test-results.ts +5 -28
  138. package/src/resources/index.ts +7 -7
  139. package/src/resources/inference-pipelines/data.ts +2 -4
  140. package/src/resources/inference-pipelines/index.ts +6 -6
  141. package/src/resources/inference-pipelines/inference-pipelines.ts +31 -14
  142. package/src/resources/inference-pipelines/rows.ts +2 -4
  143. package/src/resources/inference-pipelines/test-results.ts +5 -28
  144. package/src/resources/projects/commits.ts +192 -17
  145. package/src/resources/projects/index.ts +15 -9
  146. package/src/resources/projects/inference-pipelines.ts +7 -30
  147. package/src/resources/projects/projects.ts +40 -38
  148. package/src/resources/storage/index.ts +5 -1
  149. package/src/resources/storage/presigned-url.ts +6 -5
  150. package/src/resources/storage/storage.ts +9 -4
  151. package/src/uploads.ts +11 -4
  152. package/src/version.ts +1 -1
  153. package/uploads.d.ts.map +1 -1
  154. package/uploads.js +10 -4
  155. package/uploads.js.map +1 -1
  156. package/uploads.mjs +10 -4
  157. package/uploads.mjs.map +1 -1
  158. package/version.d.ts +1 -1
  159. package/version.js +1 -1
  160. package/version.mjs +1 -1
package/src/core.ts CHANGED
@@ -84,8 +84,10 @@ export class APIPromise<T> extends Promise<T> {
84
84
  });
85
85
  }
86
86
 
87
- _thenUnwrap<U>(transform: (data: T) => U): APIPromise<U> {
88
- return new APIPromise(this.responsePromise, async (props) => transform(await this.parseResponse(props)));
87
+ _thenUnwrap<U>(transform: (data: T, props: APIResponseProps) => U): APIPromise<U> {
88
+ return new APIPromise(this.responsePromise, async (props) =>
89
+ transform(await this.parseResponse(props), props),
90
+ );
89
91
  }
90
92
 
91
93
  /**
@@ -274,7 +276,10 @@ export abstract class APIClient {
274
276
  return null;
275
277
  }
276
278
 
277
- buildRequest<Req>(options: FinalRequestOptions<Req>): { req: RequestInit; url: string; timeout: number } {
279
+ buildRequest<Req>(
280
+ options: FinalRequestOptions<Req>,
281
+ { retryCount = 0 }: { retryCount?: number } = {},
282
+ ): { req: RequestInit; url: string; timeout: number } {
278
283
  const { method, path, query, headers: headers = {} } = options;
279
284
 
280
285
  const body =
@@ -306,7 +311,7 @@ export abstract class APIClient {
306
311
  headers[this.idempotencyHeader] = options.idempotencyKey;
307
312
  }
308
313
 
309
- const reqHeaders = this.buildHeaders({ options, headers, contentLength });
314
+ const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
310
315
 
311
316
  const req: RequestInit = {
312
317
  method,
@@ -325,10 +330,12 @@ export abstract class APIClient {
325
330
  options,
326
331
  headers,
327
332
  contentLength,
333
+ retryCount,
328
334
  }: {
329
335
  options: FinalRequestOptions;
330
336
  headers: Record<string, string | null | undefined>;
331
337
  contentLength: string | null | undefined;
338
+ retryCount: number;
332
339
  }): Record<string, string> {
333
340
  const reqHeaders: Record<string, string> = {};
334
341
  if (contentLength) {
@@ -344,6 +351,16 @@ export abstract class APIClient {
344
351
  delete reqHeaders['content-type'];
345
352
  }
346
353
 
354
+ // Don't set the retry count header if it was already set or removed through default headers or by the
355
+ // caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to
356
+ // account for the removal case.
357
+ if (
358
+ getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined &&
359
+ getHeader(headers, 'x-stainless-retry-count') === undefined
360
+ ) {
361
+ reqHeaders['x-stainless-retry-count'] = String(retryCount);
362
+ }
363
+
347
364
  this.validateHeaders(reqHeaders, headers);
348
365
 
349
366
  return reqHeaders;
@@ -379,7 +396,7 @@ export abstract class APIClient {
379
396
  error: Object | undefined,
380
397
  message: string | undefined,
381
398
  headers: Headers | undefined,
382
- ) {
399
+ ): APIError {
383
400
  return APIError.generate(status, error, message, headers);
384
401
  }
385
402
 
@@ -395,13 +412,14 @@ export abstract class APIClient {
395
412
  retriesRemaining: number | null,
396
413
  ): Promise<APIResponseProps> {
397
414
  const options = await optionsInput;
415
+ const maxRetries = options.maxRetries ?? this.maxRetries;
398
416
  if (retriesRemaining == null) {
399
- retriesRemaining = options.maxRetries ?? this.maxRetries;
417
+ retriesRemaining = maxRetries;
400
418
  }
401
419
 
402
420
  await this.prepareOptions(options);
403
421
 
404
- const { req, url, timeout } = this.buildRequest(options);
422
+ const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining });
405
423
 
406
424
  await this.prepareRequest(req, { url, options });
407
425
 
@@ -650,9 +668,9 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
650
668
  return await this.#client.requestAPIList(this.constructor as any, nextOptions);
651
669
  }
652
670
 
653
- async *iterPages() {
671
+ async *iterPages(): AsyncGenerator<this> {
654
672
  // eslint-disable-next-line @typescript-eslint/no-this-alias
655
- let page: AbstractPage<Item> = this;
673
+ let page: this = this;
656
674
  yield page;
657
675
  while (page.hasNextPage()) {
658
676
  page = await page.getNextPage();
@@ -660,7 +678,7 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
660
678
  }
661
679
  }
662
680
 
663
- async *[Symbol.asyncIterator]() {
681
+ async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
664
682
  for await (const page of this.iterPages()) {
665
683
  for (const item of page.getPaginatedItems()) {
666
684
  yield item;
@@ -703,7 +721,7 @@ export class PagePromise<
703
721
  * console.log(item)
704
722
  * }
705
723
  */
706
- async *[Symbol.asyncIterator]() {
724
+ async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
707
725
  const page = await this;
708
726
  for await (const item of page) {
709
727
  yield item;
@@ -978,6 +996,11 @@ const validatePositiveInteger = (name: string, n: unknown): number => {
978
996
 
979
997
  export const castToError = (err: any): Error => {
980
998
  if (err instanceof Error) return err;
999
+ if (typeof err === 'object' && err !== null) {
1000
+ try {
1001
+ return new Error(JSON.stringify(err));
1002
+ } catch {}
1003
+ }
981
1004
  return new Error(err);
982
1005
  };
983
1006
 
@@ -1115,7 +1138,15 @@ export const isHeadersProtocol = (headers: any): headers is HeadersProtocol => {
1115
1138
  return typeof headers?.get === 'function';
1116
1139
  };
1117
1140
 
1118
- export const getRequiredHeader = (headers: HeadersLike, header: string): string => {
1141
+ export const getRequiredHeader = (headers: HeadersLike | Headers, header: string): string => {
1142
+ const foundHeader = getHeader(headers, header);
1143
+ if (foundHeader === undefined) {
1144
+ throw new Error(`Could not find ${header} header`);
1145
+ }
1146
+ return foundHeader;
1147
+ };
1148
+
1149
+ export const getHeader = (headers: HeadersLike | Headers, header: string): string | undefined => {
1119
1150
  const lowerCasedHeader = header.toLowerCase();
1120
1151
  if (isHeadersProtocol(headers)) {
1121
1152
  // to deal with the case where the header looks like Stainless-Event-Id
@@ -1141,7 +1172,7 @@ export const getRequiredHeader = (headers: HeadersLike, header: string): string
1141
1172
  }
1142
1173
  }
1143
1174
 
1144
- throw new Error(`Could not find ${header} header`);
1175
+ return undefined;
1145
1176
  };
1146
1177
 
1147
1178
  /**
package/src/error.ts CHANGED
@@ -47,9 +47,9 @@ export class APIError extends OpenlayerError {
47
47
  errorResponse: Object | undefined,
48
48
  message: string | undefined,
49
49
  headers: Headers | undefined,
50
- ) {
50
+ ): APIError {
51
51
  if (!status) {
52
- return new APIConnectionError({ cause: castToError(errorResponse) });
52
+ return new APIConnectionError({ message, cause: castToError(errorResponse) });
53
53
  }
54
54
 
55
55
  const error = errorResponse as Record<string, any>;
@@ -101,7 +101,7 @@ export class APIUserAbortError extends APIError {
101
101
  export class APIConnectionError extends APIError {
102
102
  override readonly status: undefined = undefined;
103
103
 
104
- constructor({ message, cause }: { message?: string; cause?: Error | undefined }) {
104
+ constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) {
105
105
  super(undefined, undefined, message || 'Connection error.', undefined);
106
106
  // in some environments the 'cause' property is already declared
107
107
  // @ts-ignore
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 {
@@ -184,7 +184,7 @@ function postProcessTrace(traceObj: Trace): { traceData: any; inputVariableNames
184
184
  const processed_steps = traceObj.toJSON();
185
185
 
186
186
  const traceData = {
187
- inferenceTimestamp: Date.now(),
187
+ inferenceTimestamp: Math.floor(Date.now() / 1000),
188
188
  inferenceId: rootStep!.id.toString(),
189
189
  output: rootStep!.output,
190
190
  groundTruth: rootStep!.groundTruth,
@@ -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
  }