opencode-pollinations-plugin 5.3.2 → 5.3.3
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 +11 -1
- package/package.json +1 -1
package/dist/server/proxy.js
CHANGED
|
@@ -303,7 +303,11 @@ export async function handleChatCompletion(req, res, bodyRaw) {
|
|
|
303
303
|
delete proxyBody.stream_options;
|
|
304
304
|
// 3.6 STOP SEQUENCES (Prevent Looping - CRITICAL FIX)
|
|
305
305
|
// Inject explicit stop sequences to prevent "User:" hallucinations
|
|
306
|
-
|
|
306
|
+
// 3.6 STOP SEQUENCES (Prevent Looping - CRITICAL FIX)
|
|
307
|
+
// Inject explicit stop sequences to prevent "User:" hallucinations
|
|
308
|
+
// EXCEPTION: Azure OpenAI o1-preview/mini models do NOT support 'stop' param.
|
|
309
|
+
const isAzureO1 = actualModel.includes("o1") || actualModel.includes("azure");
|
|
310
|
+
if (!proxyBody.stop && !isAzureO1) {
|
|
307
311
|
proxyBody.stop = ["\nUser:", "\nModel:", "User:", "Model:"];
|
|
308
312
|
}
|
|
309
313
|
// 3.5 PREPARE SIGNATURE HASHING
|
|
@@ -327,6 +331,12 @@ export async function handleChatCompletion(req, res, bodyRaw) {
|
|
|
327
331
|
// A. AZURE/OPENAI FIXES
|
|
328
332
|
if (actualModel.includes("gpt") || actualModel.includes("openai") || actualModel.includes("azure")) {
|
|
329
333
|
proxyBody.tools = truncateTools(proxyBody.tools, 120);
|
|
334
|
+
if (actualModel.includes("o1") || actualModel.includes("azure")) {
|
|
335
|
+
if (proxyBody.stop)
|
|
336
|
+
delete proxyBody.stop; // Force remove if present
|
|
337
|
+
if (proxyBody.max_tokens)
|
|
338
|
+
delete proxyBody.max_tokens; // O1 uses max_completion_tokens
|
|
339
|
+
}
|
|
330
340
|
if (proxyBody.messages) {
|
|
331
341
|
proxyBody.messages.forEach((m) => {
|
|
332
342
|
if (m.tool_calls) {
|
package/package.json
CHANGED