@fish-under-sea/magpie-dragonapi 1.1.0 → 1.1.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/index.mjs CHANGED
@@ -219,7 +219,7 @@ export default async function dragonapi(input, options) {
219
219
  {
220
220
  key: OPT_RESPONSES,
221
221
  label: '优先 Responses API',
222
- description: '同时支持 chat 与 Responses 的模型改用 Responses API;关掉则走 chat completions。',
222
+ description: '打开后 OpenAI 系模型改走 Responses API,模型设置里才会出现 Responses 协议选项;关掉走 chat completions。可再按模型单独改回 OpenAI。',
223
223
  default: false,
224
224
  },
225
225
  ],
package/lib/catalog.mjs CHANGED
@@ -22,11 +22,18 @@ export function npmOf(row, { preferResponses = false } = {}) {
22
22
  // 按模型挑原生协议,才能真正做到「每个模型走自己的端点」。
23
23
  if (ends.includes('anthropic')) return '@ai-sdk/anthropic'
24
24
  if (ends.includes('gemini')) return '@ai-sdk/google'
25
- // Responses API:只有声明了 openai-response 才可能走它;同时支持 chat 时
26
- // 默认走 chat(兼容性最好),用户打开「优先 Responses」才切过去。
25
+ // Responses API(`@ai-sdk/openai`)。magpie 的编辑器只给它「看到了协议地址」
26
+ // 的协议出选项,而插件供应商的协议地址是从模型表里归纳出来的——所以哪怕只想
27
+ // 摆一个 Responses 选项,也必须有模型真的用它。
28
+ //
29
+ // - 只声明 openai-response:本来就只有 Responses 一条路,直接走它。
30
+ // - 同时声明 openai + openai-response:默认 chat(兼容性最好);用户打开
31
+ // 「优先 Responses」后改走 Responses,此时编辑器里才会出现 Responses 选项,
32
+ // 可以再按模型单独改回 OpenAI。
27
33
  const responses = ends.includes('openai-response')
28
34
  const chat = ends.includes('openai')
29
35
  if (responses && (!chat || preferResponses)) return '@ai-sdk/openai'
36
+ if (preferResponses && chat) return '@ai-sdk/openai'
30
37
  return '@ai-sdk/openai-compatible'
31
38
  }
32
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fish-under-sea/magpie-dragonapi",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
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",