From 20aa673c8c66eb53aaa75bdab891bb85c68a3697 Mon Sep 17 00:00:00 2001 From: Peter Wang Date: Tue, 17 Oct 2023 18:54:40 +0800 Subject: [PATCH] Fix type exception when use office ppt database fixes GH-678 --- pilot/scene/chat_knowledge/v1/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pilot/scene/chat_knowledge/v1/chat.py b/pilot/scene/chat_knowledge/v1/chat.py index 8177a1a5a..672669a1b 100644 --- a/pilot/scene/chat_knowledge/v1/chat.py +++ b/pilot/scene/chat_knowledge/v1/chat.py @@ -92,7 +92,7 @@ class ChatKnowledge(BaseChat): context = [d.page_content for d in docs] context = context[: self.max_token] relations = list( - set([os.path.basename(d.metadata.get("source", "")) for d in docs]) + set([os.path.basename(str(d.metadata.get("source", ""))) for d in docs]) ) input_values = { "context": context,