@chainfuse/ai-tools 0.14.9 → 1.0.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.
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "ChainFuse",
|
|
6
6
|
"homepage": "https://github.com/ChainFuse/packages/tree/main/packages/ai-tools#readme",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"prettier": "@demosjarco/prettier-config",
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@ai-sdk/anthropic": "^2.0.15",
|
|
52
|
-
"@ai-sdk/azure": "^2.0.
|
|
52
|
+
"@ai-sdk/azure": "^2.0.28",
|
|
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": "^
|
|
57
|
-
"@chainfuse/types": "^
|
|
56
|
+
"@chainfuse/helpers": "^4.0.1",
|
|
57
|
+
"@chainfuse/types": "^3.0.1",
|
|
58
58
|
"ai": "^5.0.39",
|
|
59
59
|
"chalk": "^5.6.2",
|
|
60
60
|
"haversine-distance": "^1.2.4",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@ai-sdk/provider": "^2.0.0",
|
|
65
|
-
"@cloudflare/workers-types": "^4.
|
|
66
|
-
"openai": "^5.20.
|
|
65
|
+
"@cloudflare/workers-types": "^4.20250910.0",
|
|
66
|
+
"openai": "^5.20.1"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "4ac5a49456f61c637bb377d69ef8f97225a28d06"
|
|
69
69
|
}
|