bem-ai-sdk 0.26.0 → 0.28.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 (205) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/client.d.mts +127 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +127 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +136 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +136 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/buckets.d.mts +272 -0
  12. package/resources/buckets.d.mts.map +1 -0
  13. package/resources/buckets.d.ts +272 -0
  14. package/resources/buckets.d.ts.map +1 -0
  15. package/resources/buckets.js +93 -0
  16. package/resources/buckets.js.map +1 -0
  17. package/resources/buckets.mjs +89 -0
  18. package/resources/buckets.mjs.map +1 -0
  19. package/resources/entities/entities.d.mts +526 -0
  20. package/resources/entities/entities.d.mts.map +1 -0
  21. package/resources/entities/entities.d.ts +526 -0
  22. package/resources/entities/entities.d.ts.map +1 -0
  23. package/resources/entities/entities.js +93 -0
  24. package/resources/entities/entities.js.map +1 -0
  25. package/resources/entities/entities.mjs +88 -0
  26. package/resources/entities/entities.mjs.map +1 -0
  27. package/resources/entities/index.d.mts +3 -0
  28. package/resources/entities/index.d.mts.map +1 -0
  29. package/resources/entities/index.d.ts +3 -0
  30. package/resources/entities/index.d.ts.map +1 -0
  31. package/resources/entities/index.js +9 -0
  32. package/resources/entities/index.js.map +1 -0
  33. package/resources/entities/index.mjs +4 -0
  34. package/resources/entities/index.mjs.map +1 -0
  35. package/resources/entities/synonyms.d.mts +109 -0
  36. package/resources/entities/synonyms.d.mts.map +1 -0
  37. package/resources/entities/synonyms.d.ts +109 -0
  38. package/resources/entities/synonyms.d.ts.map +1 -0
  39. package/resources/entities/synonyms.js +61 -0
  40. package/resources/entities/synonyms.js.map +1 -0
  41. package/resources/entities/synonyms.mjs +57 -0
  42. package/resources/entities/synonyms.mjs.map +1 -0
  43. package/resources/entities.d.mts +2 -0
  44. package/resources/entities.d.mts.map +1 -0
  45. package/resources/entities.d.ts +2 -0
  46. package/resources/entities.d.ts.map +1 -0
  47. package/resources/entities.js +6 -0
  48. package/resources/entities.js.map +1 -0
  49. package/resources/entities.mjs +3 -0
  50. package/resources/entities.mjs.map +1 -0
  51. package/resources/entity-types/entity-types.d.mts +302 -0
  52. package/resources/entity-types/entity-types.d.mts.map +1 -0
  53. package/resources/entity-types/entity-types.d.ts +302 -0
  54. package/resources/entity-types/entity-types.d.ts.map +1 -0
  55. package/resources/entity-types/entity-types.js +104 -0
  56. package/resources/entity-types/entity-types.js.map +1 -0
  57. package/resources/entity-types/entity-types.mjs +99 -0
  58. package/resources/entity-types/entity-types.mjs.map +1 -0
  59. package/resources/entity-types/index.d.mts +3 -0
  60. package/resources/entity-types/index.d.mts.map +1 -0
  61. package/resources/entity-types/index.d.ts +3 -0
  62. package/resources/entity-types/index.d.ts.map +1 -0
  63. package/resources/entity-types/index.js +9 -0
  64. package/resources/entity-types/index.js.map +1 -0
  65. package/resources/entity-types/index.mjs +4 -0
  66. package/resources/entity-types/index.mjs.map +1 -0
  67. package/resources/entity-types/reviewers.d.mts +136 -0
  68. package/resources/entity-types/reviewers.d.mts.map +1 -0
  69. package/resources/entity-types/reviewers.d.ts +136 -0
  70. package/resources/entity-types/reviewers.d.ts.map +1 -0
  71. package/resources/entity-types/reviewers.js +74 -0
  72. package/resources/entity-types/reviewers.js.map +1 -0
  73. package/resources/entity-types/reviewers.mjs +70 -0
  74. package/resources/entity-types/reviewers.mjs.map +1 -0
  75. package/resources/entity-types.d.mts +2 -0
  76. package/resources/entity-types.d.mts.map +1 -0
  77. package/resources/entity-types.d.ts +2 -0
  78. package/resources/entity-types.d.ts.map +1 -0
  79. package/resources/entity-types.js +6 -0
  80. package/resources/entity-types.js.map +1 -0
  81. package/resources/entity-types.mjs +3 -0
  82. package/resources/entity-types.mjs.map +1 -0
  83. package/resources/errors.d.mts +9 -0
  84. package/resources/errors.d.mts.map +1 -1
  85. package/resources/errors.d.ts +9 -0
  86. package/resources/errors.d.ts.map +1 -1
  87. package/resources/eval/eval.d.mts +4 -0
  88. package/resources/eval/eval.d.mts.map +1 -1
  89. package/resources/eval/eval.d.ts +4 -0
  90. package/resources/eval/eval.d.ts.map +1 -1
  91. package/resources/eval/eval.js +4 -0
  92. package/resources/eval/eval.js.map +1 -1
  93. package/resources/eval/eval.mjs +4 -0
  94. package/resources/eval/eval.mjs.map +1 -1
  95. package/resources/eval/index.d.mts +1 -0
  96. package/resources/eval/index.d.mts.map +1 -1
  97. package/resources/eval/index.d.ts +1 -0
  98. package/resources/eval/index.d.ts.map +1 -1
  99. package/resources/eval/index.js +3 -1
  100. package/resources/eval/index.js.map +1 -1
  101. package/resources/eval/index.mjs +1 -0
  102. package/resources/eval/index.mjs.map +1 -1
  103. package/resources/eval/score.d.mts +486 -0
  104. package/resources/eval/score.d.mts.map +1 -0
  105. package/resources/eval/score.d.ts +486 -0
  106. package/resources/eval/score.d.ts.map +1 -0
  107. package/resources/eval/score.js +126 -0
  108. package/resources/eval/score.js.map +1 -0
  109. package/resources/eval/score.mjs +122 -0
  110. package/resources/eval/score.mjs.map +1 -0
  111. package/resources/fs.d.mts +28 -0
  112. package/resources/fs.d.mts.map +1 -1
  113. package/resources/fs.d.ts +28 -0
  114. package/resources/fs.d.ts.map +1 -1
  115. package/resources/functions/functions.d.mts +338 -8
  116. package/resources/functions/functions.d.mts.map +1 -1
  117. package/resources/functions/functions.d.ts +338 -8
  118. package/resources/functions/functions.d.ts.map +1 -1
  119. package/resources/functions/functions.js +2 -2
  120. package/resources/functions/functions.js.map +1 -1
  121. package/resources/functions/functions.mjs +2 -2
  122. package/resources/functions/functions.mjs.map +1 -1
  123. package/resources/functions/versions.d.mts +133 -1
  124. package/resources/functions/versions.d.mts.map +1 -1
  125. package/resources/functions/versions.d.ts +133 -1
  126. package/resources/functions/versions.d.ts.map +1 -1
  127. package/resources/index.d.mts +6 -0
  128. package/resources/index.d.mts.map +1 -1
  129. package/resources/index.d.ts +6 -0
  130. package/resources/index.d.ts.map +1 -1
  131. package/resources/index.js +13 -1
  132. package/resources/index.js.map +1 -1
  133. package/resources/index.mjs +6 -0
  134. package/resources/index.mjs.map +1 -1
  135. package/resources/knowledge-graph.d.mts +143 -0
  136. package/resources/knowledge-graph.d.mts.map +1 -0
  137. package/resources/knowledge-graph.d.ts +143 -0
  138. package/resources/knowledge-graph.d.ts.map +1 -0
  139. package/resources/knowledge-graph.js +34 -0
  140. package/resources/knowledge-graph.js.map +1 -0
  141. package/resources/knowledge-graph.mjs +30 -0
  142. package/resources/knowledge-graph.mjs.map +1 -0
  143. package/resources/outputs.d.mts +80 -2
  144. package/resources/outputs.d.mts.map +1 -1
  145. package/resources/outputs.d.ts +80 -2
  146. package/resources/outputs.d.ts.map +1 -1
  147. package/resources/review-queue.d.mts +192 -0
  148. package/resources/review-queue.d.mts.map +1 -0
  149. package/resources/review-queue.d.ts +192 -0
  150. package/resources/review-queue.d.ts.map +1 -0
  151. package/resources/review-queue.js +49 -0
  152. package/resources/review-queue.js.map +1 -0
  153. package/resources/review-queue.mjs +45 -0
  154. package/resources/review-queue.mjs.map +1 -0
  155. package/resources/subscriptions.d.mts +14 -2
  156. package/resources/subscriptions.d.mts.map +1 -1
  157. package/resources/subscriptions.d.ts +14 -2
  158. package/resources/subscriptions.d.ts.map +1 -1
  159. package/resources/subscriptions.js +14 -2
  160. package/resources/subscriptions.js.map +1 -1
  161. package/resources/subscriptions.mjs +14 -2
  162. package/resources/subscriptions.mjs.map +1 -1
  163. package/resources/users.d.mts +62 -0
  164. package/resources/users.d.mts.map +1 -0
  165. package/resources/users.d.ts +62 -0
  166. package/resources/users.d.ts.map +1 -0
  167. package/resources/users.js +35 -0
  168. package/resources/users.js.map +1 -0
  169. package/resources/users.mjs +31 -0
  170. package/resources/users.mjs.map +1 -0
  171. package/resources/workflows/workflows.d.mts +8 -0
  172. package/resources/workflows/workflows.d.mts.map +1 -1
  173. package/resources/workflows/workflows.d.ts +8 -0
  174. package/resources/workflows/workflows.d.ts.map +1 -1
  175. package/resources/workflows/workflows.js.map +1 -1
  176. package/resources/workflows/workflows.mjs.map +1 -1
  177. package/src/client.ts +220 -3
  178. package/src/resources/buckets.ts +351 -0
  179. package/src/resources/entities/entities.ts +651 -0
  180. package/src/resources/entities/index.ts +20 -0
  181. package/src/resources/entities/synonyms.ts +140 -0
  182. package/src/resources/entities.ts +3 -0
  183. package/src/resources/entity-types/entity-types.ts +396 -0
  184. package/src/resources/entity-types/index.ts +19 -0
  185. package/src/resources/entity-types/reviewers.ts +175 -0
  186. package/src/resources/entity-types.ts +3 -0
  187. package/src/resources/errors.ts +10 -0
  188. package/src/resources/eval/eval.ts +18 -0
  189. package/src/resources/eval/index.ts +7 -0
  190. package/src/resources/eval/score.ts +590 -0
  191. package/src/resources/fs.ts +30 -0
  192. package/src/resources/functions/functions.ts +395 -8
  193. package/src/resources/functions/versions.ts +153 -1
  194. package/src/resources/index.ts +40 -0
  195. package/src/resources/knowledge-graph.ts +174 -0
  196. package/src/resources/outputs.ts +101 -1
  197. package/src/resources/review-queue.ts +234 -0
  198. package/src/resources/subscriptions.ts +14 -2
  199. package/src/resources/users.ts +76 -0
  200. package/src/resources/workflows/workflows.ts +9 -0
  201. package/src/version.ts +1 -1
  202. package/version.d.mts +1 -1
  203. package/version.d.ts +1 -1
  204. package/version.js +1 -1
  205. package/version.mjs +1 -1
@@ -0,0 +1,351 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { buildHeaders } from '../internal/headers';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ /**
10
+ * Buckets are named partitions of the knowledge graph within an
11
+ * account+environment. Entities, mentions, and relations are scoped to a
12
+ * bucket so a single account+environment can host multiple isolated graphs
13
+ * — for example one per data source or workspace.
14
+ *
15
+ * Every account+environment has exactly one **default** bucket, used by
16
+ * unscoped flows. The default bucket can be renamed but never deleted.
17
+ *
18
+ * Use these endpoints to create, list, fetch, rename, and delete buckets:
19
+ *
20
+ * - **`POST /v3/buckets`** creates a non-default bucket.
21
+ * - **`GET /v3/buckets`** lists buckets with cursor pagination
22
+ * (`startingAfter` / `endingBefore` over `bucketID`).
23
+ * - **`PATCH /v3/buckets/{bucketID}`** updates `name` and/or `description`.
24
+ * - **`DELETE /v3/buckets/{bucketID}`** soft-deletes a bucket. A non-empty
25
+ * bucket is rejected with `409 Conflict` unless `?cascade=true` is
26
+ * passed; the default bucket can never be deleted.
27
+ */
28
+ export class Buckets extends APIResource {
29
+ /**
30
+ * Create a Bucket
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const bucket = await client.buckets.create({
35
+ * name: 'invoices',
36
+ * description: 'Knowledge graph for invoice documents',
37
+ * });
38
+ * ```
39
+ */
40
+ create(body: BucketCreateParams, options?: RequestOptions): APIPromise<BucketCreateResponse> {
41
+ return this._client.post('/v3/buckets', { body, ...options });
42
+ }
43
+
44
+ /**
45
+ * Get a Bucket
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const bucket = await client.buckets.retrieve('bucketID');
50
+ * ```
51
+ */
52
+ retrieve(bucketID: string, options?: RequestOptions): APIPromise<BucketRetrieveResponse> {
53
+ return this._client.get(path`/v3/buckets/${bucketID}`, options);
54
+ }
55
+
56
+ /**
57
+ * Update a Bucket
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const bucket = await client.buckets.update('bucketID');
62
+ * ```
63
+ */
64
+ update(
65
+ bucketID: string,
66
+ body: BucketUpdateParams,
67
+ options?: RequestOptions,
68
+ ): APIPromise<BucketUpdateResponse> {
69
+ return this._client.patch(path`/v3/buckets/${bucketID}`, { body, ...options });
70
+ }
71
+
72
+ /**
73
+ * List Buckets
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const buckets = await client.buckets.list();
78
+ * ```
79
+ */
80
+ list(
81
+ query: BucketListParams | null | undefined = {},
82
+ options?: RequestOptions,
83
+ ): APIPromise<BucketListResponse> {
84
+ return this._client.get('/v3/buckets', { query, ...options });
85
+ }
86
+
87
+ /**
88
+ * Delete a Bucket
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * await client.buckets.delete('bucketID');
93
+ * ```
94
+ */
95
+ delete(
96
+ bucketID: string,
97
+ params: BucketDeleteParams | null | undefined = {},
98
+ options?: RequestOptions,
99
+ ): APIPromise<void> {
100
+ const { cascade } = params ?? {};
101
+ return this._client.delete(path`/v3/buckets/${bucketID}`, {
102
+ query: { cascade },
103
+ ...options,
104
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
105
+ });
106
+ }
107
+ }
108
+
109
+ /**
110
+ * A Bucket is a named partition of the knowledge graph within an
111
+ * account+environment. Entities, mentions, and relations are scoped to a bucket so
112
+ * a single account+environment can host multiple isolated graphs.
113
+ *
114
+ * Every account+environment has exactly one default bucket. The default bucket can
115
+ * be renamed but never deleted.
116
+ */
117
+ export interface BucketCreateResponse {
118
+ /**
119
+ * Stable public identifier for the bucket (`bkt_...`).
120
+ */
121
+ bucketID: string;
122
+
123
+ /**
124
+ * Creation timestamp (RFC 3339).
125
+ */
126
+ createdAt: string;
127
+
128
+ /**
129
+ * Optional human-facing note about the bucket.
130
+ */
131
+ description: string;
132
+
133
+ /**
134
+ * Whether this is the account+environment's default bucket.
135
+ */
136
+ isDefault: boolean;
137
+
138
+ /**
139
+ * Human-facing bucket name. Unique within an account+environment.
140
+ */
141
+ name: string;
142
+
143
+ /**
144
+ * Last-update timestamp (RFC 3339).
145
+ */
146
+ updatedAt: string;
147
+ }
148
+
149
+ /**
150
+ * A Bucket is a named partition of the knowledge graph within an
151
+ * account+environment. Entities, mentions, and relations are scoped to a bucket so
152
+ * a single account+environment can host multiple isolated graphs.
153
+ *
154
+ * Every account+environment has exactly one default bucket. The default bucket can
155
+ * be renamed but never deleted.
156
+ */
157
+ export interface BucketRetrieveResponse {
158
+ /**
159
+ * Stable public identifier for the bucket (`bkt_...`).
160
+ */
161
+ bucketID: string;
162
+
163
+ /**
164
+ * Creation timestamp (RFC 3339).
165
+ */
166
+ createdAt: string;
167
+
168
+ /**
169
+ * Optional human-facing note about the bucket.
170
+ */
171
+ description: string;
172
+
173
+ /**
174
+ * Whether this is the account+environment's default bucket.
175
+ */
176
+ isDefault: boolean;
177
+
178
+ /**
179
+ * Human-facing bucket name. Unique within an account+environment.
180
+ */
181
+ name: string;
182
+
183
+ /**
184
+ * Last-update timestamp (RFC 3339).
185
+ */
186
+ updatedAt: string;
187
+ }
188
+
189
+ /**
190
+ * A Bucket is a named partition of the knowledge graph within an
191
+ * account+environment. Entities, mentions, and relations are scoped to a bucket so
192
+ * a single account+environment can host multiple isolated graphs.
193
+ *
194
+ * Every account+environment has exactly one default bucket. The default bucket can
195
+ * be renamed but never deleted.
196
+ */
197
+ export interface BucketUpdateResponse {
198
+ /**
199
+ * Stable public identifier for the bucket (`bkt_...`).
200
+ */
201
+ bucketID: string;
202
+
203
+ /**
204
+ * Creation timestamp (RFC 3339).
205
+ */
206
+ createdAt: string;
207
+
208
+ /**
209
+ * Optional human-facing note about the bucket.
210
+ */
211
+ description: string;
212
+
213
+ /**
214
+ * Whether this is the account+environment's default bucket.
215
+ */
216
+ isDefault: boolean;
217
+
218
+ /**
219
+ * Human-facing bucket name. Unique within an account+environment.
220
+ */
221
+ name: string;
222
+
223
+ /**
224
+ * Last-update timestamp (RFC 3339).
225
+ */
226
+ updatedAt: string;
227
+ }
228
+
229
+ /**
230
+ * Response body for listing buckets.
231
+ */
232
+ export interface BucketListResponse {
233
+ buckets: Array<BucketListResponse.Bucket>;
234
+
235
+ /**
236
+ * Total number of buckets matching the query, ignoring pagination.
237
+ */
238
+ totalCount: number;
239
+ }
240
+
241
+ export namespace BucketListResponse {
242
+ /**
243
+ * A Bucket is a named partition of the knowledge graph within an
244
+ * account+environment. Entities, mentions, and relations are scoped to a bucket so
245
+ * a single account+environment can host multiple isolated graphs.
246
+ *
247
+ * Every account+environment has exactly one default bucket. The default bucket can
248
+ * be renamed but never deleted.
249
+ */
250
+ export interface Bucket {
251
+ /**
252
+ * Stable public identifier for the bucket (`bkt_...`).
253
+ */
254
+ bucketID: string;
255
+
256
+ /**
257
+ * Creation timestamp (RFC 3339).
258
+ */
259
+ createdAt: string;
260
+
261
+ /**
262
+ * Optional human-facing note about the bucket.
263
+ */
264
+ description: string;
265
+
266
+ /**
267
+ * Whether this is the account+environment's default bucket.
268
+ */
269
+ isDefault: boolean;
270
+
271
+ /**
272
+ * Human-facing bucket name. Unique within an account+environment.
273
+ */
274
+ name: string;
275
+
276
+ /**
277
+ * Last-update timestamp (RFC 3339).
278
+ */
279
+ updatedAt: string;
280
+ }
281
+ }
282
+
283
+ export interface BucketCreateParams {
284
+ /**
285
+ * Bucket name. Required and unique within the account+environment.
286
+ */
287
+ name: string;
288
+
289
+ /**
290
+ * Optional description.
291
+ */
292
+ description?: string;
293
+ }
294
+
295
+ export interface BucketUpdateParams {
296
+ /**
297
+ * New description.
298
+ */
299
+ description?: string;
300
+
301
+ /**
302
+ * New name.
303
+ */
304
+ name?: string;
305
+ }
306
+
307
+ export interface BucketListParams {
308
+ /**
309
+ * Cursor: return buckets whose `bucketID` sorts before this value.
310
+ */
311
+ endingBefore?: string;
312
+
313
+ /**
314
+ * Maximum number of buckets to return (default 50, max 200).
315
+ */
316
+ limit?: number;
317
+
318
+ /**
319
+ * Case-insensitive substring match on the bucket name.
320
+ */
321
+ nameSubstring?: string;
322
+
323
+ /**
324
+ * Cursor: return buckets whose `bucketID` sorts after this value.
325
+ */
326
+ startingAfter?: string;
327
+ }
328
+
329
+ export interface BucketDeleteParams {
330
+ /**
331
+ * When `true`, delete the bucket even if it still contains entities (the entities
332
+ * are removed along with it). When omitted or `false`, the request is rejected
333
+ * with `409 Conflict` if the bucket is non-empty.
334
+ *
335
+ * The default bucket can never be deleted regardless of this flag.
336
+ */
337
+ cascade?: boolean;
338
+ }
339
+
340
+ export declare namespace Buckets {
341
+ export {
342
+ type BucketCreateResponse as BucketCreateResponse,
343
+ type BucketRetrieveResponse as BucketRetrieveResponse,
344
+ type BucketUpdateResponse as BucketUpdateResponse,
345
+ type BucketListResponse as BucketListResponse,
346
+ type BucketCreateParams as BucketCreateParams,
347
+ type BucketUpdateParams as BucketUpdateParams,
348
+ type BucketListParams as BucketListParams,
349
+ type BucketDeleteParams as BucketDeleteParams,
350
+ };
351
+ }