@rulvar/bridge-ai-sdk 1.3.0 → 1.3.2
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/README.md +29 -0
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @rulvar/bridge-ai-sdk
|
|
2
|
+
|
|
3
|
+
Bridge adapter that wraps any Vercel AI SDK language model as a rulvar
|
|
4
|
+
provider adapter, covering the long tail of providers; it performs a
|
|
5
|
+
specification-version check at runtime and is, by design, the
|
|
6
|
+
highest-churn package in the project. Exports `bridgeAiSdk`.
|
|
7
|
+
|
|
8
|
+
Part of [rulvar](https://rulvar.com), an embeddable TypeScript engine
|
|
9
|
+
for durable, budget-bounded multi-agent LLM workflows, where a completed
|
|
10
|
+
LLM call is never paid for twice. Full documentation:
|
|
11
|
+
[docs.rulvar.com](https://docs.rulvar.com).
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add @rulvar/core @rulvar/bridge-ai-sdk
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Add the AI SDK provider package you are bridging alongside it.
|
|
20
|
+
|
|
21
|
+
## Documentation
|
|
22
|
+
|
|
23
|
+
- [Providers](https://docs.rulvar.com/guide/providers)
|
|
24
|
+
- [Adapter authors](https://docs.rulvar.com/guide/adapter-authors)
|
|
25
|
+
- [API reference](https://docs.rulvar.com/api/%40rulvar/bridge-ai-sdk/)
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
[Apache-2.0](https://github.com/o-stepper/rulvar/blob/main/LICENSE)
|
package/dist/index.js
CHANGED
|
@@ -102,7 +102,7 @@ var BridgeIdMap = class {
|
|
|
102
102
|
*/
|
|
103
103
|
function bridgeAiSdk(model, options = {}) {
|
|
104
104
|
const version = model.specificationVersion;
|
|
105
|
-
if (version !== "v4") throw new ConfigError(`bridgeAiSdk requires a LanguageModelV4 (specificationVersion 'v4'); received ${JSON.stringify(version)}. A mismatched @ai-sdk/provider major cannot be bridged
|
|
105
|
+
if (version !== "v4") throw new ConfigError(`bridgeAiSdk requires a LanguageModelV4 (specificationVersion 'v4'); received ${JSON.stringify(version)}. A mismatched @ai-sdk/provider major cannot be bridged.`, { data: { received: typeof version === "string" ? version : null } });
|
|
106
106
|
const id = options.id ?? model.provider;
|
|
107
107
|
if (id === void 0 || id === "") throw new ConfigError("bridgeAiSdk requires a non-empty adapter id (model.provider was empty)");
|
|
108
108
|
const family = options.provider ?? model.provider;
|
|
@@ -204,7 +204,7 @@ function buildCallOptions(req, context) {
|
|
|
204
204
|
function applyNamespacedOptions(req, callOptions, adapterId) {
|
|
205
205
|
const ns = req.providerOptions?.[adapterId];
|
|
206
206
|
if (ns === void 0) return;
|
|
207
|
-
for (const key of CANONICAL_CONFLICT_KEYS) if (key in ns) throw new ConfigError(`providerOptions.${adapterId}.${key} contradicts a canonical ChatRequest field; canonical fields always win
|
|
207
|
+
for (const key of CANONICAL_CONFLICT_KEYS) if (key in ns) throw new ConfigError(`providerOptions.${adapterId}.${key} contradicts a canonical ChatRequest field; canonical fields always win`);
|
|
208
208
|
for (const key of LIFTED_OPTION_KEYS) if (ns[key] !== void 0) callOptions[key] = ns[key];
|
|
209
209
|
if (ns.providerOptions !== void 0) callOptions.providerOptions = ns.providerOptions;
|
|
210
210
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulvar/bridge-ai-sdk",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "rulvar bridge adapter wrapping any Vercel AI SDK LanguageModelV4 as a ProviderAdapter.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@ai-sdk/provider": "^4.0.0",
|
|
26
|
-
"@rulvar/core": "1.3.
|
|
26
|
+
"@rulvar/core": "1.3.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@ai-sdk/google": "^4.0.0",
|