OpenBMB / ChatDev

Create Customized Software using Natural Language Idea (through LLM-powered Multi-Agent Collaboration)
https://arxiv.org/abs/2307.07924
Apache License 2.0
25.67k stars 3.23k forks source link

openai.BadRequestError: Invalid 'max_tokens' error for negative value #446

Closed jaghachi closed 2 months ago

jaghachi commented 2 months ago

openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid 'max_tokens': integer below minimum value. Expected a value >= 1, but got -15335 instead.", 'type': 'invalid_request_error', 'param': 'max_tokens', 'code': 'integer_below_min_value'}}

Chatdev runs for a while then, I'm not sure why its giving a negative number of tokens to openai.

jaghachi commented 2 months ago

i think it was my prompt having symbols such as quotes or colons and such which messed with it. i removed those and it went through to the end! thanks!

jaghachi commented 2 months ago

I lied. the error is happening with the new model "GPT_4O". I thought the error went away because it ran fine with the default model, 3.5