Flowise icon indicating copy to clipboard operation
Flowise copied to clipboard

[BUG] OpenAI token exceeded error

Open atishhamte opened this issue 3 years ago • 10 comments

I am using the flowise configuration like the image below Screenshot 2023-07-25 at 8 37 24 PM

Even after sending 1 line message like "Hello, how are you?" it is giving error like,

[ERROR]: [server]: Error: Request failed with status code 400 and body {"error":{"message":"This model's maximum context length is 4097 tokens. However, your messages resulted in 5029 tokens. Please reduce the length of the messages.","type":"invalid_request_error","param":"messages","code":"context_length_exceeded"}}

I think the conversation chain Is doing some things weird.

atishhamte avatar Jul 25 '23 15:07 atishhamte

Try delete the flow, and use the template "Simple Conversationa Chain" from marketplace. It works fine: image

HenryHengZJ avatar Jul 25 '23 17:07 HenryHengZJ

Hi, same error in here. I Try get a "Simple Conversationa Chain" from marketplace too, but not working for me.

`Request failed with status code 400 and body {"error":{"message":"This model's maximum context length is 4097 tokens. However, your messages resulted in 9663 tokens. Please reduce the length of the messages.","type":"invalid_request_error","param":"messages","code":"context_length_exceeded"}}

`

matheusfterra avatar Aug 29 '23 02:08 matheusfterra

Hi, I have the same problem, it was working for some time after deployment but now I am getting this error.

Javokhir-1999 avatar Oct 01 '23 19:10 Javokhir-1999

@matheusfterra @Javokhir-1999 one alternate hack I used here to mitigate this situation is using a random value for memorykey parameter of buffer memory. this actually solved my issue but this is a HACK

atishhamte avatar Oct 02 '23 06:10 atishhamte

I still get this issue both on Buffer Memory and on Dynamo DB Memory. I would urge to reopen this issue.

Hi @atishamte , can you share how you passed in the custom memory key parameter?

pellicceama avatar Oct 10 '23 17:10 pellicceama

or we can use a higher context model like gpt3.5-16k

HenryHengZJ avatar Oct 10 '23 18:10 HenryHengZJ

@pellicceama I am using API to call these as we are not using flowise UI for the operation. So everytime I call the API, we are using UUID as a random key

atishhamte avatar Oct 10 '23 20:10 atishhamte

Me too! I tried this without much success.

overrideConfig: {..., inputKey: `${randomUUID}`}} 

How do you currently pass the UUID as a random key? @atishamte

pellicceama avatar Oct 11 '23 20:10 pellicceama

yes, but use it for memorykey

atishhamte avatar Oct 11 '23 21:10 atishhamte

Same issue, please fix this. Makes it unusable.

juztim avatar Oct 31 '23 04:10 juztim