@alisio/plugin-openai-compatible 0.1.0-alpha.6 → 0.1.0-alpha.8
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.js +11 -1
- package/dist/provider.js +2 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -39,6 +39,13 @@ export function createOpenAICompatiblePlugin() {
|
|
|
39
39
|
kind: "secret",
|
|
40
40
|
description: "Stored only in the global credentials file",
|
|
41
41
|
},
|
|
42
|
+
{
|
|
43
|
+
key: "apiKeyEnv",
|
|
44
|
+
label: "API key environment variable",
|
|
45
|
+
kind: "text",
|
|
46
|
+
defaultValue: defaults.apiKeyEnv,
|
|
47
|
+
description: "Environment variable consulted when no stored API key exists; the connection remembers this name",
|
|
48
|
+
},
|
|
42
49
|
{
|
|
43
50
|
key: "apiMode",
|
|
44
51
|
label: "API mode",
|
|
@@ -83,7 +90,10 @@ export function createOpenAICompatiblePlugin() {
|
|
|
83
90
|
create(request) {
|
|
84
91
|
const auth = value(request, "auth", defaults.auth);
|
|
85
92
|
const apiKey = request.credentials.apiKey;
|
|
86
|
-
const
|
|
93
|
+
const rawApiKeyEnv = value(request, "apiKeyEnv", defaults.apiKeyEnv);
|
|
94
|
+
const apiKeyEnv = typeof rawApiKeyEnv === "string" && rawApiKeyEnv.trim()
|
|
95
|
+
? rawApiKeyEnv.trim()
|
|
96
|
+
: defaults.apiKeyEnv;
|
|
87
97
|
if (auth !== "none" && !apiKey && !process.env[apiKeyEnv])
|
|
88
98
|
throw new Error("API key is required (enter one in /connect or set the configured environment variable)");
|
|
89
99
|
const config = {
|
package/dist/provider.js
CHANGED
|
@@ -138,7 +138,7 @@ export class OpenAICompatibleProvider {
|
|
|
138
138
|
if (completed.some((c) => !c.id || !c.name))
|
|
139
139
|
throw new Error("Incomplete tool call");
|
|
140
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");
|
|
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
142
|
yield {
|
|
143
143
|
type: "completed",
|
|
144
144
|
message: {
|
|
@@ -216,7 +216,7 @@ export class OpenAICompatibleProvider {
|
|
|
216
216
|
.map((x) => x.text)
|
|
217
217
|
.join("");
|
|
218
218
|
if (!text.trim())
|
|
219
|
-
throw new Error("Provider response cut off by max output tokens before any usable content; raise limits.maxOutputTokens");
|
|
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
220
|
if (calls.some((c) => !c.id || !c.name))
|
|
221
221
|
throw new Error("Incomplete tool call");
|
|
222
222
|
yield {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alisio/plugin-openai-compatible",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.8",
|
|
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-alpha.
|
|
27
|
+
"@alisio/sdk": "^0.1.0-alpha.6"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@alisio/sdk": "0.1.0-alpha.
|
|
30
|
+
"@alisio/sdk": "0.1.0-alpha.6"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public",
|