Remove vector stored in component output. (#3908)

### What problem does this PR solve?

Close #3805

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2024-12-06 18:32:57 +08:00 committed by GitHub
parent 311a475b6f
commit f54a8d7748
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -383,6 +383,9 @@ class ComponentBase(ABC):
"params": {}
}
"""
out = json.loads(str(self._param)).get("output", {})
if isinstance(out, dict) and "vector" in out:
del out["vector"]
return """{{
"component_name": "{}",
"params": {},
@ -390,7 +393,7 @@ class ComponentBase(ABC):
"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)
)