openlayer 0.3.0 → 0.7.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 (120) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +7 -15
  3. package/index.d.mts +5 -0
  4. package/index.d.ts +5 -0
  5. package/index.d.ts.map +1 -1
  6. package/index.js +2 -0
  7. package/index.js.map +1 -1
  8. package/index.mjs +2 -0
  9. package/index.mjs.map +1 -1
  10. package/lib/core/openai-monitor.d.ts +3 -0
  11. package/lib/core/openai-monitor.d.ts.map +1 -1
  12. package/lib/core/openai-monitor.js +7 -1
  13. package/lib/core/openai-monitor.js.map +1 -1
  14. package/lib/core/openai-monitor.mjs +4 -1
  15. package/lib/core/openai-monitor.mjs.map +1 -1
  16. package/lib/integrations/langchainCallback.d.ts +33 -0
  17. package/lib/integrations/langchainCallback.d.ts.map +1 -0
  18. package/lib/integrations/langchainCallback.js +114 -0
  19. package/lib/integrations/langchainCallback.js.map +1 -0
  20. package/lib/integrations/langchainCallback.mjs +110 -0
  21. package/lib/integrations/langchainCallback.mjs.map +1 -0
  22. package/lib/integrations/openAiTracer.d.ts +3 -0
  23. package/lib/integrations/openAiTracer.d.ts.map +1 -0
  24. package/lib/integrations/openAiTracer.js +125 -0
  25. package/lib/integrations/openAiTracer.js.map +1 -0
  26. package/lib/integrations/openAiTracer.mjs +121 -0
  27. package/lib/integrations/openAiTracer.mjs.map +1 -0
  28. package/lib/tracing/enums.d.ts +5 -0
  29. package/lib/tracing/enums.d.ts.map +1 -0
  30. package/lib/tracing/enums.js +9 -0
  31. package/lib/tracing/enums.js.map +1 -0
  32. package/lib/tracing/enums.mjs +6 -0
  33. package/lib/tracing/enums.mjs.map +1 -0
  34. package/lib/tracing/steps.d.ts +57 -0
  35. package/lib/tracing/steps.d.ts.map +1 -0
  36. package/lib/tracing/steps.js +84 -0
  37. package/lib/tracing/steps.js.map +1 -0
  38. package/lib/tracing/steps.mjs +78 -0
  39. package/lib/tracing/steps.mjs.map +1 -0
  40. package/lib/tracing/tracer.d.ts +18 -0
  41. package/lib/tracing/tracer.d.ts.map +1 -0
  42. package/lib/tracing/tracer.js +155 -0
  43. package/lib/tracing/tracer.js.map +1 -0
  44. package/lib/tracing/tracer.mjs +148 -0
  45. package/lib/tracing/tracer.mjs.map +1 -0
  46. package/lib/tracing/traces.d.ts +9 -0
  47. package/lib/tracing/traces.d.ts.map +1 -0
  48. package/lib/tracing/traces.js +17 -0
  49. package/lib/tracing/traces.js.map +1 -0
  50. package/lib/tracing/traces.mjs +13 -0
  51. package/lib/tracing/traces.mjs.map +1 -0
  52. package/package.json +2 -1
  53. package/resources/index.d.ts +2 -1
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/index.js +3 -1
  56. package/resources/index.js.map +1 -1
  57. package/resources/index.mjs +2 -1
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/inference-pipelines/data.d.ts +2 -2
  60. package/resources/inference-pipelines/data.js +1 -1
  61. package/resources/inference-pipelines/data.mjs +1 -1
  62. package/resources/inference-pipelines/index.d.ts +2 -1
  63. package/resources/inference-pipelines/index.d.ts.map +1 -1
  64. package/resources/inference-pipelines/index.js +3 -1
  65. package/resources/inference-pipelines/index.js.map +1 -1
  66. package/resources/inference-pipelines/index.mjs +2 -1
  67. package/resources/inference-pipelines/index.mjs.map +1 -1
  68. package/resources/inference-pipelines/inference-pipelines.d.ts +166 -0
  69. package/resources/inference-pipelines/inference-pipelines.d.ts.map +1 -1
  70. package/resources/inference-pipelines/inference-pipelines.js +25 -0
  71. package/resources/inference-pipelines/inference-pipelines.js.map +1 -1
  72. package/resources/inference-pipelines/inference-pipelines.mjs +25 -0
  73. package/resources/inference-pipelines/inference-pipelines.mjs.map +1 -1
  74. package/resources/inference-pipelines/rows.d.ts +58 -0
  75. package/resources/inference-pipelines/rows.d.ts.map +1 -0
  76. package/resources/inference-pipelines/rows.js +22 -0
  77. package/resources/inference-pipelines/rows.js.map +1 -0
  78. package/resources/inference-pipelines/rows.mjs +18 -0
  79. package/resources/inference-pipelines/rows.mjs.map +1 -0
  80. package/resources/storage/index.d.ts +3 -0
  81. package/resources/storage/index.d.ts.map +1 -0
  82. package/resources/storage/index.js +9 -0
  83. package/resources/storage/index.js.map +1 -0
  84. package/resources/storage/index.mjs +4 -0
  85. package/resources/storage/index.mjs.map +1 -0
  86. package/resources/storage/presigned-url.d.ts +34 -0
  87. package/resources/storage/presigned-url.d.ts.map +1 -0
  88. package/resources/storage/presigned-url.js +18 -0
  89. package/resources/storage/presigned-url.js.map +1 -0
  90. package/resources/storage/presigned-url.mjs +14 -0
  91. package/resources/storage/presigned-url.mjs.map +1 -0
  92. package/resources/storage/storage.d.ts +11 -0
  93. package/resources/storage/storage.d.ts.map +1 -0
  94. package/resources/storage/storage.js +40 -0
  95. package/resources/storage/storage.js.map +1 -0
  96. package/resources/storage/storage.mjs +13 -0
  97. package/resources/storage/storage.mjs.map +1 -0
  98. package/src/index.ts +6 -0
  99. package/src/lib/core/openai-monitor.ts +7 -1
  100. package/src/lib/index.d.ts +1 -0
  101. package/src/lib/integrations/langchainCallback.ts +141 -0
  102. package/src/lib/integrations/openAiTracer.ts +137 -0
  103. package/src/lib/tracing/enums.ts +4 -0
  104. package/src/lib/tracing/index.d.ts +1 -0
  105. package/src/lib/tracing/steps.ts +118 -0
  106. package/src/lib/tracing/tracer.ts +204 -0
  107. package/src/lib/tracing/traces.ts +19 -0
  108. package/src/resources/index.ts +7 -1
  109. package/src/resources/inference-pipelines/data.ts +2 -2
  110. package/src/resources/inference-pipelines/index.ts +7 -1
  111. package/src/resources/inference-pipelines/inference-pipelines.ts +232 -0
  112. package/src/resources/inference-pipelines/rows.ts +81 -0
  113. package/src/resources/storage/index.ts +4 -0
  114. package/src/resources/storage/presigned-url.ts +47 -0
  115. package/src/resources/storage/storage.ts +14 -0
  116. package/src/version.ts +1 -1
  117. package/version.d.ts +1 -1
  118. package/version.js +1 -1
  119. package/version.mjs +1 -1
  120. package/src/lib/.keep +0 -4
@@ -1,5 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  export { DataStreamResponse, DataStreamParams, Data } from './data';
4
- export { InferencePipelines } from './inference-pipelines';
4
+ export {
5
+ InferencePipelineRetrieveResponse,
6
+ InferencePipelineUpdateResponse,
7
+ InferencePipelineUpdateParams,
8
+ InferencePipelines,
9
+ } from './inference-pipelines';
10
+ export { RowUpdateResponse, RowUpdateParams, Rows } from './rows';
5
11
  export { TestResultListResponse, TestResultListParams, TestResults } from './test-results';
@@ -1,18 +1,250 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../resource';
4
+ import { isRequestOptions } from '../../core';
5
+ import * as Core from '../../core';
6
+ import * as InferencePipelinesAPI from './inference-pipelines';
4
7
  import * as DataAPI from './data';
8
+ import * as RowsAPI from './rows';
5
9
  import * as TestResultsAPI from './test-results';
6
10
 
7
11
  export class InferencePipelines extends APIResource {
8
12
  data: DataAPI.Data = new DataAPI.Data(this._client);
13
+ rows: RowsAPI.Rows = new RowsAPI.Rows(this._client);
9
14
  testResults: TestResultsAPI.TestResults = new TestResultsAPI.TestResults(this._client);
15
+
16
+ /**
17
+ * Retrieve inference pipeline.
18
+ */
19
+ retrieve(
20
+ inferencePipelineId: string,
21
+ options?: Core.RequestOptions,
22
+ ): Core.APIPromise<InferencePipelineRetrieveResponse> {
23
+ return this._client.get(`/inference-pipelines/${inferencePipelineId}`, options);
24
+ }
25
+
26
+ /**
27
+ * Update inference pipeline.
28
+ */
29
+ update(
30
+ inferencePipelineId: string,
31
+ body?: InferencePipelineUpdateParams,
32
+ options?: Core.RequestOptions,
33
+ ): Core.APIPromise<InferencePipelineUpdateResponse>;
34
+ update(
35
+ inferencePipelineId: string,
36
+ options?: Core.RequestOptions,
37
+ ): Core.APIPromise<InferencePipelineUpdateResponse>;
38
+ update(
39
+ inferencePipelineId: string,
40
+ body: InferencePipelineUpdateParams | Core.RequestOptions = {},
41
+ options?: Core.RequestOptions,
42
+ ): Core.APIPromise<InferencePipelineUpdateResponse> {
43
+ if (isRequestOptions(body)) {
44
+ return this.update(inferencePipelineId, {}, body);
45
+ }
46
+ return this._client.put(`/inference-pipelines/${inferencePipelineId}`, { body, ...options });
47
+ }
48
+
49
+ /**
50
+ * Delete inference pipeline.
51
+ */
52
+ delete(inferencePipelineId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
53
+ return this._client.delete(`/inference-pipelines/${inferencePipelineId}`, {
54
+ ...options,
55
+ headers: { Accept: '*/*', ...options?.headers },
56
+ });
57
+ }
58
+ }
59
+
60
+ export interface InferencePipelineRetrieveResponse {
61
+ /**
62
+ * The inference pipeline id.
63
+ */
64
+ id: string;
65
+
66
+ /**
67
+ * The creation date.
68
+ */
69
+ dateCreated: string;
70
+
71
+ /**
72
+ * The last test evaluation date.
73
+ */
74
+ dateLastEvaluated: string | null;
75
+
76
+ /**
77
+ * The last data sample received date.
78
+ */
79
+ dateLastSampleReceived: string | null;
80
+
81
+ /**
82
+ * The next test evaluation date.
83
+ */
84
+ dateOfNextEvaluation: string | null;
85
+
86
+ /**
87
+ * The last updated date.
88
+ */
89
+ dateUpdated: string;
90
+
91
+ /**
92
+ * The inference pipeline description.
93
+ */
94
+ description: string | null;
95
+
96
+ /**
97
+ * The number of tests failing.
98
+ */
99
+ failingGoalCount: number;
100
+
101
+ links: InferencePipelineRetrieveResponse.Links;
102
+
103
+ /**
104
+ * The inference pipeline name.
105
+ */
106
+ name: string;
107
+
108
+ /**
109
+ * The number of tests passing.
110
+ */
111
+ passingGoalCount: number;
112
+
113
+ /**
114
+ * The project id.
115
+ */
116
+ projectId: string;
117
+
118
+ /**
119
+ * The status of test evaluation for the inference pipeline.
120
+ */
121
+ status: 'queued' | 'running' | 'paused' | 'failed' | 'completed' | 'unknown';
122
+
123
+ /**
124
+ * The status message of test evaluation for the inference pipeline.
125
+ */
126
+ statusMessage: string | null;
127
+
128
+ /**
129
+ * The total number of tests.
130
+ */
131
+ totalGoalCount: number;
132
+ }
133
+
134
+ export namespace InferencePipelineRetrieveResponse {
135
+ export interface Links {
136
+ app: string;
137
+ }
138
+ }
139
+
140
+ export interface InferencePipelineUpdateResponse {
141
+ /**
142
+ * The inference pipeline id.
143
+ */
144
+ id: string;
145
+
146
+ /**
147
+ * The creation date.
148
+ */
149
+ dateCreated: string;
150
+
151
+ /**
152
+ * The last test evaluation date.
153
+ */
154
+ dateLastEvaluated: string | null;
155
+
156
+ /**
157
+ * The last data sample received date.
158
+ */
159
+ dateLastSampleReceived: string | null;
160
+
161
+ /**
162
+ * The next test evaluation date.
163
+ */
164
+ dateOfNextEvaluation: string | null;
165
+
166
+ /**
167
+ * The last updated date.
168
+ */
169
+ dateUpdated: string;
170
+
171
+ /**
172
+ * The inference pipeline description.
173
+ */
174
+ description: string | null;
175
+
176
+ /**
177
+ * The number of tests failing.
178
+ */
179
+ failingGoalCount: number;
180
+
181
+ links: InferencePipelineUpdateResponse.Links;
182
+
183
+ /**
184
+ * The inference pipeline name.
185
+ */
186
+ name: string;
187
+
188
+ /**
189
+ * The number of tests passing.
190
+ */
191
+ passingGoalCount: number;
192
+
193
+ /**
194
+ * The project id.
195
+ */
196
+ projectId: string;
197
+
198
+ /**
199
+ * The status of test evaluation for the inference pipeline.
200
+ */
201
+ status: 'queued' | 'running' | 'paused' | 'failed' | 'completed' | 'unknown';
202
+
203
+ /**
204
+ * The status message of test evaluation for the inference pipeline.
205
+ */
206
+ statusMessage: string | null;
207
+
208
+ /**
209
+ * The total number of tests.
210
+ */
211
+ totalGoalCount: number;
212
+ }
213
+
214
+ export namespace InferencePipelineUpdateResponse {
215
+ export interface Links {
216
+ app: string;
217
+ }
218
+ }
219
+
220
+ export interface InferencePipelineUpdateParams {
221
+ /**
222
+ * The inference pipeline description.
223
+ */
224
+ description?: string | null;
225
+
226
+ /**
227
+ * The inference pipeline name.
228
+ */
229
+ name?: string;
230
+
231
+ /**
232
+ * The storage uri of your reference dataset. We recommend using the Python SDK or
233
+ * the UI to handle your reference dataset updates.
234
+ */
235
+ referenceDatasetUri?: string | null;
10
236
  }
11
237
 
12
238
  export namespace InferencePipelines {
239
+ export import InferencePipelineRetrieveResponse = InferencePipelinesAPI.InferencePipelineRetrieveResponse;
240
+ export import InferencePipelineUpdateResponse = InferencePipelinesAPI.InferencePipelineUpdateResponse;
241
+ export import InferencePipelineUpdateParams = InferencePipelinesAPI.InferencePipelineUpdateParams;
13
242
  export import Data = DataAPI.Data;
14
243
  export import DataStreamResponse = DataAPI.DataStreamResponse;
15
244
  export import DataStreamParams = DataAPI.DataStreamParams;
245
+ export import Rows = RowsAPI.Rows;
246
+ export import RowUpdateResponse = RowsAPI.RowUpdateResponse;
247
+ export import RowUpdateParams = RowsAPI.RowUpdateParams;
16
248
  export import TestResults = TestResultsAPI.TestResults;
17
249
  export import TestResultListResponse = TestResultsAPI.TestResultListResponse;
18
250
  export import TestResultListParams = TestResultsAPI.TestResultListParams;
@@ -0,0 +1,81 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import * as RowsAPI from './rows';
6
+
7
+ export class Rows extends APIResource {
8
+ /**
9
+ * Update an inference data point in an inference pipeline.
10
+ */
11
+ update(
12
+ inferencePipelineId: string,
13
+ params: RowUpdateParams,
14
+ options?: Core.RequestOptions,
15
+ ): Core.APIPromise<RowUpdateResponse> {
16
+ const { inferenceId, ...body } = params;
17
+ return this._client.put(`/inference-pipelines/${inferencePipelineId}/rows`, {
18
+ query: { inferenceId },
19
+ body,
20
+ ...options,
21
+ });
22
+ }
23
+ }
24
+
25
+ export interface RowUpdateResponse {
26
+ success: true;
27
+ }
28
+
29
+ export interface RowUpdateParams {
30
+ /**
31
+ * Query param: Specify the inference id as a query param.
32
+ */
33
+ inferenceId: string;
34
+
35
+ /**
36
+ * Body param:
37
+ */
38
+ row: unknown;
39
+
40
+ /**
41
+ * Body param:
42
+ */
43
+ config?: RowUpdateParams.Config | null;
44
+ }
45
+
46
+ export namespace RowUpdateParams {
47
+ export interface Config {
48
+ /**
49
+ * Name of the column with the ground truths.
50
+ */
51
+ groundTruthColumnName?: string | null;
52
+
53
+ /**
54
+ * Name of the column with human feedback.
55
+ */
56
+ humanFeedbackColumnName?: string | null;
57
+
58
+ /**
59
+ * Name of the column with the inference ids. This is useful if you want to update
60
+ * rows at a later point in time. If not provided, a unique id is generated by
61
+ * Openlayer.
62
+ */
63
+ inferenceIdColumnName?: string | null;
64
+
65
+ /**
66
+ * Name of the column with the latencies.
67
+ */
68
+ latencyColumnName?: string | null;
69
+
70
+ /**
71
+ * Name of the column with the timestamps. Timestamps must be in UNIX sec format.
72
+ * If not provided, the upload timestamp is used.
73
+ */
74
+ timestampColumnName?: string | null;
75
+ }
76
+ }
77
+
78
+ export namespace Rows {
79
+ export import RowUpdateResponse = RowsAPI.RowUpdateResponse;
80
+ export import RowUpdateParams = RowsAPI.RowUpdateParams;
81
+ }
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { PresignedURLCreateResponse, PresignedURLCreateParams, PresignedURL } from './presigned-url';
4
+ export { Storage } from './storage';
@@ -0,0 +1,47 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import * as PresignedURLAPI from './presigned-url';
6
+
7
+ export class PresignedURL extends APIResource {
8
+ /**
9
+ * Retrieve a presigned url to post storage artifacts.
10
+ */
11
+ create(
12
+ params: PresignedURLCreateParams,
13
+ options?: Core.RequestOptions,
14
+ ): Core.APIPromise<PresignedURLCreateResponse> {
15
+ const { objectName } = params;
16
+ return this._client.post('/storage/presigned-url', { query: { objectName }, ...options });
17
+ }
18
+ }
19
+
20
+ export interface PresignedURLCreateResponse {
21
+ /**
22
+ * The storage URI to send back to the backend after the upload was completed.
23
+ */
24
+ storageUri: string;
25
+
26
+ /**
27
+ * The presigned url.
28
+ */
29
+ url: string;
30
+
31
+ /**
32
+ * Fields to include in the body of the upload. Only needed by s3.
33
+ */
34
+ fields?: unknown;
35
+ }
36
+
37
+ export interface PresignedURLCreateParams {
38
+ /**
39
+ * The name of the object.
40
+ */
41
+ objectName: string;
42
+ }
43
+
44
+ export namespace PresignedURL {
45
+ export import PresignedURLCreateResponse = PresignedURLAPI.PresignedURLCreateResponse;
46
+ export import PresignedURLCreateParams = PresignedURLAPI.PresignedURLCreateParams;
47
+ }
@@ -0,0 +1,14 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as PresignedURLAPI from './presigned-url';
5
+
6
+ export class Storage extends APIResource {
7
+ presignedURL: PresignedURLAPI.PresignedURL = new PresignedURLAPI.PresignedURL(this._client);
8
+ }
9
+
10
+ export namespace Storage {
11
+ export import PresignedURL = PresignedURLAPI.PresignedURL;
12
+ export import PresignedURLCreateResponse = PresignedURLAPI.PresignedURLCreateResponse;
13
+ export import PresignedURLCreateParams = PresignedURLAPI.PresignedURLCreateParams;
14
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.3.0'; // x-release-please-version
1
+ export const VERSION = '0.7.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.3.0";
1
+ export declare const VERSION = "0.7.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.3.0'; // x-release-please-version
4
+ exports.VERSION = '0.7.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.3.0'; // x-release-please-version
1
+ export const VERSION = '0.7.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/src/lib/.keep DELETED
@@ -1,4 +0,0 @@
1
- File generated from our OpenAPI spec by Stainless.
2
-
3
- This directory can be used to store custom files to expand the SDK.
4
- It is ignored by Stainless code generation and its content (other than this keep file) won't be touched.