refine generate (#1562)

### What problem does this PR solve?



### Type of change

- [x] Refactoring
This commit is contained in:
Kevin Hu
2024-07-17 12:28:54 +08:00
committed by GitHub
parent b06957e561
commit 9bf6f7c9a0
2 changed files with 6 additions and 1 deletions

View File

@ -72,7 +72,7 @@ class Generate(ComponentBase):
prompt = self._param.prompt
retrieval_res = self.get_input()
input = "\n- ".join(retrieval_res["content"])
input = "\n- ".join(retrieval_res["content"]) if "content" in retrieval_res else ""
for para in self._param.parameters:
cpn = self._canvas.get_component(para["component_id"])["obj"]
_, out = cpn.output(allow_partial=False)