openlayer 0.25.1 → 0.26.1

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 (52) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/bin/migration-config.json +68 -1
  3. package/client.d.mts +2 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +2 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/internal/utils/env.js +2 -2
  10. package/internal/utils/env.js.map +1 -1
  11. package/internal/utils/env.mjs +2 -2
  12. package/internal/utils/env.mjs.map +1 -1
  13. package/package.json +1 -1
  14. package/resources/index.d.mts +1 -1
  15. package/resources/index.d.mts.map +1 -1
  16. package/resources/index.d.ts +1 -1
  17. package/resources/index.d.ts.map +1 -1
  18. package/resources/index.js.map +1 -1
  19. package/resources/index.mjs.map +1 -1
  20. package/resources/inference-pipelines/index.d.mts +2 -2
  21. package/resources/inference-pipelines/index.d.mts.map +1 -1
  22. package/resources/inference-pipelines/index.d.ts +2 -2
  23. package/resources/inference-pipelines/index.d.ts.map +1 -1
  24. package/resources/inference-pipelines/index.js.map +1 -1
  25. package/resources/inference-pipelines/index.mjs.map +1 -1
  26. package/resources/inference-pipelines/inference-pipelines.d.mts +219 -6
  27. package/resources/inference-pipelines/inference-pipelines.d.mts.map +1 -1
  28. package/resources/inference-pipelines/inference-pipelines.d.ts +219 -6
  29. package/resources/inference-pipelines/inference-pipelines.d.ts.map +1 -1
  30. package/resources/inference-pipelines/inference-pipelines.js +31 -2
  31. package/resources/inference-pipelines/inference-pipelines.js.map +1 -1
  32. package/resources/inference-pipelines/inference-pipelines.mjs +32 -3
  33. package/resources/inference-pipelines/inference-pipelines.mjs.map +1 -1
  34. package/resources/inference-pipelines/rows.d.mts +45 -1
  35. package/resources/inference-pipelines/rows.d.mts.map +1 -1
  36. package/resources/inference-pipelines/rows.d.ts +45 -1
  37. package/resources/inference-pipelines/rows.d.ts.map +1 -1
  38. package/resources/inference-pipelines/rows.js +38 -0
  39. package/resources/inference-pipelines/rows.js.map +1 -1
  40. package/resources/inference-pipelines/rows.mjs +38 -0
  41. package/resources/inference-pipelines/rows.mjs.map +1 -1
  42. package/src/client.ts +4 -0
  43. package/src/internal/utils/env.ts +2 -2
  44. package/src/resources/index.ts +2 -0
  45. package/src/resources/inference-pipelines/index.ts +5 -0
  46. package/src/resources/inference-pipelines/inference-pipelines.ts +304 -5
  47. package/src/resources/inference-pipelines/rows.ts +67 -0
  48. package/src/version.ts +1 -1
  49. package/version.d.mts +1 -1
  50. package/version.d.ts +1 -1
  51. package/version.js +1 -1
  52. package/version.mjs +1 -1
@@ -4,7 +4,16 @@ import { APIResource } from '../../core/resource';
4
4
  import * as DataAPI from './data';
5
5
  import { Data, DataStreamParams, DataStreamResponse } from './data';
6
6
  import * as RowsAPI from './rows';
7
- import { RowListParams, RowListResponse, RowUpdateParams, RowUpdateResponse, Rows } from './rows';
7
+ import {
8
+ RowDeleteParams,
9
+ RowListParams,
10
+ RowListResponse,
11
+ RowRetrieveParams,
12
+ RowRetrieveResponse,
13
+ RowUpdateParams,
14
+ RowUpdateResponse,
15
+ Rows,
16
+ } from './rows';
8
17
  import * as TestResultsAPI from './test-results';
9
18
  import { TestResultListParams, TestResultListResponse, TestResults } from './test-results';
10
19
  import { APIPromise } from '../../core/api-promise';
@@ -72,6 +81,35 @@ export class InferencePipelines extends APIResource {
72
81
  });
73
82
  }
74
83
 
84
+ /**
85
+ * Get aggregated session data for an inference pipeline with pagination and
86
+ * metadata.
87
+ *
88
+ * Returns a list of sessions for the inference pipeline, including activity
89
+ * statistics such as record counts, token usage, cost, latency, and the first and
90
+ * last records.
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * const response =
95
+ * await client.inferencePipelines.retrieveSessions(
96
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
97
+ * );
98
+ * ```
99
+ */
100
+ retrieveSessions(
101
+ inferencePipelineID: string,
102
+ params: InferencePipelineRetrieveSessionsParams | null | undefined = {},
103
+ options?: RequestOptions,
104
+ ): APIPromise<InferencePipelineRetrieveSessionsResponse> {
105
+ const { asc, page, perPage, sortColumn, ...body } = params ?? {};
106
+ return this._client.post(path`/inference-pipelines/${inferencePipelineID}/sessions`, {
107
+ query: { asc, page, perPage, sortColumn },
108
+ body,
109
+ ...options,
110
+ });
111
+ }
112
+
75
113
  /**
76
114
  * Get aggregated user data for an inference pipeline with pagination and metadata.
77
115
  *
@@ -89,10 +127,15 @@ export class InferencePipelines extends APIResource {
89
127
  */
90
128
  retrieveUsers(
91
129
  inferencePipelineID: string,
92
- query: InferencePipelineRetrieveUsersParams | null | undefined = {},
130
+ params: InferencePipelineRetrieveUsersParams | null | undefined = {},
93
131
  options?: RequestOptions,
94
132
  ): APIPromise<InferencePipelineRetrieveUsersResponse> {
95
- return this._client.get(path`/inference-pipelines/${inferencePipelineID}/users`, { query, ...options });
133
+ const { asc, page, perPage, sortColumn, ...body } = params ?? {};
134
+ return this._client.post(path`/inference-pipelines/${inferencePipelineID}/users`, {
135
+ query: { asc, page, perPage, sortColumn },
136
+ body,
137
+ ...options,
138
+ });
96
139
  }
97
140
  }
98
141
 
@@ -832,6 +875,77 @@ export namespace InferencePipelineUpdateResponse {
832
875
  }
833
876
  }
834
877
 
878
+ export interface InferencePipelineRetrieveSessionsResponse {
879
+ /**
880
+ * Array of session aggregation data
881
+ */
882
+ items: Array<InferencePipelineRetrieveSessionsResponse.Item>;
883
+ }
884
+
885
+ export namespace InferencePipelineRetrieveSessionsResponse {
886
+ export interface Item {
887
+ /**
888
+ * The unique session identifier
889
+ */
890
+ id: string;
891
+
892
+ /**
893
+ * Total cost for the session
894
+ */
895
+ cost: number;
896
+
897
+ /**
898
+ * Latest/most recent timestamp in the session
899
+ */
900
+ dateCreated: string;
901
+
902
+ /**
903
+ * Timestamp of the first request in the session
904
+ */
905
+ dateOfFirstRecord: string;
906
+
907
+ /**
908
+ * Timestamp of the last request in the session
909
+ */
910
+ dateOfLastRecord: string;
911
+
912
+ /**
913
+ * Duration between first and last request (in milliseconds)
914
+ */
915
+ duration: number;
916
+
917
+ /**
918
+ * The complete first record in the session
919
+ */
920
+ firstRecord: { [key: string]: unknown };
921
+
922
+ /**
923
+ * The complete last record in the session
924
+ */
925
+ lastRecord: { [key: string]: unknown };
926
+
927
+ /**
928
+ * Total latency for the session (in milliseconds)
929
+ */
930
+ latency: number;
931
+
932
+ /**
933
+ * Total number of records/traces in the session
934
+ */
935
+ records: number;
936
+
937
+ /**
938
+ * Total token count for the session
939
+ */
940
+ tokens: number;
941
+
942
+ /**
943
+ * List of unique user IDs that participated in this session
944
+ */
945
+ userIds: Array<string>;
946
+ }
947
+ }
948
+
835
949
  export interface InferencePipelineRetrieveUsersResponse {
836
950
  /**
837
951
  * Array of user aggregation data
@@ -903,16 +1017,196 @@ export interface InferencePipelineUpdateParams {
903
1017
  referenceDatasetUri?: string | null;
904
1018
  }
905
1019
 
1020
+ export interface InferencePipelineRetrieveSessionsParams {
1021
+ /**
1022
+ * Query param: Whether or not to sort on the sortColumn in ascending order.
1023
+ */
1024
+ asc?: boolean;
1025
+
1026
+ /**
1027
+ * Query param: The page to return in a paginated query.
1028
+ */
1029
+ page?: number;
1030
+
1031
+ /**
1032
+ * Query param: Maximum number of items to return per page.
1033
+ */
1034
+ perPage?: number;
1035
+
1036
+ /**
1037
+ * Query param: Name of the column to sort on
1038
+ */
1039
+ sortColumn?: string;
1040
+
1041
+ /**
1042
+ * Body param
1043
+ */
1044
+ columnFilters?: Array<
1045
+ | InferencePipelineRetrieveSessionsParams.SetColumnFilter
1046
+ | InferencePipelineRetrieveSessionsParams.NumericColumnFilter
1047
+ | InferencePipelineRetrieveSessionsParams.StringColumnFilter
1048
+ > | null;
1049
+
1050
+ /**
1051
+ * Body param
1052
+ */
1053
+ excludeRowIdList?: Array<number> | null;
1054
+
1055
+ /**
1056
+ * Body param
1057
+ */
1058
+ notSearchQueryAnd?: Array<string> | null;
1059
+
1060
+ /**
1061
+ * Body param
1062
+ */
1063
+ notSearchQueryOr?: Array<string> | null;
1064
+
1065
+ /**
1066
+ * Body param
1067
+ */
1068
+ rowIdList?: Array<number> | null;
1069
+
1070
+ /**
1071
+ * Body param
1072
+ */
1073
+ searchQueryAnd?: Array<string> | null;
1074
+
1075
+ /**
1076
+ * Body param
1077
+ */
1078
+ searchQueryOr?: Array<string> | null;
1079
+ }
1080
+
1081
+ export namespace InferencePipelineRetrieveSessionsParams {
1082
+ export interface SetColumnFilter {
1083
+ /**
1084
+ * The name of the column.
1085
+ */
1086
+ measurement: string;
1087
+
1088
+ operator: 'contains_none' | 'contains_any' | 'contains_all' | 'one_of' | 'none_of';
1089
+
1090
+ value: Array<string | number>;
1091
+ }
1092
+
1093
+ export interface NumericColumnFilter {
1094
+ /**
1095
+ * The name of the column.
1096
+ */
1097
+ measurement: string;
1098
+
1099
+ operator: '>' | '>=' | 'is' | '<' | '<=' | '!=';
1100
+
1101
+ value: number | null;
1102
+ }
1103
+
1104
+ export interface StringColumnFilter {
1105
+ /**
1106
+ * The name of the column.
1107
+ */
1108
+ measurement: string;
1109
+
1110
+ operator: 'is' | '!=';
1111
+
1112
+ value: string | boolean;
1113
+ }
1114
+ }
1115
+
906
1116
  export interface InferencePipelineRetrieveUsersParams {
907
1117
  /**
908
- * The page to return in a paginated query.
1118
+ * Query param: Whether or not to sort on the sortColumn in ascending order.
1119
+ */
1120
+ asc?: boolean;
1121
+
1122
+ /**
1123
+ * Query param: The page to return in a paginated query.
909
1124
  */
910
1125
  page?: number;
911
1126
 
912
1127
  /**
913
- * Maximum number of items to return per page.
1128
+ * Query param: Maximum number of items to return per page.
914
1129
  */
915
1130
  perPage?: number;
1131
+
1132
+ /**
1133
+ * Query param: Name of the column to sort on
1134
+ */
1135
+ sortColumn?: string;
1136
+
1137
+ /**
1138
+ * Body param
1139
+ */
1140
+ columnFilters?: Array<
1141
+ | InferencePipelineRetrieveUsersParams.SetColumnFilter
1142
+ | InferencePipelineRetrieveUsersParams.NumericColumnFilter
1143
+ | InferencePipelineRetrieveUsersParams.StringColumnFilter
1144
+ > | null;
1145
+
1146
+ /**
1147
+ * Body param
1148
+ */
1149
+ excludeRowIdList?: Array<number> | null;
1150
+
1151
+ /**
1152
+ * Body param
1153
+ */
1154
+ notSearchQueryAnd?: Array<string> | null;
1155
+
1156
+ /**
1157
+ * Body param
1158
+ */
1159
+ notSearchQueryOr?: Array<string> | null;
1160
+
1161
+ /**
1162
+ * Body param
1163
+ */
1164
+ rowIdList?: Array<number> | null;
1165
+
1166
+ /**
1167
+ * Body param
1168
+ */
1169
+ searchQueryAnd?: Array<string> | null;
1170
+
1171
+ /**
1172
+ * Body param
1173
+ */
1174
+ searchQueryOr?: Array<string> | null;
1175
+ }
1176
+
1177
+ export namespace InferencePipelineRetrieveUsersParams {
1178
+ export interface SetColumnFilter {
1179
+ /**
1180
+ * The name of the column.
1181
+ */
1182
+ measurement: string;
1183
+
1184
+ operator: 'contains_none' | 'contains_any' | 'contains_all' | 'one_of' | 'none_of';
1185
+
1186
+ value: Array<string | number>;
1187
+ }
1188
+
1189
+ export interface NumericColumnFilter {
1190
+ /**
1191
+ * The name of the column.
1192
+ */
1193
+ measurement: string;
1194
+
1195
+ operator: '>' | '>=' | 'is' | '<' | '<=' | '!=';
1196
+
1197
+ value: number | null;
1198
+ }
1199
+
1200
+ export interface StringColumnFilter {
1201
+ /**
1202
+ * The name of the column.
1203
+ */
1204
+ measurement: string;
1205
+
1206
+ operator: 'is' | '!=';
1207
+
1208
+ value: string | boolean;
1209
+ }
916
1210
  }
917
1211
 
918
1212
  InferencePipelines.Data = Data;
@@ -923,9 +1217,11 @@ export declare namespace InferencePipelines {
923
1217
  export {
924
1218
  type InferencePipelineRetrieveResponse as InferencePipelineRetrieveResponse,
925
1219
  type InferencePipelineUpdateResponse as InferencePipelineUpdateResponse,
1220
+ type InferencePipelineRetrieveSessionsResponse as InferencePipelineRetrieveSessionsResponse,
926
1221
  type InferencePipelineRetrieveUsersResponse as InferencePipelineRetrieveUsersResponse,
927
1222
  type InferencePipelineRetrieveParams as InferencePipelineRetrieveParams,
928
1223
  type InferencePipelineUpdateParams as InferencePipelineUpdateParams,
1224
+ type InferencePipelineRetrieveSessionsParams as InferencePipelineRetrieveSessionsParams,
929
1225
  type InferencePipelineRetrieveUsersParams as InferencePipelineRetrieveUsersParams,
930
1226
  };
931
1227
 
@@ -937,10 +1233,13 @@ export declare namespace InferencePipelines {
937
1233
 
938
1234
  export {
939
1235
  Rows as Rows,
1236
+ type RowRetrieveResponse as RowRetrieveResponse,
940
1237
  type RowUpdateResponse as RowUpdateResponse,
941
1238
  type RowListResponse as RowListResponse,
1239
+ type RowRetrieveParams as RowRetrieveParams,
942
1240
  type RowUpdateParams as RowUpdateParams,
943
1241
  type RowListParams as RowListParams,
1242
+ type RowDeleteParams as RowDeleteParams,
944
1243
  };
945
1244
 
946
1245
  export {
@@ -2,10 +2,34 @@
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
4
  import { APIPromise } from '../../core/api-promise';
5
+ import { buildHeaders } from '../../internal/headers';
5
6
  import { RequestOptions } from '../../internal/request-options';
6
7
  import { path } from '../../internal/utils/path';
7
8
 
8
9
  export class Rows extends APIResource {
10
+ /**
11
+ * Fetch a single inference pipeline row by inference ID, including OTel steps.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const row = await client.inferencePipelines.rows.retrieve(
16
+ * 'inferenceId',
17
+ * {
18
+ * inferencePipelineId:
19
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
20
+ * },
21
+ * );
22
+ * ```
23
+ */
24
+ retrieve(
25
+ inferenceID: string,
26
+ params: RowRetrieveParams,
27
+ options?: RequestOptions,
28
+ ): APIPromise<RowRetrieveResponse> {
29
+ const { inferencePipelineId } = params;
30
+ return this._client.get(path`/inference-pipelines/${inferencePipelineId}/rows/${inferenceID}`, options);
31
+ }
32
+
9
33
  /**
10
34
  * Update an inference data point in an inference pipeline.
11
35
  *
@@ -55,6 +79,32 @@ export class Rows extends APIResource {
55
79
  ...options,
56
80
  });
57
81
  }
82
+
83
+ /**
84
+ * Delete a single inference pipeline row by inference ID. Only project admins can
85
+ * perform this action.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * await client.inferencePipelines.rows.delete('inferenceId', {
90
+ * inferencePipelineId:
91
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
92
+ * });
93
+ * ```
94
+ */
95
+ delete(inferenceID: string, params: RowDeleteParams, options?: RequestOptions): APIPromise<void> {
96
+ const { inferencePipelineId } = params;
97
+ return this._client.delete(path`/inference-pipelines/${inferencePipelineId}/rows/${inferenceID}`, {
98
+ ...options,
99
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
100
+ });
101
+ }
102
+ }
103
+
104
+ export interface RowRetrieveResponse {
105
+ row?: unknown;
106
+
107
+ success?: boolean;
58
108
  }
59
109
 
60
110
  export interface RowUpdateResponse {
@@ -71,6 +121,13 @@ export namespace RowListResponse {
71
121
  }
72
122
  }
73
123
 
124
+ export interface RowRetrieveParams {
125
+ /**
126
+ * The inference pipeline id (a UUID).
127
+ */
128
+ inferencePipelineId: string;
129
+ }
130
+
74
131
  export interface RowUpdateParams {
75
132
  /**
76
133
  * Query param: Specify the inference id as a query param.
@@ -214,11 +271,21 @@ export namespace RowListParams {
214
271
  }
215
272
  }
216
273
 
274
+ export interface RowDeleteParams {
275
+ /**
276
+ * The inference pipeline id (a UUID).
277
+ */
278
+ inferencePipelineId: string;
279
+ }
280
+
217
281
  export declare namespace Rows {
218
282
  export {
283
+ type RowRetrieveResponse as RowRetrieveResponse,
219
284
  type RowUpdateResponse as RowUpdateResponse,
220
285
  type RowListResponse as RowListResponse,
286
+ type RowRetrieveParams as RowRetrieveParams,
221
287
  type RowUpdateParams as RowUpdateParams,
222
288
  type RowListParams as RowListParams,
289
+ type RowDeleteParams as RowDeleteParams,
223
290
  };
224
291
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.25.1'; // x-release-please-version
1
+ export const VERSION = '0.26.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.25.1";
1
+ export declare const VERSION = "0.26.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.25.1";
1
+ export declare const VERSION = "0.26.1";
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.25.1'; // x-release-please-version
4
+ exports.VERSION = '0.26.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.25.1'; // x-release-please-version
1
+ export const VERSION = '0.26.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map