Refine english synonym (#3371)

### What problem does this PR solve?

#3361

### Type of change

- [x] Performance Improvement
This commit is contained in:
Kevin Hu
2024-11-13 12:58:37 +08:00
committed by GitHub
parent 0c95a3382b
commit 91332fa0f8
5 changed files with 73 additions and 5 deletions

View File

@ -104,6 +104,18 @@ class Generate(ComponentBase):
retrieval_res = []
self._param.inputs = []
for para in self._param.parameters:
if para["component_id"].split("@")[0].lower().find("begin") > 0:
cpn_id, key = para["component_id"].split("@")
for p in self._canvas.get_component(cpn_id)["obj"]._param.query:
if p["key"] == key:
kwargs[para["key"]] = p["value"]
self._param.inputs.append(
{"component_id": para["component_id"], "content": kwargs[para["key"]]})
break
else:
assert False, f"Can't find parameter '{key}' for {cpn_id}"
continue
cpn = self._canvas.get_component(para["component_id"])["obj"]
if cpn.component_name.lower() == "answer":
kwargs[para["key"]] = self._canvas.get_history(1)[0]["content"]