Skip to content

Commit

Permalink
Remove vector stored in component output. (infiniflow#3908)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

Close infiniflow#3805

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
KevinHuSh authored Dec 6, 2024
1 parent 311a475 commit f54a8d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion agent/component/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,17 @@ def __str__(self):
"params": {}
}
"""
out = json.loads(str(self._param)).get("output", {})
if isinstance(out, dict) and "vector" in out:
del out["vector"]
return """{{
"component_name": "{}",
"params": {},
"output": {},
"inputs": {}
}}""".format(self.component_name,
self._param,
json.dumps(json.loads(str(self._param)).get("output", {}), ensure_ascii=False),
json.dumps(out, ensure_ascii=False),
json.dumps(json.loads(str(self._param)).get("inputs", []), ensure_ascii=False)
)

Expand Down

0 comments on commit f54a8d7

Please sign in to comment.