@fish-under-sea/magpie-dragonapi 1.0.6 → 1.0.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/lib/catalog.mjs +6 -2
- package/package.json +1 -1
package/lib/catalog.mjs
CHANGED
|
@@ -35,6 +35,10 @@ export function kindOf(row) {
|
|
|
35
35
|
if (ends.some((e) => /^(audio|tts|asr|transcription|speech)$/i.test(e))) return 'audio'
|
|
36
36
|
if (ends.some((e) => /^(embedding|jina-rerank|rerank)$/i.test(e))) return 'embedding'
|
|
37
37
|
const groups = Array.isArray(row?.enable_groups) ? row.enable_groups.join(' ').toLowerCase() : ''
|
|
38
|
+
const tags = String(row?.tags || '').toLowerCase()
|
|
39
|
+
// 站点把生图模型挂在 image 分组,endpoint 仍写 openai/gemini,单看 endpoint
|
|
40
|
+
// 会被误判成 chat,然后混进 LLM 列表、还带上思考强度。分组/tag 是可靠信号。
|
|
41
|
+
if (/image|图像|生图|绘图|绘画/.test(groups) || /图像|生图|绘图|绘画/.test(tags)) return 'image'
|
|
38
42
|
if (/embedding|向量|rerank/.test(groups)) return 'embedding'
|
|
39
43
|
return 'chat'
|
|
40
44
|
}
|
|
@@ -42,7 +46,7 @@ export function kindOf(row) {
|
|
|
42
46
|
/** kindOutput 是 magpie 的 capabilities.output:分区靠它认。 */
|
|
43
47
|
export function kindOutput(kind) {
|
|
44
48
|
switch (kind) {
|
|
45
|
-
case 'image': return { image: true, text:
|
|
49
|
+
case 'image': return { image: true, text: false }
|
|
46
50
|
case 'video': return { video: true, text: true }
|
|
47
51
|
case 'audio': return { audio: true, text: true }
|
|
48
52
|
case 'embedding': return { embedding: true, text: true }
|
|
@@ -153,7 +157,7 @@ export function buildCatalog(env, { cur, enabledGroups = [], site } = {}) {
|
|
|
153
157
|
input: { text: true, image: false, audio: false, video: false, pdf: false },
|
|
154
158
|
...(kind === 'chat' ? { reasoning: true } : {}),
|
|
155
159
|
},
|
|
156
|
-
...(kind === 'chat' ? { variants: { low: {}, medium: {}, high: {} } } : {}),
|
|
160
|
+
...(kind === 'chat' ? { variants: { minimal: {}, low: {}, medium: {}, high: {}, xhigh: {}, max: {} } } : {}),
|
|
157
161
|
// 排序用的私有字段,不进宿主(宿主会忽略不认识的键)
|
|
158
162
|
_rank: [r0, r1, name],
|
|
159
163
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fish-under-sea/magpie-dragonapi",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "DragonAPI for magpie: a provider plugin whose models, groups and prices come from the site's public /api/pricing, with balance and per-call usage from an sk- key, plus a local page that lists the market (read-only), shows usage and can mint new keys for a group.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.mjs",
|