fix no resualt bugs (#1448)

### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2024-07-09 18:06:09 +08:00
committed by GitHub
parent fb66b1e726
commit 30b88e2b91
5 changed files with 14 additions and 9 deletions

View File

@ -57,6 +57,6 @@ class Baidu(ComponentBase, ABC):
in zip(url_res, title_res, body_res)]
del body_res, url_res, title_res
br = pd.DataFrame(baidu_res, columns=['content'])
print(">>>>>>>>>>>>>>>>>>>>>>>>>>\n", br)
return br
print(baidu_res, ":::::::::::::::::::::::::::::::::")
return Baidu.be_output(baidu_res)

View File

@ -57,6 +57,5 @@ class DuckDuckGoSearch(ComponentBase, ABC):
duck_res = ['<a href="' + i["url"] + '">' + i["title"] + '</a> ' + i["body"] for i in
ddgs.news(ans, max_results=self._param.top_n)]
dr = pd.DataFrame(duck_res, columns=['content'])
print(">>>>>>>>>>>>>>>>>>>>>>>>>>\n", dr)
return dr
print(duck_res, ":::::::::::::::::::::::::::::::::")
return DuckDuckGoSearch.be_output(duck_res)

View File

@ -46,7 +46,11 @@ class Message(ComponentBase, ABC):
return Message.be_output(random.choice(self._param.messages))
def stream_output(self):
res = None
if self._param.messages:
yield {"content": random.choice(self._param.messages)}
res = {"content": random.choice(self._param.messages)}
yield res
self.set_output(res)