mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
Update commonUtils.ts (#3470)
Fixed a bug in `restructureMessages` leading to blowing up of the message content with escape characters and eventually crashing the flow with "repetitive patterns" error
This commit is contained in:
@@ -212,7 +212,7 @@ export const restructureMessages = (llm: BaseChatModel, state: ISeqAgentsState)
|
||||
const messages: BaseMessage[] = []
|
||||
for (const message of state.messages as unknown as BaseMessage[]) {
|
||||
// Sometimes Anthropic can return a message with content types of array, ignore that EXECEPT when tool calls are present
|
||||
if ((message as any).tool_calls?.length) {
|
||||
if ((message as any).tool_calls?.length && message.content !== '') {
|
||||
message.content = JSON.stringify(message.content)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user