Fix AnswerNode attribute access and update tests to include outputs

pull/20921/head
GuanMu 7 months ago
parent 6d20b71e92
commit 868542dea8

@ -72,7 +72,7 @@ class AnswerNode(BaseNode):
part = cast(TextGenerateRouteChunk, part) part = cast(TextGenerateRouteChunk, part)
answer += part.text answer += part.text
output_variables = self.node_data.outputs output_variables = self._node_data.outputs
outputs = {} outputs = {}
for variable_selector in output_variables: for variable_selector in output_variables:

@ -65,6 +65,7 @@ def test_execute_answer():
"title": "123", "title": "123",
"type": "answer", "type": "answer",
"answer": "Today's weather is {{#start.weather#}}\n{{#llm.text#}}\n{{img}}\nFin.", "answer": "Today's weather is {{#start.weather#}}\n{{#llm.text#}}\n{{img}}\nFin.",
"outputs": [],
}, },
} }

@ -68,6 +68,7 @@ def test_execute_answer():
"title": "123", "title": "123",
"type": "answer", "type": "answer",
"answer": "Today's weather is {{#start.weather#}}\n{{#llm.text#}}\n{{img}}\nFin.", "answer": "Today's weather is {{#start.weather#}}\n{{#llm.text#}}\n{{img}}\nFin.",
"outputs": [],
}, },
} }

Loading…
Cancel
Save