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 +1 -1
- package/src/index.js +5 -10
- package/src/tools/droid.js +2 -2
package/package.json
CHANGED
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 = '
|
|
112
|
+
// 判断最佳协议:GPT 用 openai,其余统一用 anthropic-messages
|
|
113
|
+
let api = 'anthropic-messages'; // 默认
|
|
112
114
|
if (id.startsWith('gpt')) {
|
|
113
|
-
// GPT 模型优先用 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
|
}
|
package/src/tools/droid.js
CHANGED
|
@@ -70,8 +70,8 @@ function generateDisplayName(modelId) {
|
|
|
70
70
|
* @returns {string} provider 名称
|
|
71
71
|
*/
|
|
72
72
|
function determineProvider(modelId, endpoints = []) {
|
|
73
|
-
if (modelId.startsWith('
|
|
74
|
-
return '
|
|
73
|
+
if (modelId.startsWith('gpt')) return 'openai';
|
|
74
|
+
return 'anthropic';
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|