@ingram-cloud/sdk 1.8.0 → 1.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.
@@ -229,23 +229,37 @@ export const VectorStoreFileBatchOut = z
229
229
  })
230
230
  .meta({ id: "VectorStoreFileBatchOut" });
231
231
  // ── Search ───────────────────────────────────────────────────────────────────
232
+ /** OpenAI's `ranking_options`. `hybrid_search` turns on reciprocal-rank fusion
233
+ * of the embedding ranking with a full-text (keyword) ranking, weighted as
234
+ * given; without it search is embedding-only. */
235
+ export const VectorStoreRankingOptions = z
236
+ .object({
237
+ score_threshold: z.number().min(0).max(1).optional(),
238
+ hybrid_search: z
239
+ .object({
240
+ embedding_weight: z.number().min(0),
241
+ text_weight: z.number().min(0),
242
+ })
243
+ .refine((w) => w.embedding_weight > 0 || w.text_weight > 0, {
244
+ message: "at least one weight must be positive",
245
+ })
246
+ .optional(),
247
+ })
248
+ .meta({ id: "VectorStoreRankingOptions" });
232
249
  export const VectorStoreSearchIn = z
233
250
  .object({
234
251
  query: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]),
235
252
  max_num_results: z.number().int().min(1).max(50).optional(),
236
253
  filters: VectorStoreFilter.nullish(),
237
- ranking_options: z
238
- .object({
239
- score_threshold: z.number().min(0).max(1).optional(),
240
- })
241
- .optional(),
254
+ ranking_options: VectorStoreRankingOptions.optional(),
242
255
  })
243
256
  .meta({ id: "VectorStoreSearchIn" });
244
257
  export const VectorStoreSearchResult = z
245
258
  .object({
246
259
  file_id: z.string(),
247
260
  filename: z.string(),
248
- /** Cosine similarity in [0, 1]. */
261
+ /** In [0, 1]: cosine similarity, or — with `hybrid_search` — the fused
262
+ * reciprocal-rank score (1 = first in both rankings). */
249
263
  score: z.number(),
250
264
  attributes: VectorStoreAttributes.nullable(),
251
265
  content: z.array(z.object({ type: z.literal("text"), text: z.string() })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ingram-cloud/sdk",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Typed wire contract + management-plane client for the Ingram Cloud API: Zod schemas to validate request/response bodies, TypeScript types for the JSON you read back, SSE/webhook event types, and a typed REST client.",
5
5
  "keywords": [
6
6
  "api",
@@ -268,16 +268,30 @@ export const VectorStoreFileBatchOut = z
268
268
 
269
269
  // ── Search ───────────────────────────────────────────────────────────────────
270
270
 
271
+ /** OpenAI's `ranking_options`. `hybrid_search` turns on reciprocal-rank fusion
272
+ * of the embedding ranking with a full-text (keyword) ranking, weighted as
273
+ * given; without it search is embedding-only. */
274
+ export const VectorStoreRankingOptions = z
275
+ .object({
276
+ score_threshold: z.number().min(0).max(1).optional(),
277
+ hybrid_search: z
278
+ .object({
279
+ embedding_weight: z.number().min(0),
280
+ text_weight: z.number().min(0),
281
+ })
282
+ .refine((w) => w.embedding_weight > 0 || w.text_weight > 0, {
283
+ message: "at least one weight must be positive",
284
+ })
285
+ .optional(),
286
+ })
287
+ .meta({ id: "VectorStoreRankingOptions" });
288
+
271
289
  export const VectorStoreSearchIn = z
272
290
  .object({
273
291
  query: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]),
274
292
  max_num_results: z.number().int().min(1).max(50).optional(),
275
293
  filters: VectorStoreFilter.nullish(),
276
- ranking_options: z
277
- .object({
278
- score_threshold: z.number().min(0).max(1).optional(),
279
- })
280
- .optional(),
294
+ ranking_options: VectorStoreRankingOptions.optional(),
281
295
  })
282
296
  .meta({ id: "VectorStoreSearchIn" });
283
297
 
@@ -285,7 +299,8 @@ export const VectorStoreSearchResult = z
285
299
  .object({
286
300
  file_id: z.string(),
287
301
  filename: z.string(),
288
- /** Cosine similarity in [0, 1]. */
302
+ /** In [0, 1]: cosine similarity, or — with `hybrid_search` — the fused
303
+ * reciprocal-rank score (1 = first in both rankings). */
289
304
  score: z.number(),
290
305
  attributes: VectorStoreAttributes.nullable(),
291
306
  content: z.array(z.object({ type: z.literal("text"), text: z.string() })),