mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-22 07:01:07 +03:00
Fix Agent node structured output not updating flow state variables (#5548)
Fix Agent state processing for structured output Updated the Agent class to handle structured output by passing a JSON string instead of a markdown-wrapped response to the `processTemplateVariables` function. This change allows for proper nested property access and resolves string replacement issues with object coercion.
This commit is contained in:
@@ -1394,7 +1394,9 @@ class Agent_Agentflow implements INode {
|
||||
}
|
||||
|
||||
// Process template variables in state
|
||||
newState = processTemplateVariables(newState, finalResponse)
|
||||
const outputForStateProcessing =
|
||||
isStructuredOutput && typeof response === 'object' ? JSON.stringify(response, null, 2) : finalResponse
|
||||
newState = processTemplateVariables(newState, outputForStateProcessing)
|
||||
|
||||
/**
|
||||
* Remove the temporarily added image artifact messages before storing
|
||||
|
||||
Reference in New Issue
Block a user