Kevin Hu
commited on
Commit
·
6d13ea7
1
Parent(s):
c14e2e5
Remove vector stored in component output. (#3908)
Browse files### What problem does this PR solve?
Close #3805
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- agent/component/base.py +4 -1
agent/component/base.py
CHANGED
@@ -383,6 +383,9 @@ class ComponentBase(ABC):
|
|
383 |
"params": {}
|
384 |
}
|
385 |
"""
|
|
|
|
|
|
|
386 |
return """{{
|
387 |
"component_name": "{}",
|
388 |
"params": {},
|
@@ -390,7 +393,7 @@ class ComponentBase(ABC):
|
|
390 |
"inputs": {}
|
391 |
}}""".format(self.component_name,
|
392 |
self._param,
|
393 |
-
json.dumps(
|
394 |
json.dumps(json.loads(str(self._param)).get("inputs", []), ensure_ascii=False)
|
395 |
)
|
396 |
|
|
|
383 |
"params": {}
|
384 |
}
|
385 |
"""
|
386 |
+
out = json.loads(str(self._param)).get("output", {})
|
387 |
+
if isinstance(out, dict) and "vector" in out:
|
388 |
+
del out["vector"]
|
389 |
return """{{
|
390 |
"component_name": "{}",
|
391 |
"params": {},
|
|
|
393 |
"inputs": {}
|
394 |
}}""".format(self.component_name,
|
395 |
self._param,
|
396 |
+
json.dumps(out, ensure_ascii=False),
|
397 |
json.dumps(json.loads(str(self._param)).get("inputs", []), ensure_ascii=False)
|
398 |
)
|
399 |
|