[BUG] OpenAI token exceeded error
I am using the flowise configuration like the image below
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.
Try delete the flow, and use the template "Simple Conversationa Chain" from marketplace.
It works fine:
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"}}
`
Hi, I have the same problem, it was working for some time after deployment but now I am getting this error.
@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
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?
or we can use a higher context model like gpt3.5-16k
@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
Me too! I tried this without much success.
overrideConfig: {..., inputKey: `${randomUUID}`}}
How do you currently pass the UUID as a random key? @atishamte
yes, but use it for memorykey
Same issue, please fix this. Makes it unusable.