duojie-helper 0.2.19 → 0.2.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "duojie-helper",
3
- "version": "0.2.19",
3
+ "version": "0.2.20",
4
4
  "description": "Duojie API 一键配置助手 - 支持 Claude Code, Droid, OpenClaw, Cursor, Cline 等主流 AI 编程工具",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -105,12 +105,14 @@ export async function fetchModels(apiKey) {
105
105
  const id = model.id;
106
106
  // 跳过未在 pricing 页面公开的隐藏模型
107
107
  if (publicIds && !publicIds.has(id)) continue;
108
+ // 跳过含 image 的模型(图像生成类,不支持对话)
109
+ if (id.toLowerCase().includes('image')) continue;
108
110
  const endpoints = model.supported_endpoint_types || [];
109
111
 
110
- // 判断最佳协议
111
- let api = 'openai-completions'; // 默认
112
+ // 判断最佳协议:GPT 用 openai,其余统一用 anthropic-messages
113
+ let api = 'anthropic-messages'; // 默认
112
114
  if (id.startsWith('gpt')) {
113
- // GPT 模型优先用 openai-response,否则 openai
115
+ // GPT 模型优先用 openai-responses,否则 openai-completions
114
116
  if (endpoints.includes('openai-response')) {
115
117
  api = 'openai-responses';
116
118
  } else {
@@ -118,19 +120,12 @@ export async function fetchModels(apiKey) {
118
120
  }
119
121
  models.gpt.push({ id, name: id, api, endpoints });
120
122
  } else if (id.startsWith('claude')) {
121
- // Claude 模型用 anthropic
122
- api = 'anthropic-messages';
123
123
  models.claude.push({ id, name: id, api, endpoints });
124
124
  } else if (id.startsWith('gemini')) {
125
- // Gemini 模型
126
- api = endpoints.includes('anthropic') ? 'anthropic-messages' : 'openai-completions';
127
125
  models.gemini.push({ id, name: id, api, endpoints });
128
126
  } else if (id.startsWith('glm')) {
129
- // GLM 模型
130
- api = 'openai-completions';
131
127
  models.other.push({ id, name: id, api, endpoints });
132
128
  } else {
133
- api = endpoints.includes('anthropic') ? 'anthropic-messages' : 'openai-completions';
134
129
  models.other.push({ id, name: id, api, endpoints });
135
130
  }
136
131
  }
@@ -70,8 +70,8 @@ function generateDisplayName(modelId) {
70
70
  * @returns {string} provider 名称
71
71
  */
72
72
  function determineProvider(modelId, endpoints = []) {
73
- if (modelId.startsWith('claude')) return 'anthropic';
74
- return 'openai';
73
+ if (modelId.startsWith('gpt')) return 'openai';
74
+ return 'anthropic';
75
75
  }
76
76
 
77
77
  /**