NextChat icon indicating copy to clipboard operation
NextChat copied to clipboard

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

Open SirlyDreamer opened this issue 1 year ago • 1 comments

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

  • [ ] Docker
  • [ ] Vercel
  • [X] Server

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

SirlyDreamer avatar May 17 '24 03:05 SirlyDreamer

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

SpiralTower avatar May 17 '24 11:05 SpiralTower