diff --git a/graph/component/duckduckgo.py b/graph/component/duckduckgo.py index 08cab52ea9..95ce3e8576 100644 --- a/graph/component/duckduckgo.py +++ b/graph/component/duckduckgo.py @@ -46,12 +46,12 @@ def _run(self, history, **kwargs): if not ans: return DuckDuckGo.be_output(self._param.no) - if self.channel == "text": + if self._param.channel == "text": with DDGS() as ddgs: # {'title': '', 'href': '', 'body': ''} duck_res = [{"content": '' + i["title"] + ' ' + i["body"]} for i in ddgs.text(ans, max_results=self._param.top_n)] - elif self.channel == "news": + elif self._param.channel == "news": with DDGS() as ddgs: # {'date': '', 'title': '', 'body': '', 'url': '', 'image': '', 'source': ''} duck_res = [{"content": '' + i["title"] + ' ' + i["body"]} for i in