opencode-pollinations-plugin 5.3.3 → 5.3.4
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 +4 -15
- package/package.json +1 -1
package/dist/server/proxy.js
CHANGED
|
@@ -301,15 +301,10 @@ export async function handleChatCompletion(req, res, bodyRaw) {
|
|
|
301
301
|
proxyBody.private = true;
|
|
302
302
|
if (proxyBody.stream_options)
|
|
303
303
|
delete proxyBody.stream_options;
|
|
304
|
-
// 3.6 STOP SEQUENCES (
|
|
305
|
-
//
|
|
306
|
-
//
|
|
307
|
-
//
|
|
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) {
|
|
311
|
-
proxyBody.stop = ["\nUser:", "\nModel:", "User:", "Model:"];
|
|
312
|
-
}
|
|
304
|
+
// 3.6 STOP SEQUENCES (-REMOVED-)
|
|
305
|
+
// We do NOT inject 'stop' automatically anymore.
|
|
306
|
+
// Azure OpenAI strictly rejects 'stop' for many models (o1, etc) and throws 400.
|
|
307
|
+
// We rely on the upstream model to handle stops, or the client to send it if needed.
|
|
313
308
|
// 3.5 PREPARE SIGNATURE HASHING
|
|
314
309
|
let currentRequestHash = null;
|
|
315
310
|
if (proxyBody.messages && proxyBody.messages.length > 0) {
|
|
@@ -331,12 +326,6 @@ export async function handleChatCompletion(req, res, bodyRaw) {
|
|
|
331
326
|
// A. AZURE/OPENAI FIXES
|
|
332
327
|
if (actualModel.includes("gpt") || actualModel.includes("openai") || actualModel.includes("azure")) {
|
|
333
328
|
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
|
-
}
|
|
340
329
|
if (proxyBody.messages) {
|
|
341
330
|
proxyBody.messages.forEach((m) => {
|
|
342
331
|
if (m.tool_calls) {
|
package/package.json
CHANGED