Fix web search and template max tokens (#1564)

### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
H
2024-07-17 14:19:14 +08:00
committed by GitHub
parent 83c9f1ed39
commit 1015436691
6 changed files with 19 additions and 16 deletions

View File

@ -72,14 +72,14 @@ class Generate(ComponentBase):
prompt = self._param.prompt
retrieval_res = self.get_input()
input = "\n- ".join(retrieval_res["content"]) if "content" in retrieval_res else ""
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)
if "content" not in out.columns:
kwargs[para["key"]] = "Nothing"
else:
kwargs[para["key"]] = "\n - ".join(out["content"])
kwargs[para["key"]] = " - " + "\n - ".join(out["content"])
kwargs["input"] = input
for n, v in kwargs.items():