Commit 9d2e5f7d authored by 于飞's avatar 于飞

非遗去掉relations标签

parent 78ee1f84
......@@ -136,19 +136,22 @@ class ChatKnowledge(BaseChat):
last_output = output
yield output
if (
CFG.KNOWLEDGE_CHAT_SHOW_RELATIONS
and last_output
and type(self.relations) == list
and len(self.relations) > 0
and hasattr(last_output, "text")
):
last_output.text = (
last_output.text + "\n\nrelations:\n\n" + ",".join(self.relations)
)
reference = f"\n\n{self.parse_source_view(self.chunks_with_score)}"
last_output = last_output + reference
yield last_output
#if CFG.SELF_KNOWLEDGE_CHAT_SHOW_RELATIONS:
#非遗的代码先写死吧
if self.knowledge_space == "非遗项目":
if (
CFG.KNOWLEDGE_CHAT_SHOW_RELATIONS
and last_output
and type(self.relations) == list
and len(self.relations) > 0
and hasattr(last_output, "text")
):
last_output.text = (
last_output.text + "\n\nrelations:\n\n" + ",".join(self.relations)
)
reference = f"\n\n{self.parse_source_view(self.chunks_with_score)}"
last_output = last_output + reference
yield last_output
def stream_call_reinforce_fn(self, text):
"""return reference"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment