Kevin Hu
commited on
Commit
·
230447c
1
Parent(s):
e3b65ea
fix no resualt bugs (#1448)
Browse files### What problem does this PR solve?
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- graph/canvas.py +2 -0
- graph/component/baidu.py +3 -3
- graph/component/duckduckgosearch.py +2 -3
- graph/component/message.py +5 -1
- graph/templates/HR_callout_zh.json +2 -2
graph/canvas.py
CHANGED
|
@@ -220,6 +220,7 @@ class Canvas(ABC):
|
|
| 220 |
prepare2run([p])
|
| 221 |
break
|
| 222 |
traceback.print_exc()
|
|
|
|
| 223 |
continue
|
| 224 |
|
| 225 |
try:
|
|
@@ -231,6 +232,7 @@ class Canvas(ABC):
|
|
| 231 |
prepare2run([p])
|
| 232 |
break
|
| 233 |
traceback.print_exc()
|
|
|
|
| 234 |
|
| 235 |
if self.answer:
|
| 236 |
cpn_id = self.answer[0]
|
|
|
|
| 220 |
prepare2run([p])
|
| 221 |
break
|
| 222 |
traceback.print_exc()
|
| 223 |
+
break
|
| 224 |
continue
|
| 225 |
|
| 226 |
try:
|
|
|
|
| 232 |
prepare2run([p])
|
| 233 |
break
|
| 234 |
traceback.print_exc()
|
| 235 |
+
break
|
| 236 |
|
| 237 |
if self.answer:
|
| 238 |
cpn_id = self.answer[0]
|
graph/component/baidu.py
CHANGED
|
@@ -57,6 +57,6 @@ class Baidu(ComponentBase, ABC):
|
|
| 57 |
in zip(url_res, title_res, body_res)]
|
| 58 |
del body_res, url_res, title_res
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
|
|
|
| 57 |
in zip(url_res, title_res, body_res)]
|
| 58 |
del body_res, url_res, title_res
|
| 59 |
|
| 60 |
+
print(baidu_res, ":::::::::::::::::::::::::::::::::")
|
| 61 |
+
return Baidu.be_output(baidu_res)
|
| 62 |
+
|
graph/component/duckduckgosearch.py
CHANGED
|
@@ -57,6 +57,5 @@ class DuckDuckGoSearch(ComponentBase, ABC):
|
|
| 57 |
duck_res = ['<a href="' + i["url"] + '">' + i["title"] + '</a> ' + i["body"] for i in
|
| 58 |
ddgs.news(ans, max_results=self._param.top_n)]
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
return dr
|
|
|
|
| 57 |
duck_res = ['<a href="' + i["url"] + '">' + i["title"] + '</a> ' + i["body"] for i in
|
| 58 |
ddgs.news(ans, max_results=self._param.top_n)]
|
| 59 |
|
| 60 |
+
print(duck_res, ":::::::::::::::::::::::::::::::::")
|
| 61 |
+
return DuckDuckGoSearch.be_output(duck_res)
|
|
|
graph/component/message.py
CHANGED
|
@@ -46,7 +46,11 @@ class Message(ComponentBase, ABC):
|
|
| 46 |
return Message.be_output(random.choice(self._param.messages))
|
| 47 |
|
| 48 |
def stream_output(self):
|
|
|
|
| 49 |
if self._param.messages:
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
|
|
|
|
| 46 |
return Message.be_output(random.choice(self._param.messages))
|
| 47 |
|
| 48 |
def stream_output(self):
|
| 49 |
+
res = None
|
| 50 |
if self._param.messages:
|
| 51 |
+
res = {"content": random.choice(self._param.messages)}
|
| 52 |
+
yield res
|
| 53 |
+
|
| 54 |
+
self.set_output(res)
|
| 55 |
|
| 56 |
|
graph/templates/HR_callout_zh.json
CHANGED
|
@@ -169,7 +169,7 @@
|
|
| 169 |
"component_name": "Message",
|
| 170 |
"params": {
|
| 171 |
"messages": [
|
| 172 |
-
"
|
| 173 |
]
|
| 174 |
}
|
| 175 |
},
|
|
@@ -448,7 +448,7 @@
|
|
| 448 |
"data": {
|
| 449 |
"form": {
|
| 450 |
"messages": [
|
| 451 |
-
"
|
| 452 |
]
|
| 453 |
},
|
| 454 |
"label": "Message",
|
|
|
|
| 169 |
"component_name": "Message",
|
| 170 |
"params": {
|
| 171 |
"messages": [
|
| 172 |
+
"我简单介绍一下:\nRAGFlow 是一款基于深度文档理解构建的开源 RAG(Retrieval-Augmented Generation)引擎。RAGFlow 可以为各种规模的企业及个人提供一套精简的 RAG 工作流程,结合大语言模型(LLM)针对用户各类不同的复杂格式数据提供可靠的问答以及有理有据的引用。https://github.com/infiniflow/ragflow\n您那边还有什么要了解的?"
|
| 173 |
]
|
| 174 |
}
|
| 175 |
},
|
|
|
|
| 448 |
"data": {
|
| 449 |
"form": {
|
| 450 |
"messages": [
|
| 451 |
+
"我简单介绍一下:\nRAGFlow 是一款基于深度文档理解构建的开源 RAG(Retrieval-Augmented Generation)引擎。RAGFlow 可以为各种规模的企业及个人提供一套精简的 RAG 工作流程,结合大语言模型(LLM)针对用户各类不同的复杂格式数据提供可靠的问答以及有理有据的引用。https://github.com/infiniflow/ragflow\n您那边还有什么要了解的?"
|
| 452 |
]
|
| 453 |
},
|
| 454 |
"label": "Message",
|