@mcowger/opencode-plexus 1.4.10 → 1.4.12
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 +5 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -71,7 +71,7 @@ function matchesPattern(id, name, shortId, pattern) {
|
|
|
71
71
|
}
|
|
72
72
|
// ../plexus-models/src/convert.ts
|
|
73
73
|
var REASONING_PARAMS = new Set(["reasoning", "include_reasoning", "reasoning_effort"]);
|
|
74
|
-
var NON_CHAT_PATTERN = /(?:^|[\W_])(?:embed(?:ding|dings)?|transcri(?:be[ds]?|ptions?)|whisper|speech[\W_]*to[\W_]*text|stt|text[\W_]*to[\W_]*speech|tts|image[\W_]*(?:gen(?:eration)?|\d+)
|
|
74
|
+
var NON_CHAT_PATTERN = /(?:^|[\W_])(?:embed(?:ding|dings)?|transcri(?:be[ds]?|ptions?)|whisper|speech[\W_]*to[\W_]*text|stt|text[\W_]*to[\W_]*speech|tts|image(?:[\W_]*(?:gen(?:eration)?|\d+))?|diffusion|dall[\W_]*e|stable[\W_]*diffusion|sdxl|dream)(?:$|[\W_])/i;
|
|
75
75
|
var API_DIALECT_MAP = {
|
|
76
76
|
chat_completions: "openai-completions",
|
|
77
77
|
"openai-completions": "openai-completions",
|
|
@@ -112,15 +112,17 @@ function isChatModel(model) {
|
|
|
112
112
|
return false;
|
|
113
113
|
}
|
|
114
114
|
const outputModalities = model.architecture?.output_modalities;
|
|
115
|
-
if (outputModalities !== undefined &&
|
|
115
|
+
if (outputModalities !== undefined && (outputModalities.length === 0 || outputModalities.some((m) => m !== "text"))) {
|
|
116
116
|
return false;
|
|
117
|
+
}
|
|
117
118
|
const modality = model.architecture?.modality;
|
|
118
119
|
if (modality?.includes("->")) {
|
|
119
120
|
const input = modality.split("->")[0] ?? "";
|
|
120
121
|
if (!input.toLowerCase().includes("text"))
|
|
121
122
|
return false;
|
|
122
123
|
const output = modality.split("->").at(-1) ?? "";
|
|
123
|
-
|
|
124
|
+
const outputTokens = output.toLowerCase().split(/[+,]/).map((t) => t.trim()).filter((t) => t.length > 0);
|
|
125
|
+
if (outputTokens.length === 0 || outputTokens.some((t) => t !== "text"))
|
|
124
126
|
return false;
|
|
125
127
|
}
|
|
126
128
|
const apiHints = Array.isArray(model.preferred_api) ? model.preferred_api.join(" ") : model.preferred_api ?? "";
|