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

非遗去掉relations标签

parent 78ee1f84
...@@ -136,19 +136,22 @@ class ChatKnowledge(BaseChat): ...@@ -136,19 +136,22 @@ class ChatKnowledge(BaseChat):
last_output = output last_output = output
yield output yield output
if ( #if CFG.SELF_KNOWLEDGE_CHAT_SHOW_RELATIONS:
CFG.KNOWLEDGE_CHAT_SHOW_RELATIONS #非遗的代码先写死吧
and last_output if self.knowledge_space == "非遗项目":
and type(self.relations) == list if (
and len(self.relations) > 0 CFG.KNOWLEDGE_CHAT_SHOW_RELATIONS
and hasattr(last_output, "text") and last_output
): and type(self.relations) == list
last_output.text = ( and len(self.relations) > 0
last_output.text + "\n\nrelations:\n\n" + ",".join(self.relations) and hasattr(last_output, "text")
) ):
reference = f"\n\n{self.parse_source_view(self.chunks_with_score)}" last_output.text = (
last_output = last_output + reference last_output.text + "\n\nrelations:\n\n" + ",".join(self.relations)
yield last_output )
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): def stream_call_reinforce_fn(self, text):
"""return reference""" """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