@chainfuse/ai-tools 0.13.13 → 0.13.15
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.
|
@@ -2,7 +2,7 @@ import { Helpers } from '@chainfuse/helpers';
|
|
|
2
2
|
import { AiModels } from '@chainfuse/types/ai-tools';
|
|
3
3
|
import { enabledCloudflareLlmProviders } from '@chainfuse/types/ai-tools/workers-ai';
|
|
4
4
|
import { customProvider, TypeValidationError, wrapLanguageModel } from 'ai';
|
|
5
|
-
import { ZodError } from 'zod';
|
|
5
|
+
import { ZodError } from 'zod/v3';
|
|
6
6
|
import { AiBase } from '../base.mjs';
|
|
7
7
|
import { AiRawProviders } from './rawProviders.mjs';
|
|
8
8
|
export class AiCustomProviders extends AiBase {
|
|
@@ -285,21 +285,18 @@ export class AiRawProviders extends AiBase {
|
|
|
285
285
|
}
|
|
286
286
|
custom(args) {
|
|
287
287
|
if (this.config.providers.custom?.url) {
|
|
288
|
-
return import('zod')
|
|
288
|
+
return import('zod/v4')
|
|
289
289
|
.then(({ z }) =>
|
|
290
290
|
// Verify that the custom provider url is a valid URL
|
|
291
291
|
z
|
|
292
|
-
.string()
|
|
293
|
-
.trim()
|
|
294
292
|
.url()
|
|
293
|
+
.trim()
|
|
295
294
|
.transform((url) => new URL(url))
|
|
296
295
|
.parseAsync(this.config.providers.custom.url)
|
|
297
296
|
.then((customProviderUrl) =>
|
|
298
297
|
// Verify that the custom provider url is not an IP address
|
|
299
298
|
z
|
|
300
|
-
.
|
|
301
|
-
.trim()
|
|
302
|
-
.ip()
|
|
299
|
+
.union([z.ipv4().trim(), z.ipv6().trim()])
|
|
303
300
|
.safeParseAsync(customProviderUrl.hostname)
|
|
304
301
|
.then(({ success }) => ({ customProviderUrl, success }))))
|
|
305
302
|
.then(async ({ customProviderUrl, success }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainfuse/ai-tools",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "ChainFuse",
|
|
6
6
|
"homepage": "https://github.com/ChainFuse/packages/tree/main/packages/ai-tools#readme",
|
|
@@ -53,16 +53,16 @@
|
|
|
53
53
|
"@ai-sdk/google": "^1.2.18",
|
|
54
54
|
"@ai-sdk/openai": "^1.0.5",
|
|
55
55
|
"@ai-sdk/openai-compatible": "^0.2.14",
|
|
56
|
-
"@chainfuse/helpers": "^3.2.
|
|
57
|
-
"@chainfuse/types": "^2.10.
|
|
58
|
-
"ai": "^4.3.
|
|
56
|
+
"@chainfuse/helpers": "^3.2.6",
|
|
57
|
+
"@chainfuse/types": "^2.10.11",
|
|
58
|
+
"ai": "^4.3.16",
|
|
59
59
|
"chalk": "^5.4.1",
|
|
60
60
|
"haversine-distance": "^1.2.3",
|
|
61
|
-
"workers-ai-provider": "^0.
|
|
61
|
+
"workers-ai-provider": "^0.5.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@cloudflare/workers-types": "^4.
|
|
65
|
-
"openai": "^4.
|
|
64
|
+
"@cloudflare/workers-types": "^4.20250520.0",
|
|
65
|
+
"openai": "^4.100.0"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "3b6b779a75b5742f356f192a0e2e6506d572969d"
|
|
68
68
|
}
|