mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: code debug (#7949)
### What problem does this PR solve? Fix code component debug issue. #7908. I delete the additions in #7933, there is no semantic meaning `output` for `parameters`. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -89,13 +89,23 @@ class Code(ComponentBase, ABC):
|
||||
if "value" in param:
|
||||
arguments[input["name"]] = param["value"]
|
||||
else:
|
||||
cpn = self._canvas.get_component(input["component_id"])["obj"]
|
||||
if cpn.component_name.lower() == "answer":
|
||||
refered_component = self._canvas.get_component(input["component_id"])["obj"]
|
||||
refered_component_name = refered_component.component_name
|
||||
refered_component_id = refered_component._id
|
||||
if refered_component_name.lower() == "answer":
|
||||
arguments[input["name"]] = self._canvas.get_history(1)[0]["content"]
|
||||
continue
|
||||
_, out = cpn.output(allow_partial=False)
|
||||
if not out.empty:
|
||||
arguments[input["name"]] = "\n".join(out["content"])
|
||||
|
||||
debug_inputs = self._param.debug_inputs
|
||||
if debug_inputs:
|
||||
for param in debug_inputs:
|
||||
if param["key"] == refered_component_id:
|
||||
if "value" in param and param["name"] == input["name"]:
|
||||
arguments[input["name"]] = param["value"]
|
||||
else:
|
||||
_, out = refered_component.output(allow_partial=False)
|
||||
if not out.empty:
|
||||
arguments[input["name"]] = "\n".join(out["content"])
|
||||
|
||||
return self._execute_code(
|
||||
language=self._param.lang,
|
||||
|
||||
Reference in New Issue
Block a user