henrycunh / golem

✨ A beautiful UI for ChatGPT and other conversational models
https://golem.chat
MIT License
235 stars 63 forks source link

Failed to send message: "0 is less than the minimum 1 - max_tokens" #44

Closed peperunas closed 1 year ago

peperunas commented 1 year ago

Hello!

I have deployed golem with Vercel. I cannot receive any response from the OpenAI API due to this error:

error Error sending message 
Object { error: {…} }
 Error: Failed to send message
    NuxtJS 67
Caused by: Object { … }
entry.cbe35941.js:24:84

Where the Object is:

{
  "error": {
    "message": "0 is less than the minimum of 1 - 'max_tokens'",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}
henrycunh commented 1 year ago

Hey there! Have you set the Max Tokens settings to 0?

This is probably caused by setting it to 0, as only leaving it blank is actually accepted right now as a way of not limiting the amount of tokens. I will introduce a patch to allow 0 as a non-value as well! Thanks for the catch ❤️

peperunas commented 1 year ago

Hello :-)

No, I have left the field blank.

image
henrycunh commented 1 year ago

Oh, it's true! While debugging I could verify I introduced a regression on the max token settings, it doesn't work properly even when empty, thanks!