@alisio/plugin-openai-compatible 0.1.0-alpha.9 → 0.1.0
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/provider.js +5 -7
- package/package.json +3 -3
package/dist/provider.js
CHANGED
|
@@ -135,10 +135,11 @@ export class OpenAICompatibleProvider {
|
|
|
135
135
|
if (finish !== "stop" && finish !== "tool_calls" && finish !== "length")
|
|
136
136
|
throw new Error(`Provider response incomplete: ${finish ?? "stream ended"}`);
|
|
137
137
|
const completed = [...calls.entries()].sort(([a], [b]) => a - b).map(([, c]) => c);
|
|
138
|
-
|
|
138
|
+
// A response cut by the output limit is reported as it is (`truncated: true`), even when it
|
|
139
|
+
// has no text or its tool calls are partial: the host decides whether to recover, and never
|
|
140
|
+
// executes a call whose arguments are incomplete.
|
|
141
|
+
if (finish !== "length" && completed.some((c) => !c.id || !c.name))
|
|
139
142
|
throw new Error("Incomplete tool call");
|
|
140
|
-
if (finish === "length" && !text.trim())
|
|
141
|
-
throw new Error("Provider response cut off by max output tokens before any usable content; raise limits.maxOutputTokens (/settings → Agent max output tokens)");
|
|
142
143
|
yield {
|
|
143
144
|
type: "completed",
|
|
144
145
|
message: {
|
|
@@ -215,10 +216,7 @@ export class OpenAICompatibleProvider {
|
|
|
215
216
|
.filter((x) => x.type === "output_text")
|
|
216
217
|
.map((x) => x.text)
|
|
217
218
|
.join("");
|
|
218
|
-
|
|
219
|
-
throw new Error("Provider response cut off by max output tokens before any usable content; raise limits.maxOutputTokens (/settings → Agent max output tokens)");
|
|
220
|
-
if (calls.some((c) => !c.id || !c.name))
|
|
221
|
-
throw new Error("Incomplete tool call");
|
|
219
|
+
// Reported as truncated even when empty or with partial calls: the host recovers.
|
|
222
220
|
yield {
|
|
223
221
|
type: "completed",
|
|
224
222
|
message: { role: "assistant", text, calls, providerData: r.output, truncated: true },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alisio/plugin-openai-compatible",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Built-in OpenAI-compatible model provider for Alisio.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"openai": "7.23.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@alisio/sdk": "^0.1.0
|
|
27
|
+
"@alisio/sdk": "^0.1.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@alisio/sdk": "0.1.0
|
|
30
|
+
"@alisio/sdk": "0.1.0"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public",
|