opencode-pollinations-plugin 5.4.0 → 5.4.2
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/dist/server/proxy.js +6 -6
- package/package.json +1 -1
package/dist/server/proxy.js
CHANGED
|
@@ -365,22 +365,22 @@ export async function handleChatCompletion(req, res, bodyRaw) {
|
|
|
365
365
|
const name = t.function?.name || t.name;
|
|
366
366
|
return isFunc && name !== 'google_search';
|
|
367
367
|
});
|
|
368
|
-
// 2. Sanitize
|
|
368
|
+
// 2. Sanitize & RESTORE GROUNDING CONFIG (Essential for Vertex Auth)
|
|
369
369
|
if (proxyBody.tools.length > 0) {
|
|
370
|
-
//
|
|
370
|
+
// v5.4.1: MUST send tools_config to avoid 401 Unauthorized on Vertex
|
|
371
|
+
proxyBody.tools_config = { google_search_retrieval: { disable: true } };
|
|
371
372
|
proxyBody.tools = sanitizeToolsForVertex(proxyBody.tools);
|
|
372
373
|
}
|
|
373
374
|
else {
|
|
374
375
|
// 3. If no tools left (or only search was present), DELETE 'tools' entirely
|
|
375
|
-
// Sending tools: [] or tools_config without tools causes 400 Bad Request
|
|
376
376
|
delete proxyBody.tools;
|
|
377
377
|
if (proxyBody.tools_config)
|
|
378
378
|
delete proxyBody.tools_config;
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
// 4. STOP SEQUENCES REMOVED (Validation Fix v5.4.0)
|
|
382
|
-
//
|
|
383
|
-
log(`[Proxy] Gemini Logic: Tools=${proxyBody.tools ? proxyBody.tools.length : 'REMOVED'}, Stops Injected.`);
|
|
381
|
+
// 4. STOP SEQUENCES REMOVED (Validation Fix v5.4.0/1)
|
|
382
|
+
// Do NOT inject stop sequences (User:/Model:) as they cause "JSON body validation failed".
|
|
383
|
+
log(`[Proxy] Gemini Logic: Tools=${proxyBody.tools ? proxyBody.tools.length : 'REMOVED'}, Stops NOT Injected.`);
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
// C. GEMINI ID BACKTRACKING & SIGNATURE
|
package/package.json
CHANGED