From b7f73fb7861941ca91c803a0fea3ee39e247be3b Mon Sep 17 00:00:00 2001 From: shern <18212522+shern2@users.noreply.github.com> Date: Wed, 21 May 2025 13:33:29 +0800 Subject: [PATCH 1/2] utils. Bugfix QdrantVectorStoreManager to use langchain_core's Document --- knowledge_storm/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knowledge_storm/utils.py b/knowledge_storm/utils.py index 4411b05e..47c4a34d 100644 --- a/knowledge_storm/utils.py +++ b/knowledge_storm/utils.py @@ -166,7 +166,7 @@ def create_or_update_vector_store( embedding_model: str = "BAAI/bge-m3", device: str = "mps", ): - from qdrant_client import Document + from langchain_core.documents.base import Document """ Takes a CSV file and adds each row in the CSV file to the Qdrant collection. From 61974b30f9dd667f64862f49d321fcc11364bc0b Mon Sep 17 00:00:00 2001 From: shern <18212522+shern2@users.noreply.github.com> Date: Wed, 21 May 2025 15:53:21 +0800 Subject: [PATCH 2/2] align pre-commit black version with github action and black reformatted files --- .pre-commit-config.yaml | 2 +- .../modules/grounded_question_generation.py | 2 +- .../modules/warmstart_hierarchical_chat.py | 6 +++--- knowledge_storm/storm_wiki/modules/storm_dataclass.py | 4 ++-- knowledge_storm/utils.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9cca527c..ffe705bd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 24.8.0 + rev: 25.1.0 hooks: - id: black name: Format Python code with black diff --git a/knowledge_storm/collaborative_storm/modules/grounded_question_generation.py b/knowledge_storm/collaborative_storm/modules/grounded_question_generation.py index 331692ca..6c6a7f33 100644 --- a/knowledge_storm/collaborative_storm/modules/grounded_question_generation.py +++ b/knowledge_storm/collaborative_storm/modules/grounded_question_generation.py @@ -1,7 +1,7 @@ """ This module handles question generation within the Co-STORM framework, specifically designed to support the Moderator role. -The Moderator generates insightful, thought-provoking questions that introduce new directions into the conversation. +The Moderator generates insightful, thought-provoking questions that introduce new directions into the conversation. By leveraging uncited or unused snippets of information retrieved during the discussion, the Moderator ensures the conversation remains dynamic and avoids repetitive or overly niche topics. For more detailed information, refer to Section 3.5 of the Co-STORM paper: https://www.arxiv.org/pdf/2408.15232. diff --git a/knowledge_storm/collaborative_storm/modules/warmstart_hierarchical_chat.py b/knowledge_storm/collaborative_storm/modules/warmstart_hierarchical_chat.py index 3357cbc2..e111152b 100644 --- a/knowledge_storm/collaborative_storm/modules/warmstart_hierarchical_chat.py +++ b/knowledge_storm/collaborative_storm/modules/warmstart_hierarchical_chat.py @@ -1,10 +1,10 @@ """ Warm starts the Co-STORM system by conducting a background information search to establish a shared conceptual space with the user. - -This stage functions as a mini-STORM, where multiple LLM agents are spawned with different perspectives to engage in multi-round conversations. + +This stage functions as a mini-STORM, where multiple LLM agents are spawned with different perspectives to engage in multi-round conversations. The knowledge base (represented as a mind map) is initialized using the information gathered during these exchanges. -Additionally, the system generates a first draft of the report, which is then used to create a concise and engaging conversation. +Additionally, the system generates a first draft of the report, which is then used to create a concise and engaging conversation. The synthesized conversation is presented to the user to help them quickly catch up on the system's current knowledge about the topic. """ diff --git a/knowledge_storm/storm_wiki/modules/storm_dataclass.py b/knowledge_storm/storm_wiki/modules/storm_dataclass.py index 119869cd..f985f4e7 100644 --- a/knowledge_storm/storm_wiki/modules/storm_dataclass.py +++ b/knowledge_storm/storm_wiki/modules/storm_dataclass.py @@ -64,7 +64,7 @@ def __init__(self, conversations=List[Tuple[str, List[DialogueTurn]]]): @staticmethod def construct_url_to_info( - conversations: List[Tuple[str, List[DialogueTurn]]] + conversations: List[Tuple[str, List[DialogueTurn]]], ) -> Dict[str, Information]: url_to_info = {} @@ -81,7 +81,7 @@ def construct_url_to_info( @staticmethod def construct_log_dict( - conversations: List[Tuple[str, List[DialogueTurn]]] + conversations: List[Tuple[str, List[DialogueTurn]]], ) -> List[Dict[str, Union[str, Any]]]: conversation_log = [] for persona, conv in conversations: diff --git a/knowledge_storm/utils.py b/knowledge_storm/utils.py index 47c4a34d..42167a33 100644 --- a/knowledge_storm/utils.py +++ b/knowledge_storm/utils.py @@ -278,7 +278,7 @@ def create_or_update_vector_store( "\uff0c", # Fullwidth comma "\u3001", # Ideographic comma " ", - "\u200B", # Zero-width space + "\u200b", # Zero-width space "", ], ) @@ -666,7 +666,7 @@ def __init__( "\uff0c", # Fullwidth comma "\u3001", # Ideographic comma " ", - "\u200B", # Zero-width space + "\u200b", # Zero-width space "", ], )