You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[BUG] LLM Node connected to Tools node produces infinitely growing escape characters in message content. This leads to error: 'Sorry we have encountered an issue with repetitive patterns in your prompt'.
#3472
Describe the bug
I have an agentflow containing an LLM Node connected to Tool Node (with a Google Custom Search tool). The content produced by LLM Node tool itself is added to history as an empty string. Each consecutive call of the agentflow calls the restructureMessages method, that will call message.content = JSON.stringify(message.content). For the first call it will convert an empty string to '""', and each consecutive call will just produce new escape characters for existing content. Leading to an ever-growing string looking like this: "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\. Eventually, ChatGPT will respond with an error: 'Sorry we have encountered an issue with repetitive patterns in your prompt' and the flow will crash.
Fix
I fixed it in #3470 for an empty string case.
For non-empty string - it will not change anything. Not sure if the bug is present for a non-empty string, as I have no idea how to achieve that - in my case it's always empty.
The text was updated successfully, but these errors were encountered:
Describe the bug
I have an agentflow containing an LLM Node connected to Tool Node (with a Google Custom Search tool). The content produced by LLM Node tool itself is added to history as an empty string. Each consecutive call of the agentflow calls the
restructureMessages
method, that will callmessage.content = JSON.stringify(message.content)
. For the first call it will convert an empty string to'""'
, and each consecutive call will just produce new escape characters for existing content. Leading to an ever-growing string looking like this:"\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
. Eventually, ChatGPT will respond with an error: 'Sorry we have encountered an issue with repetitive patterns in your prompt' and the flow will crash.Fix
I fixed it in #3470 for an empty string case.
For non-empty string - it will not change anything. Not sure if the bug is present for a non-empty string, as I have no idea how to achieve that - in my case it's always empty.
The text was updated successfully, but these errors were encountered: