opencode-pollinations-plugin 5.7.0 → 5.9.0
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.
|
@@ -8,6 +8,10 @@ interface OpenCodeModel {
|
|
|
8
8
|
context?: number;
|
|
9
9
|
output?: number;
|
|
10
10
|
};
|
|
11
|
+
modalities?: {
|
|
12
|
+
input?: string[];
|
|
13
|
+
output?: string[];
|
|
14
|
+
};
|
|
11
15
|
}
|
|
12
16
|
export declare function generatePollinationsConfig(forceApiKey?: string, forceStrict?: boolean): Promise<OpenCodeModel[]>;
|
|
13
17
|
export {};
|
|
@@ -93,7 +93,8 @@ export async function generatePollinationsConfig(forceApiKey, forceStrict = fals
|
|
|
93
93
|
// 2. ENTERPRISE UNIVERSE
|
|
94
94
|
if (effectiveKey && effectiveKey.length > 5 && effectiveKey !== 'dummy') {
|
|
95
95
|
try {
|
|
96
|
-
|
|
96
|
+
// Use /text/models for full metadata (input_modalities, tools, reasoning, pricing)
|
|
97
|
+
const enterListRaw = await fetchJson('https://gen.pollinations.ai/text/models', {
|
|
97
98
|
'Authorization': `Bearer ${effectiveKey}`
|
|
98
99
|
});
|
|
99
100
|
const enterList = Array.isArray(enterListRaw) ? enterListRaw : (enterListRaw.data || []);
|
|
@@ -134,6 +135,32 @@ export async function generatePollinationsConfig(forceApiKey, forceStrict = fals
|
|
|
134
135
|
}
|
|
135
136
|
return modelsOutput;
|
|
136
137
|
}
|
|
138
|
+
// --- CAPABILITY ICONS ---
|
|
139
|
+
function getCapabilityIcons(raw) {
|
|
140
|
+
const icons = [];
|
|
141
|
+
// Vision: accepts images
|
|
142
|
+
if (raw.input_modalities?.includes('image'))
|
|
143
|
+
icons.push('👁️');
|
|
144
|
+
// Audio Input
|
|
145
|
+
if (raw.input_modalities?.includes('audio'))
|
|
146
|
+
icons.push('🎙️');
|
|
147
|
+
// Audio Output
|
|
148
|
+
if (raw.output_modalities?.includes('audio'))
|
|
149
|
+
icons.push('🔊');
|
|
150
|
+
// Reasoning capability
|
|
151
|
+
if (raw.reasoning === true)
|
|
152
|
+
icons.push('🧠');
|
|
153
|
+
// Web Search (from description)
|
|
154
|
+
if (raw.description?.toLowerCase().includes('search') ||
|
|
155
|
+
raw.name?.includes('search') ||
|
|
156
|
+
raw.name?.includes('perplexity')) {
|
|
157
|
+
icons.push('🔍');
|
|
158
|
+
}
|
|
159
|
+
// Tool/Function calling
|
|
160
|
+
if (raw.tools === true)
|
|
161
|
+
icons.push('💻');
|
|
162
|
+
return icons.length > 0 ? ` ${icons.join('')}` : '';
|
|
163
|
+
}
|
|
137
164
|
// --- MAPPING ENGINE ---
|
|
138
165
|
function mapModel(raw, prefix, namePrefix) {
|
|
139
166
|
const rawId = raw.id || raw.name;
|
|
@@ -151,12 +178,19 @@ function mapModel(raw, prefix, namePrefix) {
|
|
|
151
178
|
if (raw.paid_only) {
|
|
152
179
|
namePrefixFinal = namePrefix.replace('[Enter]', '[💎 Paid]');
|
|
153
180
|
}
|
|
154
|
-
|
|
181
|
+
// Get capability icons from API metadata
|
|
182
|
+
const capabilityIcons = getCapabilityIcons(raw);
|
|
183
|
+
const finalName = `${namePrefixFinal}${baseName}${capabilityIcons}`;
|
|
155
184
|
const modelObj = {
|
|
156
185
|
id: fullId,
|
|
157
186
|
name: finalName,
|
|
158
187
|
object: 'model',
|
|
159
|
-
variants: {}
|
|
188
|
+
variants: {},
|
|
189
|
+
// Declare modalities for OpenCode vision support
|
|
190
|
+
modalities: {
|
|
191
|
+
input: raw.input_modalities || ['text'],
|
|
192
|
+
output: raw.output_modalities || ['text']
|
|
193
|
+
}
|
|
160
194
|
};
|
|
161
195
|
// --- ENRICHISSEMENT ---
|
|
162
196
|
if (raw.reasoning === true || rawId.includes('thinking') || rawId.includes('reasoning')) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-pollinations-plugin",
|
|
3
3
|
"displayName": "Pollinations AI (V5.6)",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.9.0",
|
|
5
5
|
"description": "Native Pollinations.ai Provider Plugin for OpenCode",
|
|
6
6
|
"publisher": "pollinations",
|
|
7
7
|
"repository": {
|
|
@@ -55,4 +55,4 @@
|
|
|
55
55
|
"@types/node": "^20.0.0",
|
|
56
56
|
"typescript": "^5.0.0"
|
|
57
57
|
}
|
|
58
|
-
}
|
|
58
|
+
}
|