Skip to content

Commit

Permalink
Update commonUtils.ts (FlowiseAI#3470)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
serhiy-matoffo authored Nov 6, 2024
1 parent afd2ddb commit 99f28a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/components/nodes/sequentialagents/commonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 99f28a2

Please sign in to comment.