ai 4.2.4 → 4.2.6
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.
- package/CHANGELOG.md +15 -0
- package/README.md +17 -4
- package/dist/index.d.mts +17 -2
- package/dist/index.d.ts +17 -2
- package/dist/index.js +13 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/react/dist/index.d.mts +1 -1
- package/react/dist/index.d.ts +1 -1
package/dist/index.mjs
CHANGED
@@ -6733,16 +6733,22 @@ _a16 = symbol16;
|
|
6733
6733
|
|
6734
6734
|
// core/registry/provider-registry.ts
|
6735
6735
|
import { NoSuchModelError as NoSuchModelError4 } from "@ai-sdk/provider";
|
6736
|
-
function
|
6737
|
-
|
6736
|
+
function createProviderRegistry(providers, {
|
6737
|
+
separator = ":"
|
6738
|
+
} = {}) {
|
6739
|
+
const registry = new DefaultProviderRegistry({
|
6740
|
+
separator
|
6741
|
+
});
|
6738
6742
|
for (const [id, provider] of Object.entries(providers)) {
|
6739
6743
|
registry.registerProvider({ id, provider });
|
6740
6744
|
}
|
6741
6745
|
return registry;
|
6742
6746
|
}
|
6747
|
+
var experimental_createProviderRegistry = createProviderRegistry;
|
6743
6748
|
var DefaultProviderRegistry = class {
|
6744
|
-
constructor() {
|
6749
|
+
constructor({ separator }) {
|
6745
6750
|
this.providers = {};
|
6751
|
+
this.separator = separator;
|
6746
6752
|
}
|
6747
6753
|
registerProvider({
|
6748
6754
|
id,
|
@@ -6763,12 +6769,12 @@ var DefaultProviderRegistry = class {
|
|
6763
6769
|
return provider;
|
6764
6770
|
}
|
6765
6771
|
splitId(id, modelType) {
|
6766
|
-
const index = id.indexOf(
|
6772
|
+
const index = id.indexOf(this.separator);
|
6767
6773
|
if (index === -1) {
|
6768
6774
|
throw new NoSuchModelError4({
|
6769
6775
|
modelId: id,
|
6770
6776
|
modelType,
|
6771
|
-
message: `Invalid ${modelType} id for registry: ${id} (must be in the format "providerId
|
6777
|
+
message: `Invalid ${modelType} id for registry: ${id} (must be in the format "providerId${this.separator}modelId")`
|
6772
6778
|
});
|
6773
6779
|
}
|
6774
6780
|
return [id.slice(0, index), id.slice(index + 1)];
|
@@ -6805,12 +6811,6 @@ var DefaultProviderRegistry = class {
|
|
6805
6811
|
}
|
6806
6812
|
return model;
|
6807
6813
|
}
|
6808
|
-
/**
|
6809
|
-
* @deprecated Use `textEmbeddingModel` instead.
|
6810
|
-
*/
|
6811
|
-
textEmbedding(id) {
|
6812
|
-
return this.textEmbeddingModel(id);
|
6813
|
-
}
|
6814
6814
|
};
|
6815
6815
|
|
6816
6816
|
// core/tool/mcp/mcp-client.ts
|
@@ -7801,6 +7801,7 @@ export {
|
|
7801
7801
|
createDataStream,
|
7802
7802
|
createDataStreamResponse,
|
7803
7803
|
createIdGenerator5 as createIdGenerator,
|
7804
|
+
createProviderRegistry,
|
7804
7805
|
customProvider,
|
7805
7806
|
defaultSettingsMiddleware,
|
7806
7807
|
embed,
|