@chainfuse/ai-tools 0.14.9 → 1.0.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.
@@ -62,7 +62,7 @@ export class AiRawProviders extends AiBase {
62
62
  name: 'openai',
63
63
  }),
64
64
  // Generate incomplete id because we don't have the body to hash yet. Fill it in in the `fetch()`
65
- idempotencyId: args.idempotencyId ?? (await BufferHelpers.generateUuid).utf8.slice(0, 23),
65
+ idempotencyId: args.idempotencyId ?? (await BufferHelpers.generateUuid7()).utf8.slice(0, 23),
66
66
  executor: JSON.stringify(args.executor),
67
67
  }),
68
68
  ...(args.cache && { 'cf-aig-cache-ttl': (typeof args.cache === 'boolean' ? (args.cache ? this.cacheTtl : 0) : args.cache).toString() }),
@@ -115,7 +115,7 @@ export class AiRawProviders extends AiBase {
115
115
  dataspaceId: (await BufferHelpers.uuidConvert(args.dataspaceId)).utf8,
116
116
  ...(args.groupBillingId && { groupBillingId: (await BufferHelpers.uuidConvert(args.groupBillingId)).utf8 }),
117
117
  // Generate incomplete id because we don't have the body to hash yet. Fill it in in the `fetch()`
118
- idempotencyId: args.idempotencyId ?? (await BufferHelpers.generateUuid).utf8.slice(0, 23),
118
+ idempotencyId: args.idempotencyId ?? (await BufferHelpers.generateUuid7()).utf8.slice(0, 23),
119
119
  executor: JSON.stringify(args.executor),
120
120
  // @ts-expect-error server info gets added in afterwards
121
121
  }),
@@ -247,7 +247,7 @@ export class AiRawProviders extends AiBase {
247
247
  name: 'anthropic',
248
248
  }),
249
249
  // Generate incomplete id because we don't have the body to hash yet. Fill it in in the `fetch()`
250
- idempotencyId: args.idempotencyId ?? (await BufferHelpers.generateUuid).utf8.slice(0, 23),
250
+ idempotencyId: args.idempotencyId ?? (await BufferHelpers.generateUuid7()).utf8.slice(0, 23),
251
251
  executor: JSON.stringify(args.executor),
252
252
  }),
253
253
  ...(args.cache && { 'cf-aig-cache-ttl': (typeof args.cache === 'boolean' ? (args.cache ? this.cacheTtl : 0) : args.cache).toString() }),
@@ -332,7 +332,7 @@ export class AiRawProviders extends AiBase {
332
332
  'X-Dataspace-Id': (await BufferHelpers.uuidConvert(args.dataspaceId)).utf8,
333
333
  'X-Executor': JSON.stringify(args.executor),
334
334
  // Generate incomplete id because we don't have the body to hash yet. Fill it in in the `fetch()`
335
- 'X-Idempotency-Id': args.idempotencyId ?? (await BufferHelpers.generateUuid).utf8.slice(0, 23),
335
+ 'X-Idempotency-Id': args.idempotencyId ?? (await BufferHelpers.generateUuid7()).utf8.slice(0, 23),
336
336
  // Request to skip or custom cache duration (no guarantee that upstream server will respect it)
337
337
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
338
338
  ...((args.skipCache || args.cache) && { 'Cache-Control': [args.skipCache && 'no-cache', args.cache && `max-age=${typeof args.cache === 'boolean' ? (args.cache ? this.cacheTtl : 0) : args.cache}`].join(', ') }),
@@ -405,7 +405,7 @@ export class AiRawProviders extends AiBase {
405
405
  name: 'googleai',
406
406
  }),
407
407
  // Generate incomplete id because we don't have the body to hash yet. Fill it in in the `fetch()`
408
- idempotencyId: args.idempotencyId ?? (await BufferHelpers.generateUuid).utf8.slice(0, 23),
408
+ idempotencyId: args.idempotencyId ?? (await BufferHelpers.generateUuid7()).utf8.slice(0, 23),
409
409
  executor: JSON.stringify(args.executor),
410
410
  }),
411
411
  ...(args.cache && { 'cf-aig-cache-ttl': (typeof args.cache === 'boolean' ? (args.cache ? this.cacheTtl : 0) : args.cache).toString() }),
@@ -454,7 +454,7 @@ export class AiRawProviders extends AiBase {
454
454
  name: 'cloudflare',
455
455
  }),
456
456
  // Generate incomplete id because we don't have the body to hash yet. Fill it in in the `fetch()`
457
- idempotencyId: args.idempotencyId ?? (await BufferHelpers.generateUuid).utf8.slice(0, 23),
457
+ idempotencyId: args.idempotencyId ?? (await BufferHelpers.generateUuid7()).utf8.slice(0, 23),
458
458
  executor: JSON.stringify(args.executor),
459
459
  }),
460
460
  ...(args.cache && { 'cf-aig-cache-ttl': (typeof args.cache === 'boolean' ? (args.cache ? this.cacheTtl : 0) : args.cache).toString() }),
@@ -511,7 +511,7 @@ export class AiRawProviders extends AiBase {
511
511
  name: 'cloudflare',
512
512
  }),
513
513
  // Generate incomplete id because we don't have the body to hash yet. Fill it in in the `fetch()`
514
- idempotencyId: args.idempotencyId ?? (await BufferHelpers.generateUuid).utf8.slice(0, 23),
514
+ idempotencyId: args.idempotencyId ?? (await BufferHelpers.generateUuid7()).utf8.slice(0, 23),
515
515
  executor: JSON.stringify(args.executor),
516
516
  },
517
517
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainfuse/ai-tools",
3
- "version": "0.14.9",
3
+ "version": "1.0.0",
4
4
  "description": "",
5
5
  "author": "ChainFuse",
6
6
  "homepage": "https://github.com/ChainFuse/packages/tree/main/packages/ai-tools#readme",
@@ -53,8 +53,8 @@
53
53
  "@ai-sdk/google": "^2.0.13",
54
54
  "@ai-sdk/openai": "^2.0.16",
55
55
  "@ai-sdk/openai-compatible": "^1.0.15",
56
- "@chainfuse/helpers": "^3.6.0",
57
- "@chainfuse/types": "^2.12.0",
56
+ "@chainfuse/helpers": "^4.0.0",
57
+ "@chainfuse/types": "^3.0.0",
58
58
  "ai": "^5.0.39",
59
59
  "chalk": "^5.6.2",
60
60
  "haversine-distance": "^1.2.4",
@@ -65,5 +65,5 @@
65
65
  "@cloudflare/workers-types": "^4.20250909.0",
66
66
  "openai": "^5.20.0"
67
67
  },
68
- "gitHead": "fe95f7c82786f19dda1e465f38b19be98613f981"
68
+ "gitHead": "a53477407bf7365156b75df30b94c9ad5d58bb53"
69
69
  }