ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。
https://app.nextchat.dev/
MIT License
72.69k stars 57.75k forks source link

[Bug] Setting `max_tokens` didn't work when using OpenAI models. #4721

Closed SirlyDreamer closed 1 month ago

SirlyDreamer commented 1 month ago

Bug Description

The payload of request didn't contains 'max_tokens'.

Steps to Reproduce

  1. Go to 'settings', and set max_tokens to any value.
  2. Open Chrome Developer Tools and switch to 'Network' tab.
  3. Apply a chat request.

Expected Behavior

The request should have key 'max_tokens'.

Screenshots

image

Deployment Method

Desktop OS

Windows 11

Desktop Browser

Chrome

Desktop Browser Version

124.0.6367.208

Smartphone Device

No response

Smartphone OS

No response

Smartphone Browser

No response

Smartphone Browser Version

No response

Additional Logs

No response

SpiralTower commented 1 month ago

https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/blob/f55f04ab4f23fc5a5ac84aba0d2d926c557816c3/app/client/platforms/openai.ts#L119-L129 https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/discussions/3208