la-machina-engine 0.10.0 → 0.11.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.
- package/dist/index.cjs +35 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
package/dist/index.cjs
CHANGED
|
@@ -1039,8 +1039,18 @@ var ModelProviderEnum = import_zod.z.enum([
|
|
|
1039
1039
|
"openai",
|
|
1040
1040
|
"google",
|
|
1041
1041
|
"openai-compatible",
|
|
1042
|
+
// Plan 034 — native per-provider AI SDK adapters. Use these for
|
|
1043
|
+
// any non-OpenAI-native endpoint instead of multiplexing through
|
|
1044
|
+
// openai-compatible (which drops tool_use.input fidelity for
|
|
1045
|
+
// Anthropic-shape streams).
|
|
1046
|
+
"openrouter",
|
|
1047
|
+
"xai",
|
|
1048
|
+
"groq",
|
|
1049
|
+
"gateway",
|
|
1042
1050
|
"bedrock",
|
|
1051
|
+
// enum only; adapter not yet wired
|
|
1043
1052
|
"vertex",
|
|
1053
|
+
// enum only; adapter not yet wired
|
|
1044
1054
|
"proxy"
|
|
1045
1055
|
]);
|
|
1046
1056
|
var StorageProviderEnum = import_zod.z.enum(["local", "r2", "r2-binding"]);
|
|
@@ -1997,7 +2007,8 @@ function toAISdkTools(tools) {
|
|
|
1997
2007
|
const schema = tool.inputSchema ?? tool.input_schema ?? { type: "object" };
|
|
1998
2008
|
out[name] = {
|
|
1999
2009
|
description,
|
|
2000
|
-
parameters
|
|
2010
|
+
// AI SDK v6 field name. Must NOT be `parameters` (v3/v4 name).
|
|
2011
|
+
inputSchema: (0, import_ai.jsonSchema)(schema)
|
|
2001
2012
|
};
|
|
2002
2013
|
}
|
|
2003
2014
|
return out;
|
|
@@ -2008,6 +2019,10 @@ var import_anthropic = require("@ai-sdk/anthropic");
|
|
|
2008
2019
|
var import_openai = require("@ai-sdk/openai");
|
|
2009
2020
|
var import_google = require("@ai-sdk/google");
|
|
2010
2021
|
var import_openai_compatible = require("@ai-sdk/openai-compatible");
|
|
2022
|
+
var import_ai_sdk_provider = require("@openrouter/ai-sdk-provider");
|
|
2023
|
+
var import_xai = require("@ai-sdk/xai");
|
|
2024
|
+
var import_groq = require("@ai-sdk/groq");
|
|
2025
|
+
var import_gateway = require("@ai-sdk/gateway");
|
|
2011
2026
|
var AISdkAdapter = class {
|
|
2012
2027
|
options;
|
|
2013
2028
|
model = null;
|
|
@@ -2086,6 +2101,25 @@ var AISdkAdapter = class {
|
|
|
2086
2101
|
modelId
|
|
2087
2102
|
);
|
|
2088
2103
|
break;
|
|
2104
|
+
// Plan 034 — native per-provider AI SDK adapters. Each
|
|
2105
|
+
// adapter knows its upstream's streaming shape and
|
|
2106
|
+
// assembles tool_use.input correctly, unlike routing
|
|
2107
|
+
// non-OpenAI-format streams through openai-compatible.
|
|
2108
|
+
case "openrouter":
|
|
2109
|
+
this.model = (0, import_ai_sdk_provider.createOpenRouter)({ apiKey })(modelId);
|
|
2110
|
+
break;
|
|
2111
|
+
case "xai":
|
|
2112
|
+
this.model = (0, import_xai.createXai)({ apiKey, ...baseURL !== void 0 ? { baseURL } : {} })(modelId);
|
|
2113
|
+
break;
|
|
2114
|
+
case "groq":
|
|
2115
|
+
this.model = (0, import_groq.createGroq)({ apiKey, ...baseURL !== void 0 ? { baseURL } : {} })(modelId);
|
|
2116
|
+
break;
|
|
2117
|
+
case "gateway":
|
|
2118
|
+
if (typeof process !== "undefined" && process.env !== void 0) {
|
|
2119
|
+
process.env.AI_GATEWAY_API_KEY = apiKey;
|
|
2120
|
+
}
|
|
2121
|
+
this.model = (0, import_gateway.gateway)(modelId);
|
|
2122
|
+
break;
|
|
2089
2123
|
default:
|
|
2090
2124
|
throw new Error(`AI SDK: unsupported provider "${provider}".`);
|
|
2091
2125
|
}
|