diff --git a/pilot/configs/config.py b/pilot/configs/config.py index 8c03769b4..5846a7c1a 100644 --- a/pilot/configs/config.py +++ b/pilot/configs/config.py @@ -165,7 +165,9 @@ class Config(metaclass=Singleton): self.KNOWLEDGE_CHUNK_SIZE = int(os.getenv("KNOWLEDGE_CHUNK_SIZE", 100)) self.KNOWLEDGE_CHUNK_OVERLAP = int(os.getenv("KNOWLEDGE_CHUNK_OVERLAP", 100)) self.KNOWLEDGE_SEARCH_TOP_SIZE = int(os.getenv("KNOWLEDGE_SEARCH_TOP_SIZE", 5)) - self.KNOWLEDGE_SEARCH_MAX_TOKEN = int(os.getenv("KNOWLEDGE_SEARCH_MAX_TOKEN", 2000)) + self.KNOWLEDGE_SEARCH_MAX_TOKEN = int( + os.getenv("KNOWLEDGE_SEARCH_MAX_TOKEN", 2000) + ) ### SUMMARY_CONFIG Configuration self.SUMMARY_CONFIG = os.getenv("SUMMARY_CONFIG", "FAST") diff --git a/pilot/scene/chat_knowledge/v1/prompt.py b/pilot/scene/chat_knowledge/v1/prompt.py index 5dbdbf602..d82984aee 100644 --- a/pilot/scene/chat_knowledge/v1/prompt.py +++ b/pilot/scene/chat_knowledge/v1/prompt.py @@ -12,7 +12,7 @@ from pilot.scene.chat_normal.out_parser import NormalChatOutputParser CFG = Config() PROMPT_SCENE_DEFINE = """A chat between a curious user and an artificial intelligence assistant, who very familiar with database related knowledge. - The assistant gives helpful, detailed, professional and polite answers to the user's questions. """ +The assistant gives helpful, detailed, professional and polite answers to the user's questions. """ _DEFAULT_TEMPLATE_ZH = """ 基于以下已知的信息, 专业、简要的回答用户的问题, diff --git a/pilot/server/knowledge/service.py b/pilot/server/knowledge/service.py index 3cd7589e5..4310038c5 100644 --- a/pilot/server/knowledge/service.py +++ b/pilot/server/knowledge/service.py @@ -188,7 +188,7 @@ class KnowledgeService: text_splitter = SpacyTextSplitter( pipeline="zh_core_web_sm", chunk_size=chunk_size, - chunk_overlap=chunk_overlap + chunk_overlap=chunk_overlap, ) except Exception: text_splitter = RecursiveCharacterTextSplitter( diff --git a/pilot/vector_store/chroma_store.py b/pilot/vector_store/chroma_store.py index 451d9952c..d53071caa 100644 --- a/pilot/vector_store/chroma_store.py +++ b/pilot/vector_store/chroma_store.py @@ -26,10 +26,10 @@ class ChromaStore(VectorStoreBase): persist_directory=self.persist_dir, embedding_function=self.embeddings, client_settings=chroma_settings, - collection_metadata=collection_metadata + collection_metadata=collection_metadata, ) - def similar_search(self, text, topk, **kwargs: Any) -> None: + def similar_search(self, text, topk, **kwargs: Any) -> None: logger.info("ChromaStore similar search") return self.vector_store_client.similarity_search(text, topk)