Hypergraph is more powerful. Transform unstructured text into structured knowledge with LLMs. Graphs, hypergraphs, and spatio-temporal extractions — with one command.
refactor(general): 重构通用知识模板,新增多种专业模板并优化结构
yifanfeng974f26e07f387a
diff --git a/examples/cog_rag_demo.py b/examples/method_cog_rag_demo.pysimilarity index 100%rename from examples/cog_rag_demo.pyrename to examples/method_cog_rag_demo.pydiff --git a/examples/template_general_demo.py b/examples/template_general_demo.pynew file mode 100644index 0000000..e69726e--- /dev/null+++ b/examples/template_general_demo.py@@ -0,0 +1,178 @@+"""+General 知识模板测试演示++这个文件用于测试 hyperextract 中 general 领域的所有知识模板。+只需要选择模板,程序会自动匹配对应的输入文件。++使用方法:+1. 选择知识模板(修改 TEMPLATE 变量)+2. 运行文件:python examples/template_general_demo.py+"""++import os+import sys++# Add project root to path+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))++from pathlib import Path+from dotenv import load_dotenv++# 导入所有 general 知识模板+from hyperextract.templates.zh.general import (+ # 第一波:基础知识提取+ KnowledgeGraph,+ EntityRegistry,+ KeywordList,+ # 第二波:百科条目+ EncyclopediaItem,+ ConceptHierarchy,+ CrossReferenceNet,+ # 第三波:人物传记+ PersonalProfile,+ SocialNetwork,+ LifeEventTimeline,+ # 第四波:规章制度+ RegulationProfile,+ ClauseList,+ PenaltyRegistry,+ OperationalProcedure,+ PenaltyMapping,+ ComplianceLogic,+)++# 导入必要的 LLM 客户端+from langchain_openai import ChatOpenAI, OpenAIEmbeddings+++# ==========================================+# 配置:模板与输入文件自动映射+# ==========================================++# 测试文件根目录+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "general"++# 模板到输入文件的映射关系(根据 README 中的典型应用场景)+TEMPLATE_TO_INPUT = {+ # 基础知识提取 -> 科技新闻+ KnowledgeGraph: TEST_SAMPLES_ROOT / "arbitrary_tech_news.md",+ EntityRegistry: TEST_SAMPLES_ROOT / "arbitrary_tech_news.md",+ KeywordList: TEST_SAMPLES_ROOT / "arbitrary_tech_news.md",+ # 百科条目 -> 机器学习百科+ EncyclopediaItem: TEST_SAMPLES_ROOT / "encyclopedia_machine_learning.md",+ ConceptHierarchy: TEST_SAMPLES_ROOT / "encyclopedia_machine_learning.md",+ CrossReferenceNet: TEST_SAMPLES_ROOT / "encyclopedia_machine_learning.md",+ # 人物传记 -> 科学家传记+ PersonalProfile: TEST_SAMPLES_ROOT / "biography_scientist.md",+ SocialNetwork: TEST_SAMPLES_ROOT / "biography_scientist.md",+ LifeEventTimeline: TEST_SAMPLES_ROOT / "biography_scientist.md",+ # 规章制度 -> 公司制度+ RegulationProfile: TEST_SAMPLES_ROOT / "regulation_company_policy.md",+ ClauseList: TEST_SAMPLES_ROOT / "regulation_company_policy.md",+ PenaltyRegistry: TEST_SAMPLES_ROOT / "regulation_company_policy.md",+ OperationalProcedure: TEST_SAMPLES_ROOT / "regulation_company_policy.md",+ PenaltyMapping: TEST_SAMPLES_ROOT / "regulation_company_policy.md",+ ComplianceLogic: TEST_SAMPLES_ROOT / "regulation_company_policy.md",+}++# ==========================================+# 选择知识模板(只需要修改这一行)+# ==========================================++# 基础知识提取+# TEMPLATE = KnowledgeGraph # 知识图谱+# TEMPLATE = EntityRegistry # 实体集合+# TEMPLATE = KeywordList # 关键词列表++# 百科条目+# TEMPLATE = EncyclopediaItem # 百科条目+# TEMPLATE = ConceptHierarchy # 概念层级图+# TEMPLATE = CrossReferenceNet # 引用网络++# 人物传记+# TEMPLATE = PersonalProfile # 个人档案+# TEMPLATE = SocialNetwork # 社会网络+TEMPLATE = LifeEventTimeline # 生平时序图++# 规章制度+# TEMPLATE = RegulationProfile # 规章元数据快照+# TEMPLATE = ClauseList # 规章条文清单+# TEMPLATE = PenaltyRegistry # 违规处罚对照表+# TEMPLATE = OperationalProcedure # 执行程序流程图+# TEMPLATE = PenaltyMapping # 违规处罚因果链+# TEMPLATE = ComplianceLogic # 合规行为超图++# 自动获取对应的输入文件+INPUT_FILE = TEMPLATE_TO_INPUT[TEMPLATE]+++def main():+ """+ 主函数:执行知识提取和展示流程+ """+ print("=" * 60)+ print("General 知识模板测试演示")+ print("=" * 60)++ # 加载环境变量+ load_dotenv()++ # 验证输入文件是否存在+ if not INPUT_FILE.exists():+ print(f"❌ 错误:找不到文件 {INPUT_FILE}")+ return++ print(f"\n📄 输入文件: {INPUT_FILE.name}")+ print(f"🎯 使用模板: {TEMPLATE.__name__}")++ # 初始化 LLM 客户端+ print("\n🔧 初始化 LLM 客户端...")+ try:+ llm = ChatOpenAI(+ model="gpt-4o-mini",+ temperature=0,+ )+ embedder = OpenAIEmbeddings(model="text-embedding-3-small")+ print("✅ LLM 客户端初始化成功")+ except Exception as e:+ print(f"❌ LLM 客户端初始化失败: {e}")+ print("💡 请确保您已经正确设置了 OPENAI_API_KEY 环境变量")+ return++ # 读取输入文件内容+ print(f"\n📖 读取文件内容...")+ with open(INPUT_FILE, "r", encoding="utf-8") as f:+ content = f.read()+ print(f"✅ 读取成功,共 {len(content)} 字符")++ # 初始化模板并进行知识提取+ print(f"\n🧠 开始知识提取...")+ try:+ # 初始化模板+ template = TEMPLATE(+ llm_client=llm,+ embedder=embedder,+ extraction_mode="two_stage",+ verbose=True,+ )++ # 喂入文本+ template.feed_text(content)+ print("✅ 知识提取完成")++ # 展示结果+ template.build_index()+ print("\n" + "=" * 60)+ print("📊 提取结果展示")+ print("=" * 60)+ template.show()++ except Exception as e:+ print(f"❌ 知识提取失败: {e}")+ import traceback++ traceback.print_exc()+++if __name__ == "__main__":+ main()diff --git a/hyperextract/templates/en/INSTRUCTION.md b/hyperextract/templates/en/INSTRUCTION.mdindex 4461823..baf436e 100644--- a/hyperextract/templates/en/INSTRUCTION.md+++ b/hyperextract/templates/en/INSTRUCTION.md@@ -64,7 +64,7 @@ Hyperedges are used to model complex relationships among multiple entities, brea### 2.2 Naming Conventions- Class names: `PascalCase` (e.g., `FinancialReportGraph`)-- Variable/Method names: `camelCase` (e.g., `nodeLabelExtractor`)+- Variable/Method names: `camelCase` (e.g., `node_label_extractor`)### 2.3 Example```python@@ -221,15 +221,15 @@ def show(top_k_for_search: Number of nodes/edges returned for semantic search, default is 3top_k_for_chat: Number of nodes/edges used for Q&A, default is 3"""- def nodeLabelExtractor(node: MyNode) -> str:+ def node_label_extractor(node: MyNode) -> str:return node.name # Simple label, not unique identifier, friendly for display- def edgeLabelExtractor(edge: MyEdge) -> str:+ def edge_label_extractor(edge: MyEdge) -> str:return edge.relationTypesuper().show(- node_label_extractor=nodeLabelExtractor,- edge_label_extractor=edgeLabelExtractor,+ node_label_extractor=node_label_extractor,+ edge_label_extractor=edge_label_extractor,top_k_for_search=top_k_for_search,top_k_for_chat=top_k_for_chat,)@@ -305,7 +305,6 @@ Current Observation Date: {observation_time}1. Only extract edges from the known entity list below2. Do NOT create entities not listed-### Known Entity List:"""_PROMPT = """@@ -406,15 +405,15 @@ class FinancialReportGraph(AutoTemporalGraph[FinancialEntity, FinancialRelation]top_k_for_search: Number of nodes/edges returned for semantic search, default is 3top_k_for_chat: Number of nodes/edges used for Q&A, default is 3"""- def nodeLabelExtractor(node: FinancialEntity) -> str:+ def node_label_extractor(node: FinancialEntity) -> str:return node.name- def edgeLabelExtractor(edge: FinancialRelation) -> str:+ def edge_label_extractor(edge: FinancialRelation) -> str:return edge.relationTypesuper().show(- node_label_extractor=nodeLabelExtractor,- edge_label_extractor=edgeLabelExtractor,+ node_label_extractor=node_label_extractor,+ edge_label_extractor=edge_label_extractor,top_k_for_search=top_k_for_search,top_k_for_chat=top_k_for_chat,)diff --git a/hyperextract/templates/en/__init__.py b/hyperextract/templates/en/__init__.pyindex 3773a26..10dac70 100644--- a/hyperextract/templates/en/__init__.py+++ b/hyperextract/templates/en/__init__.py@@ -1,9 +1,8 @@-from .general import KnowledgeGraph, ConceptMap, LogicGraph+# from .general import KnowledgeGraph, ConceptMap, LogicGraphfrom .agriculture import CropCycleGraph, LivestockGraph, AgriPestControlfrom .biology import TaxonomyGraph, BiologicalNetwork, MetabolicHypergraphfrom .finance import (RiskAssessmentGraph,- MarketSentimentGraph,SupplyChainGraph,FilingFinancialSnapshot,MDANarrativeGraph,diff --git a/hyperextract/templates/en/general/__init__.py b/hyperextract/templates/en/general/__init__.pyindex aa993f8..e69de29 100644--- a/hyperextract/templates/en/general/__init__.py+++ b/hyperextract/templates/en/general/__init__.py@@ -1,23 +0,0 @@-"""General purpose knowledge graph templates.--This module provides foundational templates for general information extraction:-- KnowledgeGraph: Factual entity-relationship mapping for news and biographies.-- ConceptMap: Semantic definitions and taxonomies for technical/educational content.-- LogicGraph: Analysis of reasoning, arguments, and causal chains in analytical text.-"""--from .knowledge_graph import KnowledgeGraph, Entity, Relation-from .concept_map import ConceptMap, Concept, ConceptRelation-from .logic_graph import LogicGraph, LogicNode, LogicRelation--__all__ = [- "KnowledgeGraph",- "Entity",- "Relation",- "ConceptMap",- "Concept",- "ConceptRelation",- "LogicGraph",- "LogicNode",- "LogicRelation",-]diff --git a/hyperextract/templates/en/general/concept_map.py b/hyperextract/templates/en/general/concept_map.pydeleted file mode 100644index e21215d..0000000--- a/hyperextract/templates/en/general/concept_map.py+++ /dev/null@@ -1,165 +0,0 @@-from typing import List, Optional, Any-from pydantic import BaseModel, Field-from langchain_core.language_models.chat_models import BaseChatModel-from langchain_core.embeddings import Embeddings-from hyperextract.types import AutoGraph--# ==============================================================================-# 1. Schema Definitions-# ==============================================================================---class Concept(BaseModel):- """A conceptual node representing a term, idea, or theory."""-- term: str = Field(description="The technical term or concept name.")- definition: str = Field(- description="A formal definition or explanation of the concept."- )- examples: Optional[List[str]] = Field(- default_factory=list, description="Examples that illustrate this concept."- )- attributes: Optional[List[str]] = Field(- default_factory=list, description="Key properties or attributes of the concept."- )---class ConceptRelation(BaseModel):- """A semantic relationship between two concepts."""-- source: str = Field(description="The source concept.")- target: str = Field(description="The target concept.")- relation_type: str = Field(- description="Type of relationship (e.g., is-a, part-of, related-to, used-for, instance-of)."- )---# ==============================================================================-# 2. Prompts-# ==============================================================================--_PROMPT = (- "You are an expert in semantic modeling. Extract a concept map from the text, focusing on "- "definitions, terminologies, and their hierarchical or associative relationships.\n\n"- "Guidelines:\n"- "- Identify core terms and provide their precise definitions based on the text.\n"- "- Use standard semantic relations like 'is-a' (inheritance) or 'part-of' (composition).\n"- "- Capture illustrative examples if mentioned."-)--_NODE_PROMPT = (- "Extract all foundational concepts and technical terms from the text. "- "For each concept, provide its term, a precise definition, a list of key attributes, "- "and any specific examples mentioned in the source."-)--_EDGE_PROMPT = (- "Establish semantic relationships between the provided concepts. "- "Focus on hierarchical taxonomies (is-a, part-of) and functional associations (used-for, instance-of). "- "Ensure edges logically connect the defined concepts."-)--# ==============================================================================-# 3. Template Class-# ==============================================================================---class ConceptMap(AutoGraph[Concept, ConceptRelation]):- """- A template for building concept maps and taxonomies.-- Ideal for structured learning, technical documentation, and glossary extraction.- It focuses on definitions, semantic categories, and hierarchical relationships.-- Example:- >>> from langchain_openai import ChatOpenAI, OpenAIEmbeddings- >>> llm = ChatOpenAI(model="gpt-4o")- >>> embedder = OpenAIEmbeddings()- >>> # Initialize the template- >>> cm = ConceptMap(llm_client=llm, embedder=embedder)- >>> # Extract taxonomy from text- >>> text = "Machine Learning is a subset of Artificial Intelligence that uses data to learn."- >>> cm.feed_text(text)- >>> print(cm.edges) # Output shows: Machine Learning --(is a)--> Artificial Intelligence- """-- def __init__(- self,- llm_client: BaseChatModel,- embedder: Embeddings,- *,- extraction_mode: str = "one_stage",- chunk_size: int = 2048,- chunk_overlap: int = 256,- max_workers: int = 10,- verbose: bool = False,- **kwargs: Any,- ):- """- Initialize the ConceptMap template.-- Args:- llm_client: The language model client used for extraction.- embedder: The embedding model used for concept deduplication and indexing.- extraction_mode: The strategy for extraction:- - "one_stage": Extract nodes and edges simultaneously (faster).- - "two_stage": Extract nodes first, then edges (higher accuracy).- chunk_size: Maximum number of characters per text chunk.- chunk_overlap: Number of characters to overlap between chunks.- max_workers: Maximum number of parallel workers for processing.- verbose: If True, prints detailed progress logs.- **kwargs: Additional arguments passed to the AutoGraph constructor.- """- super().__init__(- node_schema=Concept,- edge_schema=ConceptRelation,- node_key_extractor=lambda x: x.term.strip(),- edge_key_extractor=lambda x: (- f"{x.source.strip()}--({x.relation_type.lower()})-->{x.target.strip()}"- ),- nodes_in_edge_extractor=lambda x: (x.source.strip(), x.target.strip()),- llm_client=llm_client,- embedder=embedder,- extraction_mode=extraction_mode,- chunk_size=chunk_size,- chunk_overlap=chunk_overlap,- max_workers=max_workers,- verbose=verbose,- prompt=_PROMPT,- prompt_for_node_extraction=_NODE_PROMPT,- prompt_for_edge_extraction=_EDGE_PROMPT,- **kwargs,- )-- def show(- self,- *,- top_k_nodes_for_search: int = 3,- top_k_edges_for_search: int = 3,- top_k_nodes_for_chat: int = 3,- top_k_edges_for_chat: int = 3,- ) -> None:- """- Visualize the graph using OntoSight.-- Args:- top_k_nodes_for_search (int): Number of nodes to retrieve for search context. Default 3.- top_k_edges_for_search (int): Number of edges to retrieve for search context. Default 3.- top_k_nodes_for_chat (int): Number of nodes to retrieve for chat context. Default 3.- top_k_edges_for_chat (int): Number of edges to retrieve for chat context. Default 3.- """-- def node_label_extractor(node: Concept) -> str:- return f"{node.term}"-- def edge_label_extractor(edge: ConceptRelation) -> str:- return f"{edge.relation_type}"-- super().show(- node_label_extractor=node_label_extractor,- edge_label_extractor=edge_label_extractor,- top_k_nodes_for_search=top_k_nodes_for_search,- top_k_edges_for_search=top_k_edges_for_search,- top_k_nodes_for_chat=top_k_nodes_for_chat,- top_k_edges_for_chat=top_k_edges_for_chat,- )diff --git a/hyperextract/templates/en/general/knowledge_graph.py b/hyperextract/templates/en/general/knowledge_graph.pydeleted file mode 100644index 05eee13..0000000--- a/hyperextract/templates/en/general/knowledge_graph.py+++ /dev/null@@ -1,166 +0,0 @@-from typing import List, Optional, Any-from pydantic import BaseModel, Field-from langchain_core.language_models.chat_models import BaseChatModel-from langchain_core.embeddings import Embeddings-from hyperextract.types import AutoGraph--# ==============================================================================-# 1. Schema Definitions-# ==============================================================================---class Entity(BaseModel):- """A general entity representing a person, organization, location, or object."""-- name: str = Field(description="The primary name of the entity.")- category: str = Field(- description="Category of the entity (e.g., Person, Organization, Location, Event, Object)."- )- description: Optional[str] = Field(- description="A concise summary of the entity and its role in the text."- )---class Relation(BaseModel):- """A factual relationship between two entities."""-- source: str = Field(description="The name of the source entity.")- target: str = Field(description="The name of the target entity.")- relation: str = Field(- description="The type of relationship (e.g., Works for, Located in, Born in, Acquired)."- )- details: Optional[str] = Field(- description="Additional context or details about this relationship."- )---# ==============================================================================-# 2. Prompts-# ==============================================================================--_PROMPT = (- "You are an expert knowledge extraction system. Your task is to extract a factual knowledge graph "- "from the provided text. Focus on identifying key entities (People, Organizations, Locations, and relevant Objects) "- "and the explicit relationships between them.\n\n"- "Guidelines:\n"- "- Extract distinct entitles and their factual properties.\n"- "- Map relationships that describe how entities interact or are connected.\n"- "- Use clear, concise language for descriptions and relations."-)--_NODE_PROMPT = (- "Extract all key entities from the text. Focus on identifying People, Organizations, Locations, and important Objects. "- "Provide a name, a category, and a concise description for each entity."-)--_EDGE_PROMPT = (- "Identify factual relationships between the following listed entities based on the text. "- "Focus on interactions like 'works for', 'located in', 'acquired', or 'partnered with'. "- "Do not hallucinate entities not in the provided list."-)--# ==============================================================================-# 3. Template Class-# ==============================================================================---class KnowledgeGraph(AutoGraph[Entity, Relation]):- """- A foundational knowledge graph template for factual extraction.-- This template is optimized for extracting entities (People, Places, Organizations)- and their factual interactions from news articles, biographies, and encyclopedic texts.-- Example:- >>> from langchain_openai import ChatOpenAI, OpenAIEmbeddings- >>> llm = ChatOpenAI(model="gpt-4o")- >>> embedder = OpenAIEmbeddings()- >>> # Initialize the template- >>> kg = KnowledgeGraph(llm_client=llm, embedder=embedder)- >>> # Extract knowledge from text- >>> text = "Steve Jobs co-founded Apple in Cupertino."- >>> kg.feed_text(text)- >>> print(kg.nodes) # Output: [Entity(name='Steve Jobs', ...), Entity(name='Apple', ...)]- """-- def __init__(- self,- llm_client: BaseChatModel,- embedder: Embeddings,- *,- extraction_mode: str = "one_stage",- chunk_size: int = 2048,- chunk_overlap: int = 256,- max_workers: int = 10,- verbose: bool = False,- **kwargs: Any,- ):- """- Initialize the KnowledgeGraph template.-- Args:- llm_client: The language model client used for extraction.- embedder: The embedding model used for entity deduplication and indexing.- extraction_mode: The strategy for extraction:- - "one_stage": Extract nodes and edges simultaneously (faster).- - "two_stage": Extract nodes first, then edges (higher accuracy).- chunk_size: Maximum number of characters per text chunk.- chunk_overlap: Number of characters to overlap between chunks.- max_workers: Maximum number of parallel workers for processing.- verbose: If True, prints detailed progress logs.- **kwargs: Additional arguments passed to the AutoGraph constructor.- """- super().__init__(- node_schema=Entity,- edge_schema=Relation,- node_key_extractor=lambda x: x.name.strip(),- edge_key_extractor=lambda x: (- f"{x.source.strip()}--[{x.relation.lower()}]-->{x.target.strip()}"- ),- nodes_in_edge_extractor=lambda x: (x.source.strip(), x.target.strip()),- llm_client=llm_client,- embedder=embedder,- extraction_mode=extraction_mode,- chunk_size=chunk_size,- chunk_overlap=chunk_overlap,- max_workers=max_workers,- verbose=verbose,- prompt=_PROMPT,- prompt_for_node_extraction=_NODE_PROMPT,- prompt_for_edge_extraction=_EDGE_PROMPT,- **kwargs,- )-- def show(- self,- *,- top_k_nodes_for_search: int = 3,- top_k_edges_for_search: int = 3,- top_k_nodes_for_chat: int = 3,- top_k_edges_for_chat: int = 3,- ) -> None:- """- Visualize the graph using OntoSight.-- Args:- top_k_nodes_for_search (int): Number of nodes to retrieve for search context. Default 3.- top_k_edges_for_search (int): Number of edges to retrieve for search context. Default 3.- top_k_nodes_for_chat (int): Number of nodes to retrieve for chat context. Default 3.- top_k_edges_for_chat (int): Number of edges to retrieve for chat context. Default 3.- """-- def node_label_extractor(node: Entity) -> str:- info = f" ({node.category})" if getattr(node, "category", None) else ""- return f"{node.name}{info}"-- def edge_label_extractor(edge: Relation) -> str:- return f"{edge.relation}"-- super().show(- node_label_extractor=node_label_extractor,- edge_label_extractor=edge_label_extractor,- top_k_nodes_for_search=top_k_nodes_for_search,- top_k_edges_for_search=top_k_edges_for_search,- top_k_nodes_for_chat=top_k_nodes_for_chat,- top_k_edges_for_chat=top_k_edges_for_chat,- )diff --git a/hyperextract/templates/en/general/logic_graph.py b/hyperextract/templates/en/general/logic_graph.pydeleted file mode 100644index be1d245..0000000--- a/hyperextract/templates/en/general/logic_graph.py+++ /dev/null@@ -1,160 +0,0 @@-from typing import Optional, Any-from pydantic import BaseModel, Field-from langchain_core.language_models.chat_models import BaseChatModel-from langchain_core.embeddings import Embeddings-from hyperextract.types import AutoGraph--# ==============================================================================-# 1. Schema Definitions-# ==============================================================================---class LogicNode(BaseModel):- """A node representing a claim, evidence, or premise in an argument."""-- statement: str = Field(description="The central claim, fact, or observation.")- node_type: str = Field(- description="Type of node: Claim (main point), Evidence (supporting data), Premise (underlying assumption)."- )- source_attribution: Optional[str] = Field(- description="Where or who this logic point originates from."- )---class LogicRelation(BaseModel):- """The logical connection between two statements."""-- source: str = Field(description="The source statement.")- target: str = Field(description="The target statement.")- inference: str = Field(- description="The logical link: Supports, Contradicts, Proves, Leads to, Explains."- )---# ==============================================================================-# 2. Prompts-# ==============================================================================--_PROMPT = (- "You are a logical analyst. Extract the reasoning structure from the text into a directed graph.\n\n"- "Guidelines:\n"- "- Identify the main claims (conclusions) and the evidence or premises that lead to them.\n"- "- Explicitly map how one statement supports or contradicts another.\n"- "- Do not just extract facts; extract the 'argument' and 'reasoning' flow."-)--_NODE_PROMPT = (- "Extract the individual building blocks of the argument. Identify core claims, supporting evidence, "- "and underlying premises. For each, determine its type and note any source attribution mentioned."-)--_EDGE_PROMPT = (- "Map the logical flow between the extracted claims and evidence. Focus on how statements "- "Support, Contradict, or Lead to one another. Ensure every edge represents a step in the reasoning chain."-)--# ==============================================================================-# 3. Template Class-# ==============================================================================---class LogicGraph(AutoGraph[LogicNode, LogicRelation]):- """- A template for analyzing reasoning, arguments, and causal chains.-- This template is designed to map out the logical structure of analytical reports,- scientific papers, or debate transcripts. It captures claims, evidence, and- the logical links (Support/Contradict) between them.-- Example:- >>> from langchain_openai import ChatOpenAI, OpenAIEmbeddings- >>> llm = ChatOpenAI(model="gpt-4o")- >>> embedder = OpenAIEmbeddings()- >>> # Initialize the template- >>> lg = LogicGraph(llm_client=llm, embedder=embedder)- >>> # Extract logic from text- >>> text = "The climate is warming because carbon levels are rising."- >>> lg.feed_text(text)- >>> print(lg.edges) # Output shows: Carbon levels rising --(Supports)--> Climate is warming- """-- def __init__(- self,- llm_client: BaseChatModel,- embedder: Embeddings,- *,- extraction_mode: str = "one_stage",- chunk_size: int = 2048,- chunk_overlap: int = 256,- max_workers: int = 10,- verbose: bool = False,- **kwargs: Any,- ):- """- Initialize the LogicGraph template.-- Args:- llm_client: The language model client used for extraction.- embedder: The embedding model used for logic point deduplication and indexing.- extraction_mode: The strategy for extraction:- - "one_stage": Extract nodes and edges simultaneously (faster).- - "two_stage": Extract nodes first, then edges (higher accuracy).- chunk_size: Maximum number of characters per text chunk.- chunk_overlap: Number of characters to overlap between chunks.- max_workers: Maximum number of parallel workers for processing.- verbose: If True, prints detailed progress logs.- **kwargs: Additional arguments passed to the AutoGraph constructor.- """- super().__init__(- node_schema=LogicNode,- edge_schema=LogicRelation,- node_key_extractor=lambda x: x.statement.strip(),- edge_key_extractor=lambda x: (- f"{x.source.strip()}--({x.inference.lower()})-->{x.target.strip()}"- ),- nodes_in_edge_extractor=lambda x: (x.source.strip(), x.target.strip()),- llm_client=llm_client,- embedder=embedder,- extraction_mode=extraction_mode,- chunk_size=chunk_size,- chunk_overlap=chunk_overlap,- max_workers=max_workers,- verbose=verbose,- prompt=_PROMPT,- prompt_for_node_extraction=_NODE_PROMPT,- prompt_for_edge_extraction=_EDGE_PROMPT,- **kwargs,- )-- def show(- self,- *,- top_k_nodes_for_search: int = 3,- top_k_edges_for_search: int = 3,- top_k_nodes_for_chat: int = 3,- top_k_edges_for_chat: int = 3,- ) -> None:- """- Visualize the graph using OntoSight.-- Args:- top_k_nodes_for_search (int): Number of nodes to retrieve for search context. Default 3.- top_k_edges_for_search (int): Number of edges to retrieve for search context. Default 3.- top_k_nodes_for_chat (int): Number of nodes to retrieve for chat context. Default 3.- top_k_edges_for_chat (int): Number of edges to retrieve for chat context. Default 3.- """-- def node_label_extractor(node: LogicNode) -> str:- return f"{node.statement}"-- def edge_label_extractor(edge: LogicRelation) -> str:- return f"{edge.inference}"-- super().show(- node_label_extractor=node_label_extractor,- edge_label_extractor=edge_label_extractor,- top_k_nodes_for_search=top_k_nodes_for_search,- top_k_edges_for_search=top_k_edges_for_search,- top_k_nodes_for_chat=top_k_nodes_for_chat,- top_k_edges_for_chat=top_k_edges_for_chat,- )diff --git a/hyperextract/templates/zh/INSTRUCTION.md b/hyperextract/templates/zh/INSTRUCTION.mdindex 44bf771..dc0831c 100644--- a/hyperextract/templates/zh/INSTRUCTION.md+++ b/hyperextract/templates/zh/INSTRUCTION.md@@ -64,7 +64,7 @@### 2.2 命名规范- 类名:`PascalCase`(如 `FinancialReportGraph`)-- 变量/方法名:`camelCase`(如 `nodeLabelExtractor`)+- 变量/方法名:`camelCase`(如 `node_label_extractor`)### 2.3 示例```python@@ -219,15 +219,15 @@ def show(top_k_for_search: 语义检索返回的节点/边数量,默认为 3top_k_for_chat: 问答使用的节点/边数量,默认为 3"""- def nodeLabelExtractor(node: MyNode) -> str:+ def node_label_extractor(node: MyNode) -> str:return node.name # 简明 label,非唯一标识,展示友好- def edgeLabelExtractor(edge: MyEdge) -> str:+ def edge_label_extractor(edge: MyEdge) -> str:return edge.relationTypesuper().show(- node_label_extractor=nodeLabelExtractor,- edge_label_extractor=edgeLabelExtractor,+ node_label_extractor=node_label_extractor,+ edge_label_extractor=edge_label_extractor,top_k_for_search=top_k_for_search,top_k_for_chat=top_k_for_chat,)@@ -303,7 +303,6 @@ _EDGE_PROMPT = """1. 仅从下方已知实体列表中提取边2. 不要创建未列出的实体-### 已知实体列表:"""_PROMPT = """@@ -404,15 +403,15 @@ class FinancialReportGraph(AutoTemporalGraph[FinancialEntity, FinancialRelation]top_k_for_search: 语义检索返回的节点/边数量,默认为 3top_k_for_chat: 问答使用的节点/边数量,默认为 3"""- def nodeLabelExtractor(node: FinancialEntity) -> str:+ def node_label_extractor(node: FinancialEntity) -> str:return node.name- def edgeLabelExtractor(edge: FinancialRelation) -> str:+ def edge_label_extractor(edge: FinancialRelation) -> str:return edge.relationTypesuper().show(- node_label_extractor=nodeLabelExtractor,- edge_label_extractor=edgeLabelExtractor,+ node_label_extractor=node_label_extractor,+ edge_label_extractor=edge_label_extractor,top_k_for_search=top_k_for_search,top_k_for_chat=top_k_for_chat,)diff --git a/hyperextract/templates/zh/__init__.py b/hyperextract/templates/zh/__init__.pyindex a7ff0db..fa57f54 100644--- a/hyperextract/templates/zh/__init__.py+++ b/hyperextract/templates/zh/__init__.py@@ -1,9 +1,62 @@-from .general import KnowledgeGraph, ConceptMap, LogicGraph+from .general import (+ # 知识图谱+ KnowledgeGraph,+ GeneralEntity,+ GeneralRelation,+ # 实体集合+ EntityRegistry,+ RegistryEntry,+ # 关键词列表+ KeywordList,+ Keyword,+ # 百科条目+ EncyclopediaItem,+ EncyclopediaInfo,+ # 概念层级图+ ConceptHierarchy,+ ConceptNode,+ HierarchyRelation,+ # 引用网络+ CrossReferenceNet,+ ReferenceNode,+ ReferenceRelation,+ # 个人档案+ PersonalProfile,+ PersonalInfo,+ # 社会网络+ SocialNetwork,+ PersonNode,+ SocialRelation,+ # 生平时序图+ LifeEventTimeline,+ LifeEntity,+ LifeEvent,+ # 规章元数据快照+ RegulationProfile,+ RegulationInfo,+ # 规章条文清单+ ClauseList,+ Clause,+ # 违规处罚对照表+ PenaltyRegistry,+ PenaltyEntry,+ # 执行程序流程图+ OperationalProcedure,+ ProcedureStep,+ ProcedureTransition,+ # 违规处罚因果链+ PenaltyMapping,+ PenaltyNode,+ PenaltyPath,+ # 合规行为超图+ ComplianceLogic,+ ComplianceEntity,+ ComplianceRule,+)from .agriculture import CropCycleGraph, LivestockGraph, AgriPestControlfrom .biology import TaxonomyGraph, BiologicalNetwork, MetabolicHypergraphfrom .finance import (RiskAssessmentGraph,- MarketSentimentGraph,SupplyChainGraph,FilingFinancialSnapshot,MDANarrativeGraph,@@ -28,7 +81,11 @@ from .finance import (MarketNarrativeTimeline,)from .literature import CharacterRelationshipGraph, NarrativeTimeline, SymbolismSet-from .medicine import DrugInteractionGraph, ClinicalTreatmentTimeline, DiagnosticCriteriaSet+from .medicine import (+ DrugInteractionGraph,+ ClinicalTreatmentTimeline,+ DiagnosticCriteriaSet,+)from .news import BreakingEventGraph, TopicTimeline, OpinionSetfrom .tcm import (PrescriptionCompositionGraph,@@ -39,18 +96,60 @@ from .tcm import ()__all__ = [+ # general+ ## 知识图谱"KnowledgeGraph",- "ConceptMap",- "LogicGraph",- "CropCycleGraph",- "LivestockGraph",- "AgriPestControl",- "TaxonomyGraph",- "BiologicalNetwork",- "MetabolicHypergraph",- "MolecularStructureGraph",- "ChemicalReactionHyper",- "LabProtocolTemporal",+ "GeneralEntity",+ "GeneralRelation",+ ## 实体集合+ "EntityRegistry",+ "RegistryEntry",+ ## 关键词列表+ "KeywordList",+ "Keyword",+ ## 百科条目+ "EncyclopediaItem",+ "EncyclopediaInfo",+ ## 概念层级图+ "ConceptHierarchy",+ "ConceptNode",+ "HierarchyRelation",+ ## 引用网络+ "CrossReferenceNet",+ "ReferenceNode",+ "ReferenceRelation",+ ## 个人档案+ "PersonalProfile",+ "PersonalInfo",+ ## 社会网络+ "SocialNetwork",+ "PersonNode",+ "SocialRelation",+ ## 生平时序图+ "LifeEventTimeline",+ "LifeEntity",+ "LifeEvent",+ ## 规章元数据快照+ "RegulationProfile",+ "RegulationInfo",+ ## 规章条文清单+ "ClauseList",+ "Clause",+ ## 违规处罚对照表+ "PenaltyRegistry",+ "PenaltyEntry",+ ## 执行程序流程图+ "OperationalProcedure",+ "ProcedureStep",+ "ProcedureTransition",+ ## 违规处罚因果链+ "PenaltyMapping",+ "PenaltyNode",+ "PenaltyPath",+ ## 合规行为超图+ "ComplianceLogic",+ "ComplianceEntity",+ "ComplianceRule",# Finance"RiskAssessmentGraph","MarketSentimentGraph",@@ -97,4 +196,13 @@ __all__ = ["CultivationSystemMap","SectRelationGraph","ArtifactRegistry",+ "CropCycleGraph",+ "LivestockGraph",+ "AgriPestControl",+ "TaxonomyGraph",+ "BiologicalNetwork",+ "MetabolicHypergraph",+ "MolecularStructureGraph",+ "ChemicalReactionHyper",+ "LabProtocolTemporal",]diff --git a/hyperextract/templates/zh/general/__init__.py b/hyperextract/templates/zh/general/__init__.pyindex 8a8e6be..f6a38eb 100644--- a/hyperextract/templates/zh/general/__init__.py+++ b/hyperextract/templates/zh/general/__init__.py@@ -1,23 +1,71 @@-"""领域通用知识图谱模板。--本模块提供基础的信息提取模板,适用于多种场景:-- KnowledgeGraph: 事实实体-关系映射,适用于新闻、传记和百科。-- ConceptMap: 语义定义与分类体系,适用于技术文档和教育材料。-- LogicGraph: 推理分析、论证过程及因果链,适用于分析性文本。-"""--from .knowledge_graph import KnowledgeGraph, Entity, Relation-from .concept_map import ConceptMap, Concept, ConceptRelation-from .logic_graph import LogicGraph, LogicNode, LogicRelation+from .knowledge_graph import KnowledgeGraph, GeneralEntity, GeneralRelation+from .entity_registry import EntityRegistry, RegistryEntry+from .keyword_list import KeywordList, Keyword+from .encyclopedia_item import EncyclopediaItem, EncyclopediaInfo+from .concept_hierarchy import ConceptHierarchy, ConceptNode, HierarchyRelation+from .cross_reference_net import CrossReferenceNet, ReferenceNode, ReferenceRelation+from .personal_profile import PersonalProfile, PersonalInfo+from .social_network import SocialNetwork, PersonNode, SocialRelation+from .life_event_timeline import LifeEventTimeline, LifeEntity, LifeEvent+from .regulation_profile import RegulationProfile, RegulationInfo+from .clause_list import ClauseList, Clause+from .penalty_registry import PenaltyRegistry, PenaltyEntry+from .operational_procedure import OperationalProcedure, ProcedureStep, ProcedureTransition+from .penalty_mapping import PenaltyMapping, PenaltyNode, PenaltyPath+from .compliance_logic import ComplianceLogic, ComplianceEntity, ComplianceRule__all__ = [+ # 知识图谱"KnowledgeGraph",- "Entity",- "Relation",- "ConceptMap",- "Concept",- "ConceptRelation",- "LogicGraph",- "LogicNode",- "LogicRelation",+ "GeneralEntity",+ "GeneralRelation",+ # 实体集合+ "EntityRegistry",+ "RegistryEntry",+ # 关键词列表+ "KeywordList",+ "Keyword",+ # 百科条目+ "EncyclopediaItem",+ "EncyclopediaInfo",+ # 概念层级图+ "ConceptHierarchy",+ "ConceptNode",+ "HierarchyRelation",+ # 引用网络+ "CrossReferenceNet",+ "ReferenceNode",+ "ReferenceRelation",+ # 个人档案+ "PersonalProfile",+ "PersonalInfo",+ # 社会网络+ "SocialNetwork",+ "PersonNode",+ "SocialRelation",+ # 生平时序图+ "LifeEventTimeline",+ "LifeEntity",+ "LifeEvent",+ # 规章元数据快照+ "RegulationProfile",+ "RegulationInfo",+ # 规章条文清单+ "ClauseList",+ "Clause",+ # 违规处罚对照表+ "PenaltyRegistry",+ "PenaltyEntry",+ # 执行程序流程图+ "OperationalProcedure",+ "ProcedureStep",+ "ProcedureTransition",+ # 违规处罚因果链+ "PenaltyMapping",+ "PenaltyNode",+ "PenaltyPath",+ # 合规行为超图+ "ComplianceLogic",+ "ComplianceEntity",+ "ComplianceRule"]diff --git a/hyperextract/templates/zh/general/clause_list.py b/hyperextract/templates/zh/general/clause_list.pynew file mode 100644index 0000000..1be84b7--- /dev/null+++ b/hyperextract/templates/zh/general/clause_list.py@@ -0,0 +1,104 @@+"""规章条文清单 - 将规章制度拆解为逐条的原子化条文,方便快速索引。++适用于条文检索、全文比对等。+"""++from typing import Any+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoList+++class Clause(BaseModel):+ """规章条文"""+ clauseId: str = Field(description="条文编号,如第1条、第2.1款")+ title: str = Field(description="条目标题/主题", default="")+ content: str = Field(description="条文内容")+ category: str = Field(description="条文分类:总则、权利义务、程序、处罚、附则、其他", default="其他")+++_PROMPT = """你是一位专业的规章制度条文拆解专家。请将文本拆解为逐条的原子化条文。++### 提取规则+1. 将规章制度按其自然结构拆解为独立的条文+2. 为每条条文分配编号(如第1条、第2.1款等)+3. 提取条文的内容+4. 为条文添加适当的标题或主题(如有)+5. 为每条条文指定分类:总则、权利义务、程序、处罚、附则、其他++### 约束条件+- 保持条文内容与原文一致+- 不要遗漏任何条文+- 保持条文的完整性++### 源文本:+"""+++class ClauseList(AutoList[Clause]):+ """+ 适用文档: 公司内部管理制度、行政法规、操作手册、合规指南++ 功能介绍:+ 将规章制度拆解为逐条的原子化条文,方便快速索引。适用于条文检索、全文比对等。++ Example:+ >>> template = ClauseList(llm_client=llm, embedder=embedder)+ >>> template.feed_text("宇宙第一摸鱼公司员工考勤管理制度...")+ >>> for clause in template:+ ... print(f"{clause.clauseId}: {clause.content}")+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化规章条文清单模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ item_schema=Clause,+ llm_client=llm_client,+ embedder=embedder,+ prompt=_PROMPT,+ max_workers=max_workers,+ verbose=verbose,+ **kwargs,+ )++ def show(+ self,+ *,+ top_k_for_search: int = 3,+ top_k_for_chat: int = 3,+ ):+ """+ 展示规章条文清单。++ Args:+ top_k_for_search: 语义检索返回的条文数量,默认为 3+ top_k_for_chat: 问答使用的条文数量,默认为 3+ """+ def itemLabelExtractor(item: Clause) -> str:+ if item.title:+ return f"{item.clauseId}: {item.title}"+ return f"{item.clauseId}"++ super().show(+ item_label_extractor=itemLabelExtractor,+ top_k_for_search=top_k_for_search,+ top_k_for_chat=top_k_for_chat,+ )diff --git a/hyperextract/templates/zh/general/compliance_logic.py b/hyperextract/templates/zh/general/compliance_logic.pynew file mode 100644index 0000000..4c32199--- /dev/null+++ b/hyperextract/templates/zh/general/compliance_logic.py@@ -0,0 +1,148 @@+"""合规行为超图 - 建模“在何种条件下,何种主体,必须/禁止执行何种操作”的复杂逻辑。++适用于合规审计、风险识别等。+"""++from typing import Any, List, Tuple+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoHypergraph+++class ComplianceEntity(BaseModel):+ """合规实体节点"""+ name: str = Field(description="实体名称")+ type: str = Field(description="实体类型:主体、操作、条件、约束、其他")+ description: str = Field(description="简要描述", default="")+++class ComplianceRule(BaseModel):+ """合规规则超边(连接多个实体)"""+ ruleType: str = Field(description="规则类型:必须、禁止、允许、其他")+ participants: List[str] = Field(description="参与实体名称列表")+ condition: str = Field(description="适用条件", default="")+ action: str = Field(description="操作内容")+ details: str = Field(description="详细说明", default="")+++_PROMPT = """你是一位专业的合规分析专家。请从文本中提取合规实体和规则,建模“在何种条件下,何种主体,必须/禁止执行何种操作”的复杂逻辑,构建合规行为超图。++### 节点提取规则+1. 提取所有合规相关实体+2. 为每个实体指定类型:主体、操作、条件、约束、其他+3. 为每个实体添加简要描述++### 超边提取规则+1. 仅从提取的实体中创建合规规则超边+2. 指定规则类型:必须、禁止、允许、其他+3. 列出所有参与实体(主体、操作、条件等)+4. 描述适用条件(如有)+5. 描述操作内容+6. 添加详细说明(如有)++### 约束条件+- 确保规则逻辑准确+- 保持客观准确,不添加文本中没有的信息++### 源文本:+"""++_NODE_PROMPT = """你是一位专业的合规实体识别专家。请从文本中提取所有合规相关实体作为节点。++### 提取规则+1. 提取所有合规相关实体+2. 为每个实体指定类型:主体、操作、条件、约束、其他+3. 为每个实体添加简要描述++### 源文本:+"""++_EDGE_PROMPT = """你是一位专业的合规规则提取专家。请从给定实体列表中提取合规规则超边。++### 约束条件+1. 仅从下方已知实体列表中提取超边+2. 不要创建未列出的实体++"""+++class ComplianceLogic(AutoHypergraph[ComplianceEntity, ComplianceRule]):+ """+ 适用文档: 合规指南、行政法规、公司管理制度++ 功能介绍:+ 建模“在何种条件下,何种主体,必须/禁止执行何种操作”的复杂逻辑。适用于合规审计、风险识别等。++ Example:+ >>> template = ComplianceLogic(llm_client=llm, embedder=embedder)+ >>> template.feed_text("宇宙第一摸鱼公司合规手册...")+ >>> template.show()+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ extraction_mode: str = "two_stage",+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化合规行为超图模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ extraction_mode: 提取模式,可选 "one_stage"(同时提取节点和边)+ 或 "two_stage"(先提取节点,再提取边),默认为 "two_stage"+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ node_schema=ComplianceEntity,+ edge_schema=ComplianceRule,+ node_key_extractor=lambda x: x.name,+ edge_key_extractor=lambda x: f"{x.ruleType}_{sorted(x.participants)}",+ nodes_in_edge_extractor=lambda x: tuple(x.participants),+ llm_client=llm_client,+ embedder=embedder,+ extraction_mode=extraction_mode,+ max_workers=max_workers,+ verbose=verbose,+ prompt=_PROMPT,+ prompt_for_node_extraction=_NODE_PROMPT,+ prompt_for_edge_extraction=_EDGE_PROMPT,+ **kwargs,+ )++ def show(+ self,+ *,+ top_k_for_search: int = 3,+ top_k_for_chat: int = 3,+ ):+ """+ 展示合规行为超图。++ Args:+ top_k_for_search: 语义检索返回的节点/边数量,默认为 3+ top_k_for_chat: 问答使用的节点/边数量,默认为 3+ """+ def nodeLabelExtractor(node: ComplianceEntity) -> str:+ return f"{node.name} ({node.type})"++ def edgeLabelExtractor(edge: ComplianceRule) -> str:+ return edge.ruleType++ super().show(+ node_label_extractor=nodeLabelExtractor,+ edge_label_extractor=edgeLabelExtractor,+ top_k_nodes_for_search=top_k_for_search,+ top_k_edges_for_search=top_k_for_search,+ top_k_nodes_for_chat=top_k_for_chat,+ top_k_edges_for_chat=top_k_for_chat,+ )diff --git a/hyperextract/templates/zh/general/concept_hierarchy.py b/hyperextract/templates/zh/general/concept_hierarchy.pynew file mode 100644index 0000000..a1c9aec--- /dev/null+++ b/hyperextract/templates/zh/general/concept_hierarchy.py@@ -0,0 +1,156 @@+"""概念层级图 - 构建上下位关系(Subclass-Of)或组成关系(Part-Of)。++适用于科学学科、教材知识点等。+"""++from typing import Any, Optional+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoGraph+++class ConceptNode(BaseModel):+ """概念节点"""+ name: str = Field(description="概念名称")+ category: str = Field(description="概念类型:核心概念、子概念、属性、实例、其他")+ description: str = Field(description="概念简要描述", default="")+++class HierarchyRelation(BaseModel):+ """层级关系边"""+ source: str = Field(description="父概念/整体概念")+ target: str = Field(description="子概念/部分概念")+ relationType: str = Field(description="关系类型:Subclass-Of(上下位)、Part-Of(组成)、Instance-Of(实例)、Other(其他)")+ details: str = Field(description="关系详细说明", default="")+++_PROMPT = """你是一位专业的概念结构分析专家。请从文本中提取概念及其层级关系,构建概念层级图。++### 节点提取规则+1. 提取所有概念:核心概念、子概念、属性、实例等+2. 为每个概念指定类型:核心概念、子概念、属性、实例、其他+3. 为每个概念添加简要描述++### 关系提取规则+1. 仅从提取的概念中创建边+2. 关系类型包括:+ - Subclass-Of:上下位关系(如"狗"是"动物"的子类)+ - Part-Of:组成关系(如"轮胎"是"汽车"的一部分)+ - Instance-Of:实例关系(如"祖冲之"是"数学家"的实例)+ - Other:其他关系+3. 每条边必须连接已提取的节点++### 约束条件+- 保持层级关系清晰,避免循环依赖+- 不要创建未在文本中提及的概念或关系+- 保持客观准确,不添加文本中没有的信息++### 源文本:+"""++_NODE_PROMPT = """你是一位专业的概念识别专家。请从文本中提取所有概念作为节点。++### 提取规则+1. 提取所有概念:核心概念、子概念、属性、实例等+2. 为每个概念指定类型:核心概念、子概念、属性、实例、其他+3. 为每个概念添加简要描述++### 源文本:+"""++_EDGE_PROMPT = """你是一位专业的层级关系提取专家。请从给定概念列表中提取概念(节点)之间的层级关系。++### 关系类型说明+- Subclass-Of:上下位关系(子类与父类)+- Part-Of:组成关系(部分与整体)+- Instance-Of:实例关系(实例与类)+- Other:其他关系++### 约束条件+1. 仅从下方已知概念列表中提取边+2. 不要创建未列出的概念+3. 保持层级关系清晰,避免循环依赖++"""+++class ConceptHierarchy(AutoGraph[ConceptNode, HierarchyRelation]):+ """+ 适用文档: 科学学科教材、知识库文档、分类体系说明++ 功能介绍:+ 构建上下位关系(Subclass-Of)或组成关系(Part-Of)。适用于科学学科、教材知识点等。++ Example:+ >>> template = ConceptHierarchy(llm_client=llm, embedder=embedder)+ >>> template.feed_text("机器学习是人工智能的一个分支...")+ >>> template.show()+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ extraction_mode: str = "two_stage",+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化概念层级图模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ extraction_mode: 提取模式,可选 "one_stage"(同时提取节点和边)+ 或 "two_stage"(先提取节点,再提取边),默认为 "two_stage"+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ node_schema=ConceptNode,+ edge_schema=HierarchyRelation,+ node_key_extractor=lambda x: x.name,+ edge_key_extractor=lambda x: f"{x.source}|{x.relationType}|{x.target}",+ nodes_in_edge_extractor=lambda x: (x.source, x.target),+ llm_client=llm_client,+ embedder=embedder,+ extraction_mode=extraction_mode,+ max_workers=max_workers,+ verbose=verbose,+ prompt=_PROMPT,+ prompt_for_node_extraction=_NODE_PROMPT,+ prompt_for_edge_extraction=_EDGE_PROMPT,+ **kwargs,+ )++ def show(+ self,+ *,+ top_k_for_search: int = 3,+ top_k_for_chat: int = 3,+ ):+ """+ 展示概念层级图。++ Args:+ top_k_for_search: 语义检索返回的节点/边数量,默认为 3+ top_k_for_chat: 问答使用的节点/边数量,默认为 3+ """+ def node_label_extractor(node: ConceptNode) -> str:+ return f"{node.name} ({node.category})"++ def edge_label_extractor(edge: HierarchyRelation) -> str:+ return edge.relationType++ super().show(+ node_label_extractor=node_label_extractor,+ edge_label_extractor=edge_label_extractor,+ top_k_nodes_for_search=top_k_for_search,+ top_k_edges_for_search=top_k_for_search,+ top_k_nodes_for_chat=top_k_for_chat,+ top_k_edges_for_chat=top_k_for_chat,+ )diff --git a/hyperextract/templates/zh/general/concept_map.py b/hyperextract/templates/zh/general/concept_map.pydeleted file mode 100644index 7ec411f..0000000--- a/hyperextract/templates/zh/general/concept_map.py+++ /dev/null@@ -1,144 +0,0 @@-from typing import List, Optional, Any-from pydantic import BaseModel, Field-from langchain_core.language_models.chat_models import BaseChatModel-from langchain_core.embeddings import Embeddings-from hyperextract.types import AutoGraph--# ==============================================================================-# 1. Schema 定义 (Schema Definitions)-# ==============================================================================--class Concept(BaseModel):- """一个代表术语、想法或理论的概念节点。"""- term: str = Field(description="技术术语或概念的名称。")- definition: str = Field(description="该概念的正式定义或解释。")- examples: Optional[List[str]] = Field(default_factory=list, description="说明该概念的示例。")- attributes: Optional[List[str]] = Field(default_factory=list, description="该概念的关键特征或属性。")--class ConceptRelation(BaseModel):- """两个概念之间的语义关系。"""- source: str = Field(description="源概念。")- target: str = Field(description="目标概念。")- relation_type: str = Field(- description="关系类型(例如:是一种 (is-a), 属于 (part-of), 相关于, 用于, 为...的实例)。"- )--# ==============================================================================-# 2. 提示词 (Prompts)-# ==============================================================================--_PROMPT = (- "你是一位语义建模专家。请从文本中提取概念图(Concept Map),重点关注术语定义及其层级或关联关系。\n\n"- "提取指南:\n"- "- 识别核心术语,并基于文本提供精确定义。\n"- "- 使用标准的语义关系词,如“是一种”(继承关系)或“属于”(组成关系)。\n"- "- 如果文本提到了说明性的示例,请一并捕获。"-)--_NODE_PROMPT = (- "请从文本中提取所有基础概念和技术术语。对于每个概念,提供其术语名称、精确定义、关键属性列表,"- "以及文本中提到的任何具体示例。"-)--_EDGE_PROMPT = (- "在提供的概念之间建立语义关系。重点关注层级分类(是一种、属于)以及功能性关联(用于、为...的实例)。"- "确保边逻辑上连接了已定义的各个概念。"-)--# ==============================================================================-# 3. 模板类 (Template Class)-# ==============================================================================--class ConceptMap(AutoGraph[Concept, ConceptRelation]):- """- 用于构建概念图和分类体系的模板。-- 适用于结构化学习、技术文档和术语表提取。侧重于定义、语义类别和层级关系。-- 示例:- >>> from langchain_openai import ChatOpenAI, OpenAIEmbeddings- >>> llm = ChatOpenAI(model="gpt-4o")- >>> embedder = OpenAIEmbeddings()- >>> # 初始化模板- >>> cm = ConceptMap(llm_client=llm, embedder=embedder)- >>> # 从文本中提取分类体系- >>> text = "机器学习是人工智能的一个子集,它利用数据进行学习。"- >>> cm.feed_text(text)- >>> print(cm.edges) # 输出显示:机器学习 --(是一种)--> 人工智能- """- def __init__(- self,- llm_client: BaseChatModel,- embedder: Embeddings,- *,- extraction_mode: str = "one_stage",- chunk_size: int = 2048,- chunk_overlap: int = 256,- max_workers: int = 10,- verbose: bool = False,- **kwargs: Any- ):- """- 初始化 ConceptMap 模板。-- Args:- llm_client: 用于提取的语言模型客户端。- embedder: 用于概念去重和索引的嵌入模型。- extraction_mode: 提取策略:- - "one_stage": 同时提取节点和边(速度更快)。- - "two_stage": 先提取节点,再提取边(准确度更高)。- chunk_size: 每个文本块的最大字符数。- chunk_overlap: 文本块之间的重叠字符数。- max_workers: 并行处理的最大线程数。- verbose: 如果为 True,则打印详细的进度日志。- **kwargs: 传给 AutoGraph 构造函数的其他参数。- """- super().__init__(- node_schema=Concept,- edge_schema=ConceptRelation,- node_key_extractor=lambda x: x.term.strip(),- edge_key_extractor=lambda x: f"{x.source.strip()}--({x.relation_type.lower()})-->{x.target.strip()}",- nodes_in_edge_extractor=lambda x: (x.source.strip(), x.target.strip()),- llm_client=llm_client,- embedder=embedder,- extraction_mode=extraction_mode,- chunk_size=chunk_size,- chunk_overlap=chunk_overlap,- max_workers=max_workers,- verbose=verbose,- prompt=_PROMPT,- prompt_for_node_extraction=_NODE_PROMPT,- prompt_for_edge_extraction=_EDGE_PROMPT,- **kwargs- )- def show(- self,- *,- top_k_nodes_for_search: int = 3,- top_k_edges_for_search: int = 3,- top_k_nodes_for_chat: int = 3,- top_k_edges_for_chat: int = 3,- ) -> None:- """- Visualize the graph using OntoSight.-- Args:- top_k_nodes_for_search (int): Number of nodes to retrieve for search context. Default 3.- top_k_edges_for_search (int): Number of edges to retrieve for search context. Default 3.- top_k_nodes_for_chat (int): Number of nodes to retrieve for chat context. Default 3.- top_k_edges_for_chat (int): Number of edges to retrieve for chat context. Default 3.- """- def node_label_extractor(node: Concept) -> str:- return f"{node.term}"-- def edge_label_extractor(edge: ConceptRelation) -> str:- return f"{edge.relation_type}"-- super().show(- node_label_extractor=node_label_extractor,- edge_label_extractor=edge_label_extractor,- top_k_nodes_for_search=top_k_nodes_for_search,- top_k_edges_for_search=top_k_edges_for_search,- top_k_nodes_for_chat=top_k_nodes_for_chat,- top_k_edges_for_chat=top_k_edges_for_chat,- )diff --git a/hyperextract/templates/zh/general/cross_reference_net.py b/hyperextract/templates/zh/general/cross_reference_net.pynew file mode 100644index 0000000..e449688--- /dev/null+++ b/hyperextract/templates/zh/general/cross_reference_net.py@@ -0,0 +1,157 @@+"""交叉引用网络 - 映射概念之间的超链接或相互引用关系。++适用于百科内链、跨词条关联图等。+"""++from typing import Any, Optional+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoGraph+++class ReferenceNode(BaseModel):+ """引用节点"""+ name: str = Field(description="概念/条目名称")+ type: str = Field(description="节点类型:条目、章节、概念、人物、地点、其他")+ description: str = Field(description="简要描述", default="")+++class ReferenceRelation(BaseModel):+ """引用关系边"""+ source: str = Field(description="源条目/概念")+ target: str = Field(description="被引用条目/概念")+ relationType: str = Field(description="关系类型:Hyperlink(超链接)、Reference(引用)、SeeAlso(参见)、Related(相关)、Other(其他)")+ context: str = Field(description="引用上下文描述", default="")+++_PROMPT = """你是一位专业的知识网络分析专家。请从文本中提取概念/条目及其相互引用关系,构建交叉引用网络。++### 节点提取规则+1. 提取所有被提及的概念或条目+2. 为每个节点指定类型:条目、章节、概念、人物、地点、其他+3. 为每个节点添加简要描述++### 关系提取规则+1. 仅从提取的节点中创建边+2. 关系类型包括:+ - Hyperlink:超链接关系+ - Reference:引用关系+ - SeeAlso:参见关系+ - Related:相关关系+ - Other:其他关系+3. 记录引用的上下文描述++### 约束条件+- 每条边必须连接已提取的节点+- 不要创建未在文本中提及的节点或关系+- 保持客观准确,不添加文本中没有的信息++### 源文本:+"""++_NODE_PROMPT = """你是一位专业的条目识别专家。请从文本中提取所有概念或条目作为节点。++### 提取规则+1. 提取所有被提及的概念或条目+2. 为每个节点指定类型:条目、章节、概念、人物、地点、其他+3. 为每个节点添加简要描述++### 源文本:+"""++_EDGE_PROMPT = """你是一位专业的引用关系提取专家。请从给定节点列表中提取节点之间的相互引用关系。++### 关系类型说明+- Hyperlink:超链接关系+- Reference:引用关系+- SeeAlso:参见关系+- Related:相关关系+- Other:其他关系++### 约束条件+1. 仅从下方已知节点列表中提取边+2. 不要创建未列出的节点++"""+++class CrossReferenceNet(AutoGraph[ReferenceNode, ReferenceRelation]):+ """+ 适用文档: 维基百科条目、知识库文档、带内链的网页内容++ 功能介绍:+ 映射概念之间的超链接或相互引用关系。适用于百科内链、跨词条关联图等。++ Example:+ >>> template = CrossReferenceNet(llm_client=llm, embedder=embedder)+ >>> template.feed_text("机器学习(Machine Learning)是人工智能的一个分支...")+ >>> template.show()+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ extraction_mode: str = "two_stage",+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化交叉引用网络模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ extraction_mode: 提取模式,可选 "one_stage"(同时提取节点和边)+ 或 "two_stage"(先提取节点,再提取边),默认为 "two_stage"+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ node_schema=ReferenceNode,+ edge_schema=ReferenceRelation,+ node_key_extractor=lambda x: x.name,+ edge_key_extractor=lambda x: f"{x.source}|{x.relationType}|{x.target}",+ nodes_in_edge_extractor=lambda x: (x.source, x.target),+ llm_client=llm_client,+ embedder=embedder,+ extraction_mode=extraction_mode,+ max_workers=max_workers,+ verbose=verbose,+ prompt=_PROMPT,+ prompt_for_node_extraction=_NODE_PROMPT,+ prompt_for_edge_extraction=_EDGE_PROMPT,+ **kwargs,+ )++ def show(+ self,+ *,+ top_k_for_search: int = 3,+ top_k_for_chat: int = 3,+ ):+ """+ 展示交叉引用网络。++ Args:+ top_k_for_search: 语义检索返回的节点/边数量,默认为 3+ top_k_for_chat: 问答使用的节点/边数量,默认为 3+ """+ def node_label_extractor(node: ReferenceNode) -> str:+ return f"{node.name} ({node.type})"++ def edge_label_extractor(edge: ReferenceRelation) -> str:+ return edge.relationType++ super().show(+ node_label_extractor=node_label_extractor,+ edge_label_extractor=edge_label_extractor,+ top_k_nodes_for_search=top_k_for_search,+ top_k_edges_for_search=top_k_for_search,+ top_k_nodes_for_chat=top_k_for_chat,+ top_k_edges_for_chat=top_k_for_chat,+ )diff --git a/hyperextract/templates/zh/general/encyclopedia_item.py b/hyperextract/templates/zh/general/encyclopedia_item.pynew file mode 100644index 0000000..0d8dbd1--- /dev/null+++ b/hyperextract/templates/zh/general/encyclopedia_item.py@@ -0,0 +1,87 @@+"""百科条目 - 针对单一主体提取结构化的属性信息(类似信息框 Infobox)。++适用于维基百科、专业词典词条等。+"""++from typing import Any, Optional, List+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoModel+++class EncyclopediaInfo(BaseModel):+ """百科条目信息框"""+ title: str = Field(description="条目标题")+ entityType: str = Field(description="实体类型:人物、地点、组织、事件、概念、物品、其他")+ alternativeNames: List[str] = Field(description="别名、俗称、外文名称", default_factory=list)+ category: List[str] = Field(description="分类标签", default_factory=list)+ summary: str = Field(description="摘要/简介", default="")+ attributes: List[str] = Field(description="关键属性列表,每个元素格式为'属性名: 属性值'", default_factory=list)+ keyEvents: List[str] = Field(description="重要事件/里程碑", default_factory=list)+ relatedConcepts: List[str] = Field(description="相关概念/条目", default_factory=list)+++_PROMPT = """你是一位专业的百科全书编辑。请从文本中提取单一主体的结构化属性信息,构建百科条目信息框。++### 提取规则+1. 识别文本的核心主体(人物、地点、组织、事件、概念等)+2. 为主体指定类型:人物、地点、组织、事件、概念、物品、其他+3. 提取所有别名、俗称或外文名称+4. 提取分类标签(如"科学家"、"数学"、"中国古代")+5. 撰写 100-200 字的摘要+6. 提取关键属性,每个格式为'属性名: 属性值'(如'出生日期: 429年'、'国籍: 中国')+7. 提取重要事件或里程碑+8. 提取相关概念或条目++### 约束条件+- 只提取文本中明确提及的信息,不添加额外内容+- 属性名尽量简洁明了+- 保持客观准确,符合百科全书风格++### 源文本:+"""+++class EncyclopediaItem(AutoModel[EncyclopediaInfo]):+ """+ 适用文档: 维基百科条目、百度百科条目、专业词典词条++ 功能介绍:+ 针对单一主体提取结构化的属性信息(类似信息框 Infobox)。适用于维基百科、专业词典词条等。++ Example:+ >>> template = EncyclopediaItem(llm_client=llm, embedder=embedder)+ >>> template.feed_text("祖冲之(429年-500年),字文远,范阳遒县人...")+ >>> print(template.data.title)+ >>> print(template.data.summary)+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化百科条目模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ data_schema=EncyclopediaInfo,+ llm_client=llm_client,+ embedder=embedder,+ prompt=_PROMPT,+ max_workers=max_workers,+ verbose=verbose,+ **kwargs,+ )diff --git a/hyperextract/templates/zh/general/entity_registry.py b/hyperextract/templates/zh/general/entity_registry.pynew file mode 100644index 0000000..2eb2846--- /dev/null+++ b/hyperextract/templates/zh/general/entity_registry.py@@ -0,0 +1,100 @@+"""实体注册表 - 去重并汇总文本中出现的所有唯一实体。++适用于实体发现、命名实体识别等场景。+"""++from typing import Any+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoSet+++class RegistryEntry(BaseModel):+ """注册表条目"""+ name: str = Field(description="实体名称,保持与原文一致")+ category: str = Field(description="实体类型:人物、机构、地点、产品、概念、其他")+ description: str = Field(description="简要描述", default="")+++_PROMPT = """你是一位专业的实体识别专家。请从文本中提取所有唯一实体,形成实体注册表。++### 提取规则+1. 提取所有实体:人物、机构、地点、产品、概念等+2. 为每个实体指定类型:人物、机构、地点、产品、概念、其他+3. 保持实体名称与原文一致+4. 为每个实体添加简要描述++### 约束条件+- 去重:同一实体只保留一条记录+- 保持客观准确,不添加文本中没有的信息+- 实体名称大小写需与原文保持一致++### 源文本:+"""+++class EntityRegistry(AutoSet[RegistryEntry]):+ """+ 适用文档: 任意文本、网页抓取内容、新闻报道++ 功能介绍:+ 去重并汇总文本中出现的所有唯一实体(如人名、机构名),形成实体注册表。支持实体发现和命名实体识别。++ Example:+ >>> template = EntityRegistry(llm_client=llm, embedder=embedder)+ >>> template.feed_text("银河星际宣布神舟-50首飞成功...")+ >>> print(list(template))+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化实体注册表模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ item_schema=RegistryEntry,+ key_extractor=lambda x: x.name,+ llm_client=llm_client,+ embedder=embedder,+ prompt=_PROMPT,+ max_workers=max_workers,+ verbose=verbose,+ **kwargs,+ )++ def show(+ self,+ *,+ top_k_for_search: int = 3,+ top_k_for_chat: int = 3,+ ):+ """+ 展示实体注册表。++ Args:+ top_k_for_search: 语义检索返回的条目数量,默认为 3+ top_k_for_chat: 问答使用的条目数量,默认为 3+ """+ def itemLabelExtractor(item: RegistryEntry) -> str:+ return f"{item.name} ({item.category})"++ super().show(+ item_label_extractor=itemLabelExtractor,+ top_k_for_search=top_k_for_search,+ top_k_for_chat=top_k_for_chat,+ )diff --git a/hyperextract/templates/zh/general/keyword_list.py b/hyperextract/templates/zh/general/keyword_list.pynew file mode 100644index 0000000..43be42d--- /dev/null+++ b/hyperextract/templates/zh/general/keyword_list.py@@ -0,0 +1,98 @@+"""关键词列表 - 从文本中提取关键词并附带分类、出现频次信息。++适用于内容标签生成、主题分析等场景。+"""++from typing import Any+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoList+++class Keyword(BaseModel):+ """关键词条目"""+ term: str = Field(description="关键词")+ category: str = Field(description="分类:核心概念、术语、人名、机构名、其他")+ description: str = Field(description="关键词简要描述或上下文说明", default="")+++_PROMPT = """你是一位专业的关键词提取专家。请从文本中提取所有关键词并附带分类和描述信息。++### 提取规则+1. 提取文本中的所有关键词和核心短语+2. 为每个关键词指定分类:核心概念、术语、人名、机构名、其他+3. 为每个关键词添加简要描述,说明其在文本中的含义或上下文++### 约束条件+- 确保关键词准确,不添加文本中没有的信息+- 保持关键词大小写与原文一致++### 源文本:+"""+++class KeywordList(AutoList[Keyword]):+ """+ 适用文档: 任意文本、博客文章、学术论文++ 功能介绍:+ 从文本中提取关键词并附带分类和描述信息。适用于内容标签生成和主题分析。++ Example:+ >>> template = KeywordList(llm_client=llm, embedder=embedder)+ >>> template.feed_text("银河星际宣布神舟-50首飞成功...")+ >>> for keyword in template:+ ... print(f"{keyword.term} ({keyword.category}): {keyword.description}")+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化关键词列表模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ item_schema=Keyword,+ llm_client=llm_client,+ embedder=embedder,+ prompt=_PROMPT,+ max_workers=max_workers,+ verbose=verbose,+ **kwargs,+ )++ def show(+ self,+ *,+ top_k_for_search: int = 3,+ top_k_for_chat: int = 3,+ ):+ """+ 展示关键词列表。++ Args:+ top_k_for_search: 语义检索返回的关键词数量,默认为 3+ top_k_for_chat: 问答使用的关键词数量,默认为 3+ """+ def itemLabelExtractor(item: Keyword) -> str:+ return f"{item.term} ({item.category})"++ super().show(+ item_label_extractor=itemLabelExtractor,+ top_k_for_search=top_k_for_search,+ top_k_for_chat=top_k_for_chat,+ )diff --git a/hyperextract/templates/zh/general/knowledge_graph.py b/hyperextract/templates/zh/general/knowledge_graph.pyindex 326f8f7..5b9b617 100644--- a/hyperextract/templates/zh/general/knowledge_graph.py+++ b/hyperextract/templates/zh/general/knowledge_graph.py@@ -1,148 +1,147 @@-from typing import List, Optional, Any+"""通用知识图谱 - 从任意文本中提取实体与关系。++适用于任意文本、网页抓取内容等非结构化文档,提取通用实体及其关系。+"""++from typing import Any, Optional, Tuplefrom pydantic import BaseModel, Field-from langchain_core.language_models.chat_models import BaseChatModel+from langchain_core.language_models import BaseChatModelfrom langchain_core.embeddings import Embeddingsfrom hyperextract.types import AutoGraph-# ==============================================================================-# 1. Schema 定义 (Schema Definitions)-# ==============================================================================--class Entity(BaseModel):- """通用实体,代表人物、组织、地点、物体或核心概念。"""- name: str = Field(description="实体的名称。")- category: str = Field(- description="实体的类别(例如:人物、组织、地理位置、概念、事件、物体)。"- )- description: Optional[str] = Field(- description="该实体的简要描述及其在文本中的作用。"- )--class Relation(BaseModel):- """两个实体之间的事实关系。"""- source: str = Field(description="源实体的名。")- target: str = Field(description="目标实体的名称。")- relation: str = Field(description="关系类型(例如:任职于、位于、创立、收购)。")- details: Optional[str] = Field(description="关于该关系的额外上下文或详细描述。")--# ==============================================================================-# 2. 提示词 (Prompts)-# ==============================================================================--_PROMPT = (- "你是一个专业的知识提取专家。你的任务是从提供的文本中提取一个事实知识图谱。"- "重点识别关键实体(人物、组织、地理位置、重要物体)以及它们之间明确的关系。\n\n"- "提取指南:\n"- "- 准确性:从文本中提取明确的实体及其事实属性。\n"- "- 关系映射:描述实体之间如何互动或连接。\n"- "- 简洁性:使用清晰、简洁的语言进行描述和关系定义。"-)--_NODE_PROMPT = (- "请从文本中提取所有关键实体。重点识别人物、组织、地理位置以及重要的物体。"- "为每个实体提供名称、类别以及简明扼要的描述。"-)--_EDGE_PROMPT = (- "基于文本识别以下已知实体之间的事实关系。重点关注如“任职于”、“位于”、“创立”或“收购”等互动。"- "请勿虚构不在列表中的实体。"-)--# ==============================================================================-# 3. 模板类 (Template Class)-# ==============================================================================--class KnowledgeGraph(AutoGraph[Entity, Relation]):++class GeneralEntity(BaseModel):+ """通用实体节点"""+ name: str = Field(description="实体名称,如人名、机构名、产品名")+ category: str = Field(description="实体类型:人物、机构、地点、产品、概念、其他")+ description: str = Field(description="简要描述", default="")+++class GeneralRelation(BaseModel):+ """通用关系边"""+ source: str = Field(description="源实体")+ target: str = Field(description="目标实体")+ relationType: str = Field(description="关系类型:属于、位于、合作、竞争、发明、创建、相关等")+ details: str = Field(description="详细描述", default="")+++_PROMPT = """你是一位专业的知识图谱提取专家。请从文本中提取所有实体(节点)和它们之间的关系(边)。++### 节点提取规则+1. 提取所有实体:人物、机构、地点、产品、概念等+2. 为每个实体指定类型:人物、机构、地点、产品、概念、其他+3. 保持实体名称与原文一致+4. 为每个实体添加简要描述++### 关系提取规则+1. 仅从提取的实体中创建边+2. 关系类型包括:属于、位于、合作、竞争、发明、创建、相关等++### 约束条件+- 每条边必须连接已提取的节点+- 不要创建未在文本中提及的实体或关系+- 保持客观准确,不添加文本中没有的信息++### 源文本:+"""++_NODE_PROMPT = """你是一位专业的实体识别专家。请从文本中提取所有关键实体作为节点。++### 提取规则+1. 提取所有实体:人物、机构、地点、产品、概念等+2. 为每个实体指定类型:人物、机构、地点、产品、概念、其他+3. 保持实体名称与原文一致+4. 为每个实体添加简要描述++### 源文本:+"""++_EDGE_PROMPT = """你是一位专业的关系提取专家。请从给定实体列表中提取实体之间的关系。++### 约束条件+1. 仅从下方已知实体列表中提取边+2. 不要创建未列出的实体+3. 关系类型包括:属于、位于、合作、竞争、发明、创建、相关等++"""+++class KnowledgeGraph(AutoGraph[GeneralEntity, GeneralRelation]):"""- 用于事实提取的基础知识图谱模板。-- 该模板经过优化,适用于从新闻文章、传记和百科文本中提取实体(人物、地点、组织)及其事实交互。-- 示例:- >>> from langchain_openai import ChatOpenAI, OpenAIEmbeddings- >>> llm = ChatOpenAI(model="gpt-4o")- >>> embedder = OpenAIEmbeddings()- >>> # 初始化模板- >>> kg = KnowledgeGraph(llm_client=llm, embedder=embedder)- >>> # 从文本中提取知识- >>> text = "苏轼出生于眉州眉山,是北宋著名的文学家。"- >>> kg.feed_text(text)- >>> print(kg.nodes) # 输出: [Entity(name='苏轼', ...), Entity(name='眉州眉山', ...)]+ 适用文档: 任意文本、网页抓取内容、博客文章、新闻报道++ 功能介绍:+ 从任意文本中提取通用实体及其关系,构建知识图谱。支持人物、机构、地点、产品、概念等多种实体类型。++ Example:+ >>> template = KnowledgeGraph(llm_client=llm, embedder=embedder)+ >>> template.feed_text("银河星际宣布神舟-50首飞成功...")+ >>> template.show()"""+def __init__(self,llm_client: BaseChatModel,embedder: Embeddings,*,- extraction_mode: str = "one_stage",- chunk_size: int = 2048,- chunk_overlap: int = 256,+ extraction_mode: str = "two_stage",max_workers: int = 10,verbose: bool = False,- **kwargs: Any+ **kwargs: Any,):"""- 初始化 KnowledgeGraph 模板。-+ 初始化通用知识图谱模板。+Args:- llm_client: 用于提取的语言模型客户端。- embedder: 用于实体去重和索引的嵌入模型。- extraction_mode: 提取策略:- - "one_stage": 同时提取节点和边(速度更快)。- - "two_stage": 先提取节点,再提取边(准确度更高)。- chunk_size: 每个文本块的最大字符数。- chunk_overlap: 文本块之间的重叠字符数。- max_workers: 并行处理的最大线程数。- verbose: 如果为 True,则打印详细的进度日志。- **kwargs: 传给 AutoGraph 构造函数的其他参数。+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ extraction_mode: 提取模式,可选 "one_stage"(同时提取节点和边)+ 或 "two_stage"(先提取节点,再提取边),默认为 "two_stage"+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类"""super().__init__(- node_schema=Entity,- edge_schema=Relation,- node_key_extractor=lambda x: x.name.strip(),- edge_key_extractor=lambda x: f"{x.source.strip()}--[{x.relation.lower()}]-->{x.target.strip()}",- nodes_in_edge_extractor=lambda x: (x.source.strip(), x.target.strip()),+ node_schema=GeneralEntity,+ edge_schema=GeneralRelation,+ node_key_extractor=lambda x: x.name,+ edge_key_extractor=lambda x: f"{x.source}|{x.relationType}|{x.target}",+ nodes_in_edge_extractor=lambda x: (x.source, x.target),llm_client=llm_client,embedder=embedder,extraction_mode=extraction_mode,- chunk_size=chunk_size,- chunk_overlap=chunk_overlap,max_workers=max_workers,verbose=verbose,prompt=_PROMPT,prompt_for_node_extraction=_NODE_PROMPT,prompt_for_edge_extraction=_EDGE_PROMPT,- **kwargs+ **kwargs,)+def show(self,*,- top_k_nodes_for_search: int = 3,- top_k_edges_for_search: int = 3,- top_k_nodes_for_chat: int = 3,- top_k_edges_for_chat: int = 3,- ) -> None:+ top_k_for_search: int = 3,+ top_k_for_chat: int = 3,+ ):"""- Visualize the graph using OntoSight.-+ 展示知识图谱。+Args:- top_k_nodes_for_search (int): Number of nodes to retrieve for search context. Default 3.- top_k_edges_for_search (int): Number of edges to retrieve for search context. Default 3.- top_k_nodes_for_chat (int): Number of nodes to retrieve for chat context. Default 3.- top_k_edges_for_chat (int): Number of edges to retrieve for chat context. Default 3.+ top_k_for_search: 语义检索返回的节点/边数量,默认为 3+ top_k_for_chat: 问答使用的节点/边数量,默认为 3"""- def node_label_extractor(node: Entity) -> str:- info = f" ({node.category})" if getattr(node, "category", None) else ""- return f"{node.name}{info}"-- def edge_label_extractor(edge: Relation) -> str:- return f"{edge.relation}"-+ def node_label_extractor(node: GeneralEntity) -> str:+ return f"{node.name} ({node.category})"++ def edge_label_extractor(edge: GeneralRelation) -> str:+ return edge.relationType+super().show(node_label_extractor=node_label_extractor,edge_label_extractor=edge_label_extractor,- top_k_nodes_for_search=top_k_nodes_for_search,- top_k_edges_for_search=top_k_edges_for_search,- top_k_nodes_for_chat=top_k_nodes_for_chat,- top_k_edges_for_chat=top_k_edges_for_chat,+ top_k_nodes_for_search=top_k_for_search,+ top_k_edges_for_search=top_k_for_search,+ top_k_nodes_for_chat=top_k_for_chat,+ top_k_edges_for_chat=top_k_for_chat,)diff --git a/hyperextract/templates/zh/general/life_event_timeline.py b/hyperextract/templates/zh/general/life_event_timeline.pynew file mode 100644index 0000000..baf740d--- /dev/null+++ b/hyperextract/templates/zh/general/life_event_timeline.py@@ -0,0 +1,234 @@+"""生平时序图 - 提取带时间戳的事件,并按时间顺序排列。++适用于人物传记、年表、回忆录等。+"""++from typing import Any, Optional+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoTemporalGraph+++class LifeEntity(BaseModel):+ """生活实体节点"""+ name: str = Field(description="实体名称")+ type: str = Field(description="实体类型:人物、地点、组织、物品、概念、其他")+ description: str = Field(description="简要描述", default="")+++class LifeEvent(BaseModel):+ """生活事件边(带可选时间戳)"""+ source: str = Field(description="事件主体/相关实体")+ target: str = Field(description="事件对象/相关实体")+ eventType: str = Field(description="事件类型:出生、逝世、教育、工作、成就、交往、旅行、其他")+ eventDate: Optional[str] = Field(description="事件日期,格式为年-月-日或年份,可选", default=None)+ details: str = Field(description="事件详细描述", default="")+++_PROMPT = """你是一位专业的传记年表专家。请从文本中提取人物、地点、组织等实体以及生活事件,构建生平时序图。++### 节点提取规则+1. 提取所有相关实体:人物、地点、组织、物品、概念等+2. 为每个实体指定类型:人物、地点、组织、物品、概念、其他+3. 为每个实体添加简要描述++### 事件提取规则+1. 仅从提取的实体中创建事件边+2. 事件类型包括:+ - 出生:出生事件+ - 逝世:逝世事件+ - 教育:学习、受教育事件+ - 工作:工作、职业事件+ - 成就:取得成就、获得荣誉事件+ - 交往:人际交往、社会活动事件+ - 旅行:旅行、迁居事件+ - 其他:其他事件+3. 事件日期为可选提取项,仅在文本中明确提及时才提取+4. 日期格式:年-月-日(如 429-01-01)或年份(如 429)+5. 每条边必须连接已提取的节点++### 中文时间计算规则+当前观察日期:{observation_time}++1. **相对时间解析**:必须根据观察日期解析相对时间表达+ - "去年" → 计算为 {observation_time} 前一年+ - "今年" → {observation_time} 所属年份+ - "明年" → {observation_time} 后一年+ - "昨天" → {observation_time} 前一天+ - "今天" → {observation_time}+ - "明天" → {observation_time} 后一天+ - "上个月" → {observation_time} 前一个月的第一天+ - "这个月" → {observation_time} 所属月份的第一天+ - "下个月" → {observation_time} 后一个月的第一天+ - "十年前" → {observation_time} 前十年+ - "五年后" → {observation_time} 后五年+ - "年初" → 当年的 1月1日+ - "年末" → 当年的 12月31日+ - "世纪初" → 该世纪的第 1 年(如 2000 年)+ - "世纪末" → 该世纪的最后 1 年(如 2099 年)+ - "朝代" → 保留朝代名称(如"唐朝"、"宋代"),无需转换++2. **明确日期**:保持原文中的明确日期格式不变+ - 年份(如 429 年、2023 年)→ 429、2023+ - 年-月(如 429年3月)→ 429-03+ - 年-月-日(如 429年3月14日)→ 429-03-14+ - 中文数字日期(如"民国三十八年")→ 转换为公元纪年++3. **缺失时间**:如果文本中没有时间信息,将 eventDate 留空(None),不要编造日期++### 约束条件+- 不要创建未在文本中提及的实体或事件+- 保持客观准确,不添加文本中没有的信息++### 源文本:+"""++_NODE_PROMPT = """你是一位专业的实体识别专家。请从文本中提取所有相关实体作为节点。++### 提取规则+1. 提取所有相关实体:人物、地点、组织、物品、概念等+2. 为每个实体指定类型:人物、地点、组织、物品、概念、其他+3. 为每个实体添加简要描述++### 源文本:+"""++_EDGE_PROMPT = """你是一位专业的生活事件提取专家。请从给定实体列表中提取生活事件。++### 事件类型说明+- 出生:出生事件+- 逝世:逝世事件+- 教育:学习、受教育事件+- 工作:工作、职业事件+- 成就:取得成就、获得荣誉事件+- 交往:人际交往、社会活动事件+- 旅行:旅行、迁居事件+- 其他:其他事件++### 中文时间计算规则+当前观察日期:{observation_time}++1. **相对时间解析**:必须根据观察日期解析相对时间表达+ - "去年" → 计算为 {observation_time} 前一年+ - "今年" → {observation_time} 所属年份+ - "明年" → {observation_time} 后一年+ - "昨天" → {observation_time} 前一天+ - "今天" → {observation_time}+ - "明天" → {observation_time} 后一天+ - "上个月" → {observation_time} 前一个月的第一天+ - "这个月" → {observation_time} 所属月份的第一天+ - "下个月" → {observation_time} 后一个月的第一天+ - "十年前" → {observation_time} 前十年+ - "五年后" → {observation_time} 后五年+ - "年初" → 当年的 1月1日+ - "年末" → 当年的 12月31日+ - "世纪初" → 该世纪的第 1 年(如 2000 年)+ - "世纪末" → 该世纪的最后 1 年(如 2099 年)+ - "朝代" → 保留朝代名称(如"唐朝"、"宋代"),无需转换++2. **明确日期**:保持原文中的明确日期格式不变+ - 年份(如 429 年、2023 年)→ 429、2023+ - 年-月(如 429年3月)→ 429-03+ - 年-月-日(如 429年3月14日)→ 429-03-14+ - 中文数字日期(如"民国三十八年")→ 转换为公元纪年++3. **缺失时间**:如果文本中没有时间信息,将 eventDate 留空(None),不要编造日期++### 日期格式要求+- 所有日期信息统一转换为「年-月-日」格式(如 429-01-01)或年份(如 429)+- 时间信息为可选提取项,仅在文本中明确提及时才提取++### 约束条件+1. 仅从下方已知实体列表中提取事件+2. 不要创建未列出的实体+3. 时间信息为可选,仅在文本中明确提及时才提取++"""+++class LifeEventTimeline(AutoTemporalGraph[LifeEntity, LifeEvent]):+ """+ 适用文档: 人物传记、年表、回忆录、自传++ 功能介绍:+ 提取带时间戳的事件,并按时间顺序排列。适用于人物传记、年表、回忆录等。++ Example:+ >>> template = LifeEventTimeline(llm_client=llm, embedder=embedder)+ >>> template.feed_text("祖冲之(429年-500年),字文远,范阳遒县人...")+ >>> template.show()+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ observation_time: str | None = None,+ extraction_mode: str = "two_stage",+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化生平时序图模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ observation_time: 观察日期,用于解析相对时间表达,默认为今天+ extraction_mode: 提取模式,可选 "one_stage"(同时提取节点和边)+ 或 "two_stage"(先提取节点,再提取边),默认为 "two_stage"+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ node_schema=LifeEntity,+ edge_schema=LifeEvent,+ node_key_extractor=lambda x: x.name,+ edge_key_extractor=lambda x: f"{x.source}|{x.eventType}|{x.target}",+ time_in_edge_extractor=lambda x: x.eventDate,+ nodes_in_edge_extractor=lambda x: (x.source, x.target),+ llm_client=llm_client,+ embedder=embedder,+ observation_time=observation_time,+ extraction_mode=extraction_mode,+ max_workers=max_workers,+ verbose=verbose,+ prompt=_PROMPT,+ prompt_for_node_extraction=_NODE_PROMPT,+ prompt_for_edge_extraction=_EDGE_PROMPT,+ **kwargs,+ )++ def show(+ self,+ *,+ top_k_for_search: int = 3,+ top_k_for_chat: int = 3,+ ):+ """+ 展示生平时序图。++ Args:+ top_k_for_search: 语义检索返回的节点/边数量,默认为 3+ top_k_for_chat: 问答使用的节点/边数量,默认为 3+ """+ def node_label_extractor(node: LifeEntity) -> str:+ return f"{node.name} ({node.type})"++ def edge_label_extractor(edge: LifeEvent) -> str:+ if edge.eventDate:+ return f"{edge.eventType} ({edge.eventDate})"+ return edge.eventType++ super().show(+ node_label_extractor=node_label_extractor,+ edge_label_extractor=edge_label_extractor,+ top_k_nodes_for_search=top_k_for_search,+ top_k_edges_for_search=top_k_for_search,+ top_k_nodes_for_chat=top_k_for_chat,+ top_k_edges_for_chat=top_k_for_chat,+ )diff --git a/hyperextract/templates/zh/general/logic_graph.py b/hyperextract/templates/zh/general/logic_graph.pydeleted file mode 100644index 4bf3e60..0000000--- a/hyperextract/templates/zh/general/logic_graph.py+++ /dev/null@@ -1,143 +0,0 @@-from typing import List, Optional, Any-from pydantic import BaseModel, Field-from langchain_core.language_models.chat_models import BaseChatModel-from langchain_core.embeddings import Embeddings-from hyperextract.types import AutoGraph--# ==============================================================================-# 1. Schema 定义 (Schema Definitions)-# ==============================================================================--class LogicNode(BaseModel):- """代表论点中的主张、证据或前提的节点。"""- statement: str = Field(description="核心主张、事实或观察结果。")- node_type: str = Field(- description="节点类型:主张 (Claim), 证据 (Evidence), 前提 (Premise)。"- )- source_attribution: Optional[str] = Field(description="该逻辑点的来源或出处。")--class LogicRelation(BaseModel):- """两个陈述之间的逻辑连接。"""- source: str = Field(description="源陈述。")- target: str = Field(description="目标陈述。")- inference: str = Field(- description="逻辑链路:支持 (Supports), 反驳 (Contradicts), 证明, 导致, 解释。"- )--# ==============================================================================-# 2. 提示词 (Prompts)-# ==============================================================================--_PROMPT = (- "你是一位逻辑分析师。请将文本中的论证结构提取并转化为一个有向图。\n\n"- "提取指南:\n"- "- 识别主要主张(结论)以及引向这些结论的证据或前提。\n"- "- 明确映射一个陈述是如何支持或反驳另一个陈述的。\n"- "- 不仅要提取事实,更要提取“论证”和“推理”的流向。"-)--_NODE_PROMPT = (- "请提取论证中的各个基本构成要素。识别核心主张、支持性证据和底层前提。对于每一项,确定其类型并记录提及的任何来源出处。"-)--_EDGE_PROMPT = (- "映射提取出的主张与证据之间的逻辑流向。重点关注各个陈述之间是如何相互 支持、反驳 或 导致 彼此的。确保每条边都代表推理链中的一个步骤。"-)--# ==============================================================================-# 3. 模板类 (Template Class)-# ==============================================================================--class LogicGraph(AutoGraph[LogicNode, LogicRelation]):- """- 用于分析推理、论证和因果链的模板。-- 该模板旨在映射分析报告、科学论文或辩论记录的逻辑结构。它捕捉主张、证据以及它们之间的逻辑链接(支持/反驳)。-- 示例:- >>> from langchain_openai import ChatOpenAI, OpenAIEmbeddings- >>> llm = ChatOpenAI(model="gpt-4o")- >>> embedder = OpenAIEmbeddings()- >>> # 初始化模板- >>> lg = LogicGraph(llm_client=llm, embedder=embedder)- >>> # 从文本中提取逻辑- >>> text = "由于碳含量上升,气候正在变暖。"- >>> lg.feed_text(text)- >>> print(lg.edges) # 输出显示:碳含量上升 --(支持)--> 气候正在变暖- """- def __init__(- self,- llm_client: BaseChatModel,- embedder: Embeddings,- *,- extraction_mode: str = "one_stage",- chunk_size: int = 2048,- chunk_overlap: int = 256,- max_workers: int = 10,- verbose: bool = False,- **kwargs: Any- ):- """- 初始化 LogicGraph 模板。-- Args:- llm_client: 用于提取的语言模型客户端。- embedder: 用于逻辑点去重和索引的嵌入模型。- extraction_mode: 提取策略:- - "one_stage": 同时提取节点和边(速度更快)。- - "two_stage": 先提取节点,再提取边(准确度更高)。- chunk_size: 每个文本块的最大字符数。- chunk_overlap: 文本块之间的重叠字符数。- max_workers: 并行处理的最大线程数。- verbose: 如果为 True,则打印详细的进度日志。- **kwargs: 传给 AutoGraph 构造函数的其他参数。- """- super().__init__(- node_schema=LogicNode,- edge_schema=LogicRelation,- node_key_extractor=lambda x: x.statement.strip(),- edge_key_extractor=lambda x: f"{x.source.strip()}--({x.inference.lower()})-->{x.target.strip()}",- nodes_in_edge_extractor=lambda x: (x.source.strip(), x.target.strip()),- llm_client=llm_client,- embedder=embedder,- extraction_mode=extraction_mode,- chunk_size=chunk_size,- chunk_overlap=chunk_overlap,- max_workers=max_workers,- verbose=verbose,- prompt=_PROMPT,- prompt_for_node_extraction=_NODE_PROMPT,- prompt_for_edge_extraction=_EDGE_PROMPT,- **kwargs- )- def show(- self,- *,- top_k_nodes_for_search: int = 3,- top_k_edges_for_search: int = 3,- top_k_nodes_for_chat: int = 3,- top_k_edges_for_chat: int = 3,- ) -> None:- """- Visualize the graph using OntoSight.-- Args:- top_k_nodes_for_search (int): Number of nodes to retrieve for search context. Default 3.- top_k_edges_for_search (int): Number of edges to retrieve for search context. Default 3.- top_k_nodes_for_chat (int): Number of nodes to retrieve for chat context. Default 3.- top_k_edges_for_chat (int): Number of edges to retrieve for chat context. Default 3.- """- def node_label_extractor(node: LogicNode) -> str:- return f"{node.statement}"-- def edge_label_extractor(edge: LogicRelation) -> str:- return f"{edge.inference}"-- super().show(- node_label_extractor=node_label_extractor,- edge_label_extractor=edge_label_extractor,- top_k_nodes_for_search=top_k_nodes_for_search,- top_k_edges_for_search=top_k_edges_for_search,- top_k_nodes_for_chat=top_k_nodes_for_chat,- top_k_edges_for_chat=top_k_edges_for_chat,- )diff --git a/hyperextract/templates/zh/general/operational_procedure.py b/hyperextract/templates/zh/general/operational_procedure.pynew file mode 100644index 0000000..adff52a--- /dev/null+++ b/hyperextract/templates/zh/general/operational_procedure.py@@ -0,0 +1,156 @@+"""执行程序流程图 - 提取规章中规定的申报、审批或操作的具体先后步骤。++适用于操作导引、SOP 流程可视化等。+"""++from typing import Any+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoGraph+++class ProcedureStep(BaseModel):+ """流程步骤节点"""+ stepId: str = Field(description="步骤编号,如步骤1、步骤2")+ name: str = Field(description="步骤名称")+ description: str = Field(description="步骤详细描述")+ role: str = Field(description="执行角色", default="")+ inputRequired: str = Field(description="所需输入/材料", default="")+ outputResult: str = Field(description="输出/结果", default="")+++class ProcedureTransition(BaseModel):+ """流程转换边"""+ source: str = Field(description="源步骤编号")+ target: str = Field(description="目标步骤编号")+ condition: str = Field(description="转换条件", default="")+ details: str = Field(description="详细说明", default="")+++_PROMPT = """你是一位专业的流程分析专家。请从文本中提取规章中规定的申报、审批或操作的具体先后步骤,构建执行程序流程图。++### 节点提取规则+1. 提取所有流程步骤+2. 为每个步骤分配编号(如步骤1、步骤2)+3. 为每个步骤添加名称和详细描述+4. 记录执行角色(如有)+5. 记录所需输入或材料(如有)+6. 记录输出或结果(如有)++### 边提取规则+1. 仅从提取的步骤中创建转换边+2. 记录步骤之间的先后关系+3. 记录转换条件(如有)+4. 记录详细说明(如有)++### 约束条件+- 确保流程步骤的先后顺序准确+- 保持客观准确,不添加文本中没有的信息++### 源文本:+"""++_NODE_PROMPT = """你是一位专业的流程步骤识别专家。请从文本中提取所有流程步骤作为节点。++### 提取规则+1. 提取所有流程步骤+2. 为每个步骤分配编号(如步骤1、步骤2)+3. 为每个步骤添加名称和详细描述+4. 记录执行角色(如有)+5. 记录所需输入或材料(如有)+6. 记录输出或结果(如有)++### 源文本:+"""++_EDGE_PROMPT = """你是一位专业的流程转换识别专家。请从给定步骤列表中提取步骤之间的先后关系。++### 约束条件+1. 仅从下方已知步骤列表中提取边+2. 不要创建未列出的步骤++"""+++class OperationalProcedure(AutoGraph[ProcedureStep, ProcedureTransition]):+ """+ 适用文档: 操作手册、SOP、合规指南、审批流程++ 功能介绍:+ 提取规章中规定的申报、审批或操作的具体先后步骤。适用于操作导引、SOP 流程可视化等。++ Example:+ >>> template = OperationalProcedure(llm_client=llm, embedder=embedder)+ >>> template.feed_text("宇宙第一摸鱼公司请假审批流程...")+ >>> template.show()+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ extraction_mode: str = "two_stage",+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化执行程序流程图模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ extraction_mode: 提取模式,可选 "one_stage"(同时提取节点和边)+ 或 "two_stage"(先提取节点,再提取边),默认为 "two_stage"+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ node_schema=ProcedureStep,+ edge_schema=ProcedureTransition,+ node_key_extractor=lambda x: x.stepId,+ edge_key_extractor=lambda x: f"{x.source}|{x.target}",+ nodes_in_edge_extractor=lambda x: (x.source, x.target),+ llm_client=llm_client,+ embedder=embedder,+ extraction_mode=extraction_mode,+ max_workers=max_workers,+ verbose=verbose,+ prompt=_PROMPT,+ prompt_for_node_extraction=_NODE_PROMPT,+ prompt_for_edge_extraction=_EDGE_PROMPT,+ **kwargs,+ )++ def show(+ self,+ *,+ top_k_for_search: int = 3,+ top_k_for_chat: int = 3,+ ):+ """+ 展示执行程序流程图。++ Args:+ top_k_for_search: 语义检索返回的节点/边数量,默认为 3+ top_k_for_chat: 问答使用的节点/边数量,默认为 3+ """+ def nodeLabelExtractor(node: ProcedureStep) -> str:+ return f"{node.stepId}: {node.name}"++ def edgeLabelExtractor(edge: ProcedureTransition) -> str:+ if edge.condition:+ return edge.condition+ return "→"++ super().show(+ node_label_extractor=nodeLabelExtractor,+ edge_label_extractor=edgeLabelExtractor,+ top_k_nodes_for_search=top_k_for_search,+ top_k_edges_for_search=top_k_for_search,+ top_k_nodes_for_chat=top_k_for_chat,+ top_k_edges_for_chat=top_k_for_chat,+ )diff --git a/hyperextract/templates/zh/general/penalty_mapping.py b/hyperextract/templates/zh/general/penalty_mapping.pynew file mode 100644index 0000000..c409f05--- /dev/null+++ b/hyperextract/templates/zh/general/penalty_mapping.py@@ -0,0 +1,145 @@+"""违规处罚因果链 - 描述从“违规行为”到“处理程序”再到“最终结果”的演变路径。++适用于风险溯源、处罚逻辑分析等。+"""++from typing import Any+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoGraph+++class PenaltyNode(BaseModel):+ """处罚因果节点"""+ name: str = Field(description="节点名称")+ type: str = Field(description="节点类型:违规行为、处理程序、处罚结果、其他")+ description: str = Field(description="详细描述")+++class PenaltyPath(BaseModel):+ """处罚因果路径边"""+ source: str = Field(description="源节点名称")+ target: str = Field(description="目标节点名称")+ relation: str = Field(description="关系类型:导致、触发、执行、产生、其他")+ details: str = Field(description="详细说明", default="")+++_PROMPT = """你是一位专业的处罚逻辑分析专家。请从文本中提取从“违规行为”到“处理程序”再到“最终结果”的演变路径,构建违规处罚因果链。++### 节点提取规则+1. 提取所有关键节点:违规行为、处理程序、处罚结果等+2. 为每个节点指定类型:违规行为、处理程序、处罚结果、其他+3. 为每个节点添加详细描述++### 边提取规则+1. 仅从提取的节点中创建因果路径边+2. 记录节点之间的因果关系+3. 关系类型包括:导致、触发、执行、产生、其他+4. 添加详细说明(如有)++### 约束条件+- 确保因果关系的逻辑顺序正确+- 保持客观准确,不添加文本中没有的信息++### 源文本:+"""++_NODE_PROMPT = """你是一位专业的处罚节点识别专家。请从文本中提取所有关键节点。++### 提取规则+1. 提取所有关键节点:违规行为、处理程序、处罚结果等+2. 为每个节点指定类型:违规行为、处理程序、处罚结果、其他+3. 为每个节点添加详细描述++### 源文本:+"""++_EDGE_PROMPT = """你是一位专业的处罚因果关系识别专家。请从给定节点列表中提取节点之间的因果关系。++### 约束条件+1. 仅从下方已知节点列表中提取边+2. 不要创建未列出的节点++"""+++class PenaltyMapping(AutoGraph[PenaltyNode, PenaltyPath]):+ """+ 适用文档: 公司内部管理制度、行政法规、合规指南、处罚案例++ 功能介绍:+ 描述从“违规行为”到“处理程序”再到“最终结果”的演变路径。适用于风险溯源、处罚逻辑分析等。++ Example:+ >>> template = PenaltyMapping(llm_client=llm, embedder=embedder)+ >>> template.feed_text("宇宙第一摸鱼公司员工处罚条例...")+ >>> template.show()+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ extraction_mode: str = "two_stage",+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化违规处罚因果链模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ extraction_mode: 提取模式,可选 "one_stage"(同时提取节点和边)+ 或 "two_stage"(先提取节点,再提取边),默认为 "two_stage"+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ node_schema=PenaltyNode,+ edge_schema=PenaltyPath,+ node_key_extractor=lambda x: x.name,+ edge_key_extractor=lambda x: f"{x.source}|{x.relation}|{x.target}",+ nodes_in_edge_extractor=lambda x: (x.source, x.target),+ llm_client=llm_client,+ embedder=embedder,+ extraction_mode=extraction_mode,+ max_workers=max_workers,+ verbose=verbose,+ prompt=_PROMPT,+ prompt_for_node_extraction=_NODE_PROMPT,+ prompt_for_edge_extraction=_EDGE_PROMPT,+ **kwargs,+ )++ def show(+ self,+ *,+ top_k_for_search: int = 3,+ top_k_for_chat: int = 3,+ ):+ """+ 展示违规处罚因果链。++ Args:+ top_k_for_search: 语义检索返回的节点/边数量,默认为 3+ top_k_for_chat: 问答使用的节点/边数量,默认为 3+ """+ def nodeLabelExtractor(node: PenaltyNode) -> str:+ return f"{node.name} ({node.type})"++ def edgeLabelExtractor(edge: PenaltyPath) -> str:+ return edge.relation++ super().show(+ node_label_extractor=nodeLabelExtractor,+ edge_label_extractor=edgeLabelExtractor,+ top_k_nodes_for_search=top_k_for_search,+ top_k_edges_for_search=top_k_for_search,+ top_k_nodes_for_chat=top_k_for_chat,+ top_k_edges_for_chat=top_k_for_chat,+ )diff --git a/hyperextract/templates/zh/general/penalty_registry.py b/hyperextract/templates/zh/general/penalty_registry.pynew file mode 100644index 0000000..d6c88bf--- /dev/null+++ b/hyperextract/templates/zh/general/penalty_registry.py@@ -0,0 +1,103 @@+"""违规处罚对照表 - 去重汇总特定的违规行为及其对应的后果,形成清晰的处罚台账。++适用于内部风控、合规检查等。+"""++from typing import Any+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoSet+++class PenaltyEntry(BaseModel):+ """违规处罚条目"""+ violation: str = Field(description="违规行为描述")+ severity: str = Field(description="严重程度:轻微、一般、严重、特别严重")+ penalty: str = Field(description="处罚措施")+ applicableClause: str = Field(description="适用条款", default="")+ notes: str = Field(description="备注说明", default="")+++_PROMPT = """你是一位专业的合规分析专家。请从文本中提取所有违规行为及其对应的处罚措施,形成违规处罚对照表。++### 提取规则+1. 提取所有违规行为及其对应的处罚措施+2. 为每条违规行为指定严重程度:轻微、一般、严重、特别严重+3. 保持违规行为和处罚措施的准确性+4. 记录适用的条款(如有)+5. 添加备注说明(如有)++### 约束条件+- 去重:相同的违规行为和处罚措施组合只保留一条+- 保持客观准确,不添加文本中没有的信息++### 源文本:+"""+++class PenaltyRegistry(AutoSet[PenaltyEntry]):+ """+ 适用文档: 公司内部管理制度、行政法规、合规指南++ 功能介绍:+ 去重汇总特定的违规行为及其对应的后果,形成清晰的处罚台账。适用于内部风控、合规检查等。++ Example:+ >>> template = PenaltyRegistry(llm_client=llm, embedder=embedder)+ >>> template.feed_text("宇宙第一摸鱼公司员工考勤管理制度...")+ >>> for entry in template:+ ... print(f"{entry.violation} -> {entry.penalty}")+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化违规处罚对照表模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ item_schema=PenaltyEntry,+ key_extractor=lambda x: f"{x.violation}_{x.penalty}",+ llm_client=llm_client,+ embedder=embedder,+ prompt=_PROMPT,+ max_workers=max_workers,+ verbose=verbose,+ **kwargs,+ )++ def show(+ self,+ *,+ top_k_for_search: int = 3,+ top_k_for_chat: int = 3,+ ):+ """+ 展示违规处罚对照表。++ Args:+ top_k_for_search: 语义检索返回的条目数量,默认为 3+ top_k_for_chat: 问答使用的条目数量,默认为 3+ """+ def itemLabelExtractor(item: PenaltyEntry) -> str:+ return f"{item.violation} ({item.severity})"++ super().show(+ item_label_extractor=itemLabelExtractor,+ top_k_for_search=top_k_for_search,+ top_k_for_chat=top_k_for_chat,+ )diff --git a/hyperextract/templates/zh/general/personal_profile.py b/hyperextract/templates/zh/general/personal_profile.pynew file mode 100644index 0000000..a26f91f--- /dev/null+++ b/hyperextract/templates/zh/general/personal_profile.py@@ -0,0 +1,93 @@+"""个人档案 - 聚合人物的静态属性(生卒年、学历、核心身份)。++适用于简历、人物简介、讣告摘要等。+"""++from typing import Any, Optional, List+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoModel+++class PersonalInfo(BaseModel):+ """个人档案信息"""+ name: str = Field(description="姓名")+ gender: Optional[str] = Field(description="性别", default=None)+ birthDate: Optional[str] = Field(description="出生日期,格式为年-月-日或年份", default=None)+ deathDate: Optional[str] = Field(description="逝世日期,格式为年-月-日或年份", default=None)+ nationality: Optional[str] = Field(description="国籍", default=None)+ birthPlace: Optional[str] = Field(description="出生地", default=None)+ education: List[str] = Field(description="教育经历", default_factory=list)+ occupations: List[str] = Field(description="职业/身份", default_factory=list)+ coreIdentity: List[str] = Field(description="核心身份/标签", default_factory=list)+ majorAchievements: List[str] = Field(description="主要成就", default_factory=list)+ affiliations: List[str] = Field(description="所属组织/机构", default_factory=list)+ summary: str = Field(description="个人简介", default="")+++_PROMPT = """你是一位专业的人物档案编辑。请从文本中提取该人物的静态属性信息,构建个人档案。++### 提取规则+1. 提取姓名、性别、出生日期、逝世日期、国籍、出生地等基本信息+2. 提取教育经历+3. 提取职业或身份信息+4. 提取核心身份标签+5. 提取主要成就+6. 提取所属组织或机构+7. 撰写 100-200 字的个人简介++### 时间格式要求+所有日期信息统一转换为「年-月-日」格式(如 429-01-01)或年份(如 429)。++### 约束条件+- 只提取文本中明确提及的信息,不添加额外内容+- 保持客观准确+- 若信息缺失时留空,不要编造++### 源文本:+"""+++class PersonalProfile(AutoModel[PersonalInfo]):+ """+ 适用文档: 简历、人物简介、讣告摘要、维基百科人物条目++ 功能介绍:+ 聚合人物的静态属性(生卒年、学历、核心身份)。适用于简历、人物简介、讣告摘要等。++ Example:+ >>> template = PersonalProfile(llm_client=llm, embedder=embedder)+ >>> template.feed_text("祖冲之(429年-500年),字文远,范阳遒县人...")+ >>> print(template.data.name)+ >>> print(template.data.birthDate)+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化个人档案模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ data_schema=PersonalInfo,+ llm_client=llm_client,+ embedder=embedder,+ prompt=_PROMPT,+ max_workers=max_workers,+ verbose=verbose,+ **kwargs,+ )diff --git a/hyperextract/templates/zh/general/regulation_profile.py b/hyperextract/templates/zh/general/regulation_profile.pynew file mode 100644index 0000000..ae4ecd5--- /dev/null+++ b/hyperextract/templates/zh/general/regulation_profile.py@@ -0,0 +1,91 @@+"""规章元数据快照 - 提取制度的名称、版本、适用范围、生效日期及核心宗旨。++适用于制度概览、版本管理等。+"""++from typing import Any, Optional, List+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoModel+++class RegulationInfo(BaseModel):+ """规章元数据信息"""+ title: str = Field(description="规章名称")+ version: Optional[str] = Field(description="版本号", default=None)+ issuer: Optional[str] = Field(description="发布机构", default=None)+ issueDate: Optional[str] = Field(description="发布日期", default=None)+ effectiveDate: Optional[str] = Field(description="生效日期", default=None)+ expiryDate: Optional[str] = Field(description="失效日期", default=None)+ scope: List[str] = Field(description="适用范围", default_factory=list)+ targetAudience: List[str] = Field(description="适用对象", default_factory=list)+ corePurpose: str = Field(description="核心宗旨/目的", default="")+ keywords: List[str] = Field(description="关键词/标签", default_factory=list)+ relatedRegulations: List[str] = Field(description="关联规章", default_factory=list)+++_PROMPT = """你是一位专业的规章制度分析专家。请从文本中提取该规章制度的元数据信息,构建规章元数据快照。++### 提取规则+1. 提取规章的完整名称+2. 提取版本号(如有)+3. 提取发布机构+4. 提取发布日期、生效日期、失效日期(如有)+5. 提取适用范围+6. 提取适用对象+7. 提取核心宗旨或目的(100-200字)+8. 提取关键词或标签+9. 提取关联的其他规章++### 约束条件+- 只提取文本中明确提及的信息,不添加额外内容+- 保持客观准确+- 信息缺失时留空,不要编造++### 源文本:+"""+++class RegulationProfile(AutoModel[RegulationInfo]):+ """+ 适用文档: 公司内部管理制度、行政法规、操作手册、合规指南++ 功能介绍:+ 提取制度的名称、版本、适用范围、生效日期及核心宗旨。适用于制度概览、版本管理等。++ Example:+ >>> template = RegulationProfile(llm_client=llm, embedder=embedder)+ >>> template.feed_text("宇宙第一摸鱼公司员工考勤管理制度...")+ >>> print(template.data.title)+ >>> print(template.data.effectiveDate)+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化规章元数据快照模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ data_schema=RegulationInfo,+ llm_client=llm_client,+ embedder=embedder,+ prompt=_PROMPT,+ max_workers=max_workers,+ verbose=verbose,+ **kwargs,+ )diff --git a/hyperextract/templates/zh/general/social_network.py b/hyperextract/templates/zh/general/social_network.pynew file mode 100644index 0000000..107cc4d--- /dev/null+++ b/hyperextract/templates/zh/general/social_network.py@@ -0,0 +1,169 @@+"""社交网络图 - 专注于提取人际关系、互动与组织隶属。++适用于传记分析、人物设定研究等。+"""++from typing import Any+from pydantic import BaseModel, Field+from langchain_core.language_models import BaseChatModel+from langchain_core.embeddings import Embeddings+from hyperextract.types import AutoGraph+++class PersonNode(BaseModel):+ """人物/组织节点"""+ name: str = Field(description="名称")+ type: str = Field(description="节点类型:人物、组织、机构、其他")+ description: str = Field(description="简要描述", default="")+ role: str = Field(description="角色/身份", default="")+++class SocialRelation(BaseModel):+ """社会关系边"""+ source: str = Field(description="源节点")+ target: str = Field(description="目标节点")+ relationType: str = Field(description="关系类型:亲属、朋友、同事、师生、上下级、合作、竞争、隶属、其他")+ details: str = Field(description="关系详细说明", default="")+++_PROMPT = """你是一位专业的社会关系分析专家。请从文本中提取人物、组织及其相互关系,构建社交网络图。++### 节点提取规则+1. 提取所有人物、组织、机构等+2. 为每个节点指定类型:人物、组织、机构、其他+3. 为每个节点添加简要描述+4. 为每个节点标注角色或身份++### 关系提取规则+1. 仅从提取的节点中创建边+2. 关系类型包括:+ - 亲属:家庭关系(父母、子女、配偶、兄弟姐妹等)+ - 朋友:朋友关系+ - 同事:工作伙伴关系+ - 师生:教育关系+ - 上下级:管理关系+ - 合作:协作关系+ - 竞争:竞争关系+ - 隶属:组织隶属关系+ - 其他:其他关系+3. 每条边必须连接已提取的节点++### 约束条件+- 不要创建未在文本中提及的节点或关系+- 保持客观准确,不添加文本中没有的信息++### 源文本:+"""++_NODE_PROMPT = """你是一位专业的人物和组织识别专家。请从文本中提取所有人物、组织作为节点。++### 提取规则+1. 提取所有人物、组织、机构等+2. 为每个节点指定类型:人物、组织、机构、其他+3. 为每个节点添加简要描述+4. 为每个节点标注角色或身份++### 源文本:+"""++_EDGE_PROMPT = """你是一位专业的社会关系提取专家。请从给定节点列表中提取节点之间的相互关系。++### 关系类型说明+- 亲属:家庭关系(父母、子女、配偶、兄弟姐妹等)+- 朋友:朋友关系+- 同事:工作伙伴关系+- 师生:教育关系+- 上下级:管理关系+- 合作:协作关系+- 竞争:竞争关系+- 隶属:组织隶属关系+- 其他:其他关系++### 约束条件+1. 仅从下方已知节点列表中提取边+2. 不要创建未列出的节点++"""+++class SocialNetwork(AutoGraph[PersonNode, SocialRelation]):+ """+ 适用文档: 人物传记、回忆录、小说、人物设定文档++ 功能介绍:+ 专注于提取人际关系、互动与组织隶属。适用于传记分析、人物设定研究等。++ Example:+ >>> template = SocialNetwork(llm_client=llm, embedder=embedder)+ >>> template.feed_text("祖冲之师从何承天,与戴法兴有过辩论...")+ >>> template.show()+ """++ def __init__(+ self,+ llm_client: BaseChatModel,+ embedder: Embeddings,+ *,+ extraction_mode: str = "two_stage",+ max_workers: int = 10,+ verbose: bool = False,+ **kwargs: Any,+ ):+ """+ 初始化社交网络图模板。++ Args:+ llm_client: LLM 客户端,用于知识提取+ embedder: 嵌入模型,用于语义检索+ extraction_mode: 提取模式,可选 "one_stage"(同时提取节点和边)+ 或 "two_stage"(先提取节点,再提取边),默认为 "two_stage"+ max_workers: 最大工作线程数,默认为 10+ verbose: 是否输出详细日志,默认为 False+ **kwargs: 其他技术参数,传递给基类+ """+ super().__init__(+ node_schema=PersonNode,+ edge_schema=SocialRelation,+ node_key_extractor=lambda x: x.name,+ edge_key_extractor=lambda x: f"{x.source}|{x.relationType}|{x.target}",+ nodes_in_edge_extractor=lambda x: (x.source, x.target),+ llm_client=llm_client,+ embedder=embedder,+ extraction_mode=extraction_mode,+ max_workers=max_workers,+ verbose=verbose,+ prompt=_PROMPT,+ prompt_for_node_extraction=_NODE_PROMPT,+ prompt_for_edge_extraction=_EDGE_PROMPT,+ **kwargs,+ )++ def show(+ self,+ *,+ top_k_for_search: int = 3,+ top_k_for_chat: int = 3,+ ):+ """+ 展示社交网络图。++ Args:+ top_k_for_search: 语义检索返回的节点/边数量,默认为 3+ top_k_for_chat: 问答使用的节点/边数量,默认为 3+ """+ def node_label_extractor(node: PersonNode) -> str:+ if node.role:+ return f"{node.name} ({node.role})"+ return f"{node.name} ({node.type})"++ def edge_label_extractor(edge: SocialRelation) -> str:+ return edge.relationType++ super().show(+ node_label_extractor=node_label_extractor,+ edge_label_extractor=edge_label_extractor,+ top_k_nodes_for_search=top_k_for_search,+ top_k_edges_for_search=top_k_for_search,+ top_k_nodes_for_chat=top_k_for_chat,+ top_k_edges_for_chat=top_k_for_chat,+ )diff --git a/uv.lock b/uv.lockindex f93dc49..3694c41 100644--- a/uv.lock+++ b/uv.lock@@ -10,7 +10,7 @@ resolution-markers = [[[package]]name = "aiohappyeyeballs"version = "2.6.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/26/30/f84a107a9c4331c14b2b586036f40965c128aa4fee4dda5d3d51cb14ad54/aiohappyeyeballs-2.6.1.tar.gz", hash = "sha256:c3f9d0113123803ccadfdf3f0faa505bc78e6a72d1cc4806cbd719826e943558", size = 22760, upload-time = "2025-03-12T01:42:48.764Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/0f/15/5bf3b99495fb160b63f95972b81750f18f7f4e02ad051373b669d17d44f2/aiohappyeyeballs-2.6.1-py3-none-any.whl", hash = "sha256:f349ba8f4b75cb25c99c5c2d84e997e485204d2902a9597802b0371f09331fb8", size = 15265, upload-time = "2025-03-12T01:42:47.083Z" },@@ -19,7 +19,7 @@ wheels = [[[package]]name = "aiohttp"version = "3.13.3"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "aiohappyeyeballs" },{ name = "aiosignal" },@@ -121,7 +121,7 @@ wheels = [[[package]]name = "aiosignal"version = "1.4.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "frozenlist" },{ name = "typing-extensions", marker = "python_full_version < '3.13'" },@@ -134,7 +134,7 @@ wheels = [[[package]]name = "annotated-doc"version = "0.0.4"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz", hash = "sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4", size = 7288, upload-time = "2025-11-10T22:07:42.062Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/1e/d3/26bf1008eb3d2daa8ef4cacc7f3bfdc11818d111f7e2d0201bc6e3b49d45/annotated_doc-0.0.4-py3-none-any.whl", hash = "sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320", size = 5303, upload-time = "2025-11-10T22:07:40.673Z" },@@ -143,7 +143,7 @@ wheels = [[[package]]name = "annotated-types"version = "0.7.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" },@@ -152,7 +152,7 @@ wheels = [[[package]]name = "anyio"version = "4.12.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "idna" },{ name = "typing-extensions", marker = "python_full_version < '3.13'" },@@ -165,7 +165,7 @@ wheels = [[[package]]name = "attrs"version = "25.4.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/6b/5c/685e6633917e101e5dcb62b9dd76946cbb57c26e133bae9e0cd36033c0a9/attrs-25.4.0.tar.gz", hash = "sha256:16d5969b87f0859ef33a48b35d55ac1be6e42ae49d5e853b597db70c35c57e11", size = 934251, upload-time = "2025-10-06T13:54:44.725Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/3a/2a/7cc015f5b9f5db42b7d48157e23356022889fc354a2813c15934b7cb5c0e/attrs-25.4.0-py3-none-any.whl", hash = "sha256:adcf7e2a1fb3b36ac48d97835bb6d8ade15b8dcce26aba8bf1d14847b57a3373", size = 67615, upload-time = "2025-10-06T13:54:43.17Z" },@@ -174,7 +174,7 @@ wheels = [[[package]]name = "babel"version = "2.17.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/7d/6b/d52e42361e1aa00709585ecc30b3f9684b3ab62530771402248b1b1d6240/babel-2.17.0.tar.gz", hash = "sha256:0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d", size = 9951852, upload-time = "2025-02-01T15:17:41.026Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b7/b8/3fe70c75fe32afc4bb507f75563d39bc5642255d1d94f1f23604725780bf/babel-2.17.0-py3-none-any.whl", hash = "sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2", size = 10182537, upload-time = "2025-02-01T15:17:37.39Z" },@@ -183,7 +183,7 @@ wheels = [[[package]]name = "backrefs"version = "6.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/86/e3/bb3a439d5cb255c4774724810ad8073830fac9c9dee123555820c1bcc806/backrefs-6.1.tar.gz", hash = "sha256:3bba1749aafe1db9b915f00e0dd166cba613b6f788ffd63060ac3485dc9be231", size = 7011962, upload-time = "2025-11-15T14:52:08.323Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/3b/ee/c216d52f58ea75b5e1841022bbae24438b19834a29b163cb32aa3a2a7c6e/backrefs-6.1-py310-none-any.whl", hash = "sha256:2a2ccb96302337ce61ee4717ceacfbf26ba4efb1d55af86564b8bbaeda39cac1", size = 381059, upload-time = "2025-11-15T14:51:59.758Z" },@@ -197,7 +197,7 @@ wheels = [[[package]]name = "certifi"version = "2026.1.4"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e0/2d/a891ca51311197f6ad14a7ef42e2399f36cf2f9bd44752b3dc4eab60fdc5/certifi-2026.1.4.tar.gz", hash = "sha256:ac726dd470482006e014ad384921ed6438c457018f4b3d204aea4281258b2120", size = 154268, upload-time = "2026-01-04T02:42:41.825Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e6/ad/3cc14f097111b4de0040c83a525973216457bbeeb63739ef1ed275c1c021/certifi-2026.1.4-py3-none-any.whl", hash = "sha256:9943707519e4add1115f44c2bc244f782c0249876bf51b6599fee1ffbedd685c", size = 152900, upload-time = "2026-01-04T02:42:40.15Z" },@@ -206,7 +206,7 @@ wheels = [[[package]]name = "charset-normalizer"version = "3.4.4"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/13/69/33ddede1939fdd074bce5434295f38fae7136463422fe4fd3e0e89b98062/charset_normalizer-3.4.4.tar.gz", hash = "sha256:94537985111c35f28720e43603b8e7b43a6ecfb2ce1d3058bbe955b73404e21a", size = 129418, upload-time = "2025-10-14T04:42:32.879Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/ed/27/c6491ff4954e58a10f69ad90aca8a1b6fe9c5d3c6f380907af3c37435b59/charset_normalizer-3.4.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e1fcf0720908f200cd21aa4e6750a48ff6ce4afe7ff5a79a90d5ed8a08296f8", size = 206988, upload-time = "2025-10-14T04:40:33.79Z" },@@ -279,7 +279,7 @@ wheels = [[[package]]name = "click"version = "8.3.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "colorama", marker = "sys_platform == 'win32'" },]@@ -291,7 +291,7 @@ wheels = [[[package]]name = "colorama"version = "0.4.6"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },@@ -300,7 +300,7 @@ wheels = [[[package]]name = "dataclasses-json"version = "0.6.7"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "marshmallow" },{ name = "typing-inspect" },@@ -313,7 +313,7 @@ wheels = [[[package]]name = "distro"version = "1.9.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/fc/f8/98eea607f65de6527f8a2e8885fc8015d3e6f5775df186e443e0964a11c3/distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed", size = 60722, upload-time = "2023-12-24T09:54:32.31Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2", size = 20277, upload-time = "2023-12-24T09:54:30.421Z" },@@ -322,7 +322,7 @@ wheels = [[[package]]name = "faiss-cpu"version = "1.13.2"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "numpy" },{ name = "packaging" },@@ -347,7 +347,7 @@ wheels = [[[package]]name = "fastapi"version = "0.128.4"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "annotated-doc" },{ name = "pydantic" },@@ -363,7 +363,7 @@ wheels = [[[package]]name = "filelock"version = "3.20.3"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/1d/65/ce7f1b70157833bf3cb851b556a37d4547ceafc158aa9b34b36782f23696/filelock-3.20.3.tar.gz", hash = "sha256:18c57ee915c7ec61cff0ecf7f0f869936c7c30191bb0cf406f1341778d0834e1", size = 19485, upload-time = "2026-01-09T17:55:05.421Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b5/36/7fb70f04bf00bc646cd5bb45aa9eddb15e19437a28b8fb2b4a5249fac770/filelock-3.20.3-py3-none-any.whl", hash = "sha256:4b0dda527ee31078689fc205ec4f1c1bf7d56cf88b6dc9426c4f230e46c2dce1", size = 16701, upload-time = "2026-01-09T17:55:04.334Z" },@@ -372,7 +372,7 @@ wheels = [[[package]]name = "frozendict"version = "2.4.7"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/90/b2/2a3d1374b7780999d3184e171e25439a8358c47b481f68be883c14086b4c/frozendict-2.4.7.tar.gz", hash = "sha256:e478fb2a1391a56c8a6e10cc97c4a9002b410ecd1ac28c18d780661762e271bd", size = 317082, upload-time = "2025-11-11T22:40:14.251Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/38/74/f94141b38a51a553efef7f510fc213894161ae49b88bffd037f8d2a7cb2f/frozendict-2.4.7-py3-none-any.whl", hash = "sha256:972af65924ea25cf5b4d9326d549e69a9a4918d8a76a9d3a7cd174d98b237550", size = 16264, upload-time = "2025-11-11T22:40:12.836Z" },@@ -381,7 +381,7 @@ wheels = [[[package]]name = "frozenlist"version = "1.8.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/2d/f5/c831fac6cc817d26fd54c7eaccd04ef7e0288806943f7cc5bbf69f3ac1f0/frozenlist-1.8.0.tar.gz", hash = "sha256:3ede829ed8d842f6cd48fc7081d7a41001a56f1f38603f9d49bf3020d59a31ad", size = 45875, upload-time = "2025-10-06T05:38:17.865Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/bc/03/077f869d540370db12165c0aa51640a873fb661d8b315d1d4d67b284d7ac/frozenlist-1.8.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:09474e9831bc2b2199fad6da3c14c7b0fbdd377cce9d3d77131be28906cb7d84", size = 86912, upload-time = "2025-10-06T05:35:45.98Z" },@@ -486,7 +486,7 @@ wheels = [[[package]]name = "fsspec"version = "2026.1.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/d5/7d/5df2650c57d47c57232af5ef4b4fdbff182070421e405e0d62c6cdbfaa87/fsspec-2026.1.0.tar.gz", hash = "sha256:e987cb0496a0d81bba3a9d1cee62922fb395e7d4c3b575e57f547953334fe07b", size = 310496, upload-time = "2026-01-09T15:21:35.562Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/01/c9/97cc5aae1648dcb851958a3ddf73ccd7dbe5650d95203ecb4d7720b4cdbf/fsspec-2026.1.0-py3-none-any.whl", hash = "sha256:cb76aa913c2285a3b49bdd5fc55b1d7c708d7208126b60f2eb8194fe1b4cbdcc", size = 201838, upload-time = "2026-01-09T15:21:34.041Z" },@@ -495,7 +495,7 @@ wheels = [[[package]]name = "ghp-import"version = "2.1.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "python-dateutil" },]@@ -507,13 +507,12 @@ wheels = [[[package]]name = "greenlet"version = "3.3.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/c7/e5/40dbda2736893e3e53d25838e0f19a2b417dfc122b9989c91918db30b5d3/greenlet-3.3.0.tar.gz", hash = "sha256:a82bb225a4e9e4d653dd2fb7b8b2d36e4fb25bc0165422a11e48b88e9e6f78fb", size = 190651, upload-time = "2025-12-04T14:49:44.05Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/1f/cb/48e964c452ca2b92175a9b2dca037a553036cb053ba69e284650ce755f13/greenlet-3.3.0-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:e29f3018580e8412d6aaf5641bb7745d38c85228dacf51a73bd4e26ddf2a6a8e", size = 274908, upload-time = "2025-12-04T14:23:26.435Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/28/da/38d7bff4d0277b594ec557f479d65272a893f1f2a716cad91efeb8680953/greenlet-3.3.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a687205fb22794e838f947e2194c0566d3812966b41c78709554aa883183fb62", size = 577113, upload-time = "2025-12-04T14:50:05.493Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/3c/f2/89c5eb0faddc3ff014f1c04467d67dee0d1d334ab81fadbf3744847f8a8a/greenlet-3.3.0-cp311-cp311-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4243050a88ba61842186cb9e63c7dfa677ec146160b0efd73b855a3d9c7fcf32", size = 590338, upload-time = "2025-12-04T14:57:41.136Z" },- { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/80/d7/db0a5085035d05134f8c089643da2b44cc9b80647c39e93129c5ef170d8f/greenlet-3.3.0-cp311-cp311-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:670d0f94cd302d81796e37299bcd04b95d62403883b24225c6b5271466612f45", size = 601098, upload-time = "2025-12-04T15:07:11.898Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/dc/a6/e959a127b630a58e23529972dbc868c107f9d583b5a9f878fb858c46bc1a/greenlet-3.3.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6cb3a8ec3db4a3b0eb8a3c25436c2d49e3505821802074969db017b87bc6a948", size = 590206, upload-time = "2025-12-04T14:26:01.254Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/48/60/29035719feb91798693023608447283b266b12efc576ed013dd9442364bb/greenlet-3.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2de5a0b09eab81fc6a382791b995b1ccf2b172a9fec934747a7a23d2ff291794", size = 1550668, upload-time = "2025-12-04T15:04:22.439Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/0a/5f/783a23754b691bfa86bd72c3033aa107490deac9b2ef190837b860996c9f/greenlet-3.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:4449a736606bd30f27f8e1ff4678ee193bc47f6ca810d705981cfffd6ce0d8c5", size = 1615483, upload-time = "2025-12-04T14:27:28.083Z" },@@ -521,7 +520,6 @@ wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/f8/0a/a3871375c7b9727edaeeea994bfff7c63ff7804c9829c19309ba2e058807/greenlet-3.3.0-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:b01548f6e0b9e9784a2c99c5651e5dc89ffcbe870bc5fb2e5ef864e9cc6b5dcb", size = 276379, upload-time = "2025-12-04T14:23:30.498Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/43/ab/7ebfe34dce8b87be0d11dae91acbf76f7b8246bf9d6b319c741f99fa59c6/greenlet-3.3.0-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:349345b770dc88f81506c6861d22a6ccd422207829d2c854ae2af8025af303e3", size = 597294, upload-time = "2025-12-04T14:50:06.847Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a4/39/f1c8da50024feecd0793dbd5e08f526809b8ab5609224a2da40aad3a7641/greenlet-3.3.0-cp312-cp312-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e8e18ed6995e9e2c0b4ed264d2cf89260ab3ac7e13555b8032b25a74c6d18655", size = 607742, upload-time = "2025-12-04T14:57:42.349Z" },- { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/77/cb/43692bcd5f7a0da6ec0ec6d58ee7cddb606d055ce94a62ac9b1aa481e969/greenlet-3.3.0-cp312-cp312-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c024b1e5696626890038e34f76140ed1daf858e37496d33f2af57f06189e70d7", size = 622297, upload-time = "2025-12-04T15:07:13.552Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/75/b0/6bde0b1011a60782108c01de5913c588cf51a839174538d266de15e4bf4d/greenlet-3.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:047ab3df20ede6a57c35c14bf5200fcf04039d50f908270d3f9a7a82064f543b", size = 609885, upload-time = "2025-12-04T14:26:02.368Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/49/0e/49b46ac39f931f59f987b7cd9f34bfec8ef81d2a1e6e00682f55be5de9f4/greenlet-3.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2d9ad37fc657b1102ec880e637cccf20191581f75c64087a549e66c57e1ceb53", size = 1567424, upload-time = "2025-12-04T15:04:23.757Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/05/f5/49a9ac2dff7f10091935def9165c90236d8f175afb27cbed38fb1d61ab6b/greenlet-3.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:83cd0e36932e0e7f36a64b732a6f60c2fc2df28c351bae79fbaf4f8092fe7614", size = 1636017, upload-time = "2025-12-04T14:27:29.688Z" },@@ -529,7 +527,6 @@ wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/02/2f/28592176381b9ab2cafa12829ba7b472d177f3acc35d8fbcf3673d966fff/greenlet-3.3.0-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:a1e41a81c7e2825822f4e068c48cb2196002362619e2d70b148f20a831c00739", size = 275140, upload-time = "2025-12-04T14:23:01.282Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/2c/80/fbe937bf81e9fca98c981fe499e59a3f45df2a04da0baa5c2be0dca0d329/greenlet-3.3.0-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9f515a47d02da4d30caaa85b69474cec77b7929b2e936ff7fb853d42f4bf8808", size = 599219, upload-time = "2025-12-04T14:50:08.309Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/c2/ff/7c985128f0514271b8268476af89aee6866df5eec04ac17dcfbc676213df/greenlet-3.3.0-cp313-cp313-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7d2d9fd66bfadf230b385fdc90426fcd6eb64db54b40c495b72ac0feb5766c54", size = 610211, upload-time = "2025-12-04T14:57:43.968Z" },- { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/79/07/c47a82d881319ec18a4510bb30463ed6891f2ad2c1901ed5ec23d3de351f/greenlet-3.3.0-cp313-cp313-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:30a6e28487a790417d036088b3bcb3f3ac7d8babaa7d0139edbaddebf3af9492", size = 624311, upload-time = "2025-12-04T15:07:14.697Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/fd/8e/424b8c6e78bd9837d14ff7df01a9829fc883ba2ab4ea787d4f848435f23f/greenlet-3.3.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:087ea5e004437321508a8d6f20efc4cfec5e3c30118e1417ea96ed1d93950527", size = 612833, upload-time = "2025-12-04T14:26:03.669Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b5/ba/56699ff9b7c76ca12f1cdc27a886d0f81f2189c3455ff9f65246780f713d/greenlet-3.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ab97cf74045343f6c60a39913fa59710e4bd26a536ce7ab2397adf8b27e67c39", size = 1567256, upload-time = "2025-12-04T15:04:25.276Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/1e/37/f31136132967982d698c71a281a8901daf1a8fbab935dce7c0cf15f942cc/greenlet-3.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:5375d2e23184629112ca1ea89a53389dddbffcf417dad40125713d88eb5f96e8", size = 1636483, upload-time = "2025-12-04T14:27:30.804Z" },@@ -537,7 +534,6 @@ wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/d7/7c/f0a6d0ede2c7bf092d00bc83ad5bafb7e6ec9b4aab2fbdfa6f134dc73327/greenlet-3.3.0-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:60c2ef0f578afb3c8d92ea07ad327f9a062547137afe91f38408f08aacab667f", size = 275671, upload-time = "2025-12-04T14:23:05.267Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/44/06/dac639ae1a50f5969d82d2e3dd9767d30d6dbdbab0e1a54010c8fe90263c/greenlet-3.3.0-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0a5d554d0712ba1de0a6c94c640f7aeba3f85b3a6e1f2899c11c2c0428da9365", size = 646360, upload-time = "2025-12-04T14:50:10.026Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e0/94/0fb76fe6c5369fba9bf98529ada6f4c3a1adf19e406a47332245ef0eb357/greenlet-3.3.0-cp314-cp314-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:3a898b1e9c5f7307ebbde4102908e6cbfcb9ea16284a3abe15cab996bee8b9b3", size = 658160, upload-time = "2025-12-04T14:57:45.41Z" },- { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/93/79/d2c70cae6e823fac36c3bbc9077962105052b7ef81db2f01ec3b9bf17e2b/greenlet-3.3.0-cp314-cp314-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:dcd2bdbd444ff340e8d6bdf54d2f206ccddbb3ccfdcd3c25bf4afaa7b8f0cf45", size = 671388, upload-time = "2025-12-04T15:07:15.789Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b8/14/bab308fc2c1b5228c3224ec2bf928ce2e4d21d8046c161e44a2012b5203e/greenlet-3.3.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5773edda4dc00e173820722711d043799d3adb4f01731f40619e07ea2750b955", size = 660166, upload-time = "2025-12-04T14:26:05.099Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/4b/d2/91465d39164eaa0085177f61983d80ffe746c5a1860f009811d498e7259c/greenlet-3.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ac0549373982b36d5fd5d30beb8a7a33ee541ff98d2b502714a09f1169f31b55", size = 1615193, upload-time = "2025-12-04T15:04:27.041Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/42/1b/83d110a37044b92423084d52d5d5a3b3a73cafb51b547e6d7366ff62eff1/greenlet-3.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d198d2d977460358c3b3a4dc844f875d1adb33817f0613f663a656f463764ccc", size = 1683653, upload-time = "2025-12-04T14:27:32.366Z" },@@ -545,7 +541,6 @@ wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a0/66/bd6317bc5932accf351fc19f177ffba53712a202f9df10587da8df257c7e/greenlet-3.3.0-cp314-cp314t-macosx_11_0_universal2.whl", hash = "sha256:d6ed6f85fae6cdfdb9ce04c9bf7a08d666cfcfb914e7d006f44f840b46741931", size = 282638, upload-time = "2025-12-04T14:25:20.941Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/30/cf/cc81cb030b40e738d6e69502ccbd0dd1bced0588e958f9e757945de24404/greenlet-3.3.0-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d9125050fcf24554e69c4cacb086b87b3b55dc395a8b3ebe6487b045b2614388", size = 651145, upload-time = "2025-12-04T14:50:11.039Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/9c/ea/1020037b5ecfe95ca7df8d8549959baceb8186031da83d5ecceff8b08cd2/greenlet-3.3.0-cp314-cp314t-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:87e63ccfa13c0a0f6234ed0add552af24cc67dd886731f2261e46e241608bee3", size = 654236, upload-time = "2025-12-04T14:57:47.007Z" },- { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/69/cc/1e4bae2e45ca2fa55299f4e85854606a78ecc37fead20d69322f96000504/greenlet-3.3.0-cp314-cp314t-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2662433acbca297c9153a4023fe2161c8dcfdcc91f10433171cf7e7d94ba2221", size = 662506, upload-time = "2025-12-04T15:07:16.906Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/57/b9/f8025d71a6085c441a7eaff0fd928bbb275a6633773667023d19179fe815/greenlet-3.3.0-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3c6e9b9c1527a78520357de498b0e709fb9e2f49c3a513afd5a249007261911b", size = 653783, upload-time = "2025-12-04T14:26:06.225Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/f6/c7/876a8c7a7485d5d6b5c6821201d542ef28be645aa024cfe1145b35c120c1/greenlet-3.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:286d093f95ec98fdd92fcb955003b8a3d054b4e2cab3e2707a5039e7b50520fd", size = 1614857, upload-time = "2025-12-04T15:04:28.484Z" },{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/4f/dc/041be1dff9f23dac5f48a43323cd0789cb798342011c19a248d9c9335536/greenlet-3.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6c10513330af5b8ae16f023e8ddbfb486ab355d04467c4679c5cfe4659975dd9", size = 1676034, upload-time = "2025-12-04T14:27:33.531Z" },@@ -554,7 +549,7 @@ wheels = [[[package]]name = "griffe"version = "1.15.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "colorama" },]@@ -566,7 +561,7 @@ wheels = [[[package]]name = "h11"version = "0.16.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" },@@ -575,7 +570,7 @@ wheels = [[[package]]name = "hf-xet"version = "1.2.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/5e/6e/0f11bacf08a67f7fb5ee09740f2ca54163863b07b70d579356e9222ce5d8/hf_xet-1.2.0.tar.gz", hash = "sha256:a8c27070ca547293b6890c4bf389f713f80e8c478631432962bb7f4bc0bd7d7f", size = 506020, upload-time = "2025-10-24T19:04:32.129Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/9e/a5/85ef910a0aa034a2abcfadc360ab5ac6f6bc4e9112349bd40ca97551cff0/hf_xet-1.2.0-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:ceeefcd1b7aed4956ae8499e2199607765fbd1c60510752003b6cc0b8413b649", size = 2861870, upload-time = "2025-10-24T19:04:11.422Z" },@@ -604,7 +599,7 @@ wheels = [[[package]]name = "httpcore"version = "1.0.9"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "certifi" },{ name = "h11" },@@ -617,7 +612,7 @@ wheels = [[[package]]name = "httptools"version = "0.7.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b5/46/120a669232c7bdedb9d52d4aeae7e6c7dfe151e99dc70802e2fc7a5e1993/httptools-0.7.1.tar.gz", hash = "sha256:abd72556974f8e7c74a259655924a717a2365b236c882c3f6f8a45fe94703ac9", size = 258961, upload-time = "2025-10-10T03:55:08.559Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/9c/08/17e07e8d89ab8f343c134616d72eebfe03798835058e2ab579dcc8353c06/httptools-0.7.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:474d3b7ab469fefcca3697a10d11a32ee2b9573250206ba1e50d5980910da657", size = 206521, upload-time = "2025-10-10T03:54:31.002Z" },@@ -653,7 +648,7 @@ wheels = [[[package]]name = "httpx"version = "0.28.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "anyio" },{ name = "certifi" },@@ -668,7 +663,7 @@ wheels = [[[package]]name = "httpx-sse"version = "0.4.3"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/0f/4c/751061ffa58615a32c31b2d82e8482be8dd4a89154f003147acee90f2be9/httpx_sse-0.4.3.tar.gz", hash = "sha256:9b1ed0127459a66014aec3c56bebd93da3c1bc8bb6618c8082039a44889a755d", size = 15943, upload-time = "2025-10-10T21:48:22.271Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/d2/fd/6668e5aec43ab844de6fc74927e155a3b37bf40d7c3790e49fc0406b6578/httpx_sse-0.4.3-py3-none-any.whl", hash = "sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc", size = 8960, upload-time = "2025-10-10T21:48:21.158Z" },@@ -677,7 +672,7 @@ wheels = [[[package]]name = "huggingface-hub"version = "0.36.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "filelock" },{ name = "fsspec" },@@ -741,7 +736,7 @@ dev = [[[package]]name = "idna"version = "3.11"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582, upload-time = "2025-10-12T14:55:20.501Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" },@@ -750,7 +745,7 @@ wheels = [[[package]]name = "iniconfig"version = "2.3.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" },@@ -759,7 +754,7 @@ wheels = [[[package]]name = "jinja2"version = "3.1.6"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "markupsafe" },]@@ -771,7 +766,7 @@ wheels = [[[package]]name = "jiter"version = "0.12.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/45/9d/e0660989c1370e25848bb4c52d061c71837239738ad937e83edca174c273/jiter-0.12.0.tar.gz", hash = "sha256:64dfcd7d5c168b38d3f9f8bba7fc639edb3418abcc74f22fdbe6b8938293f30b", size = 168294, upload-time = "2025-11-09T20:49:23.302Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/32/f9/eaca4633486b527ebe7e681c431f529b63fe2709e7c5242fc0f43f77ce63/jiter-0.12.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:d8f8a7e317190b2c2d60eb2e8aa835270b008139562d70fe732e1c0020ec53c9", size = 316435, upload-time = "2025-11-09T20:47:02.087Z" },@@ -856,7 +851,7 @@ wheels = [[[package]]name = "joblib"version = "1.5.3"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/41/f2/d34e8b3a08a9cc79a50b2208a93dce981fe615b64d5a4d4abee421d898df/joblib-1.5.3.tar.gz", hash = "sha256:8561a3269e6801106863fd0d6d84bb737be9e7631e33aaed3fb9ce5953688da3", size = 331603, upload-time = "2025-12-15T08:41:46.427Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/7b/91/984aca2ec129e2757d1e4e3c81c3fcda9d0f85b74670a094cc443d9ee949/joblib-1.5.3-py3-none-any.whl", hash = "sha256:5fc3c5039fc5ca8c0276333a188bbd59d6b7ab37fe6632daa76bc7f9ec18e713", size = 309071, upload-time = "2025-12-15T08:41:44.973Z" },@@ -865,7 +860,7 @@ wheels = [[[package]]name = "jsonpatch"version = "1.33"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "jsonpointer" },]@@ -877,7 +872,7 @@ wheels = [[[package]]name = "jsonpointer"version = "3.0.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/6a/0a/eebeb1fa92507ea94016a2a790b93c2ae41a7e18778f85471dc54475ed25/jsonpointer-3.0.0.tar.gz", hash = "sha256:2b2d729f2091522d61c3b31f82e11870f60b68f43fbc705cb76bf4b832af59ef", size = 9114, upload-time = "2024-06-10T19:24:42.462Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/71/92/5e77f98553e9e75130c78900d000368476aed74276eb8ae8796f65f00918/jsonpointer-3.0.0-py2.py3-none-any.whl", hash = "sha256:13e088adc14fca8b6aa8177c044e12701e6ad4b28ff10e65f2267a90109c9942", size = 7595, upload-time = "2024-06-10T19:24:40.698Z" },@@ -886,7 +881,7 @@ wheels = [[[package]]name = "langchain"version = "1.2.6"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "langchain-core" },{ name = "langgraph" },@@ -900,7 +895,7 @@ wheels = [[[package]]name = "langchain-classic"version = "1.0.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "langchain-core" },{ name = "langchain-text-splitters" },@@ -918,7 +913,7 @@ wheels = [[[package]]name = "langchain-community"version = "0.4.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "aiohttp" },{ name = "dataclasses-json" },@@ -941,7 +936,7 @@ wheels = [[[package]]name = "langchain-core"version = "1.2.7"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "jsonpatch" },{ name = "langsmith" },@@ -960,7 +955,7 @@ wheels = [[[package]]name = "langchain-openai"version = "1.1.7"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "langchain-core" },{ name = "openai" },@@ -974,7 +969,7 @@ wheels = [[[package]]name = "langchain-text-splitters"version = "1.1.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "langchain-core" },]@@ -986,7 +981,7 @@ wheels = [[[package]]name = "langgraph"version = "1.0.5"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "langchain-core" },{ name = "langgraph-checkpoint" },@@ -1003,7 +998,7 @@ wheels = [[[package]]name = "langgraph-checkpoint"version = "3.0.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "langchain-core" },{ name = "ormsgpack" },@@ -1016,7 +1011,7 @@ wheels = [[[package]]name = "langgraph-prebuilt"version = "1.0.5"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "langchain-core" },{ name = "langgraph-checkpoint" },@@ -1029,7 +1024,7 @@ wheels = [[[package]]name = "langgraph-sdk"version = "0.3.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "httpx" },{ name = "orjson" },@@ -1042,7 +1037,7 @@ wheels = [[[package]]name = "langsmith"version = "0.6.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "httpx" },{ name = "orjson", marker = "platform_python_implementation != 'PyPy'" },@@ -1061,7 +1056,7 @@ wheels = [[[package]]name = "loguru"version = "0.7.3"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "colorama", marker = "sys_platform == 'win32'" },{ name = "win32-setctime", marker = "sys_platform == 'win32'" },@@ -1074,7 +1069,7 @@ wheels = [[[package]]name = "markdown"version = "3.10"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/7d/ab/7dd27d9d863b3376fcf23a5a13cb5d024aed1db46f963f1b5735ae43b3be/markdown-3.10.tar.gz", hash = "sha256:37062d4f2aa4b2b6b32aefb80faa300f82cc790cb949a35b8caede34f2b68c0e", size = 364931, upload-time = "2025-11-03T19:51:15.007Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/70/81/54e3ce63502cd085a0c556652a4e1b919c45a446bd1e5300e10c44c8c521/markdown-3.10-py3-none-any.whl", hash = "sha256:b5b99d6951e2e4948d939255596523444c0e677c669700b1d17aa4a8a464cb7c", size = 107678, upload-time = "2025-11-03T19:51:13.887Z" },@@ -1083,7 +1078,7 @@ wheels = [[[package]]name = "markdown-it-py"version = "4.0.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "mdurl" },]@@ -1095,7 +1090,7 @@ wheels = [[[package]]name = "markupsafe"version = "3.0.3"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/08/db/fefacb2136439fc8dd20e797950e749aa1f4997ed584c62cfb8ef7c2be0e/markupsafe-3.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1cc7ea17a6824959616c525620e387f6dd30fec8cb44f649e31712db02123dad", size = 11631, upload-time = "2025-09-27T18:36:18.185Z" },@@ -1169,7 +1164,7 @@ wheels = [[[package]]name = "marshmallow"version = "3.26.2"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "packaging" },]@@ -1181,7 +1176,7 @@ wheels = [[[package]]name = "mdurl"version = "0.1.2"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" },@@ -1190,7 +1185,7 @@ wheels = [[[package]]name = "mergedeep"version = "1.3.4"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/3a/41/580bb4006e3ed0361b8151a01d324fb03f420815446c7def45d02f74c270/mergedeep-1.3.4.tar.gz", hash = "sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8", size = 4661, upload-time = "2021-02-05T18:55:30.623Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/2c/19/04f9b178c2d8a15b076c8b5140708fa6ffc5601fb6f1e975537072df5b2a/mergedeep-1.3.4-py3-none-any.whl", hash = "sha256:70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307", size = 6354, upload-time = "2021-02-05T18:55:29.583Z" },@@ -1199,7 +1194,7 @@ wheels = [[[package]]name = "mkdocs"version = "1.6.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "click" },{ name = "colorama", marker = "sys_platform == 'win32'" },@@ -1223,7 +1218,7 @@ wheels = [[[package]]name = "mkdocs-autorefs"version = "1.4.3"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "markdown" },{ name = "markupsafe" },@@ -1237,7 +1232,7 @@ wheels = [[[package]]name = "mkdocs-get-deps"version = "0.2.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "mergedeep" },{ name = "platformdirs" },@@ -1251,7 +1246,7 @@ wheels = [[[package]]name = "mkdocs-material"version = "9.7.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "babel" },{ name = "backrefs" },@@ -1273,7 +1268,7 @@ wheels = [[[package]]name = "mkdocs-material-extensions"version = "1.3.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/79/9b/9b4c96d6593b2a541e1cb8b34899a6d021d208bb357042823d4d2cabdbe7/mkdocs_material_extensions-1.3.1.tar.gz", hash = "sha256:10c9511cea88f568257f960358a467d12b970e1f7b2c0e5fb2bb48cab1928443" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/5b/54/662a4743aa81d9582ee9339d4ffa3c8fd40a4965e033d77b9da9774d3960/mkdocs_material_extensions-1.3.1-py3-none-any.whl", hash = "sha256:adff8b62700b25cb77b53358dad940f3ef973dd6db797907c49e3c2ef3ab4e31" },@@ -1282,7 +1277,7 @@ wheels = [[[package]]name = "mkdocstrings"version = "1.0.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "jinja2" },{ name = "markdown" },@@ -1304,7 +1299,7 @@ python = [[[package]]name = "mkdocstrings-python"version = "2.0.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "griffe" },{ name = "mkdocs-autorefs" },@@ -1318,7 +1313,7 @@ wheels = [[[package]]name = "model2vec"version = "0.7.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "jinja2" },{ name = "joblib" },@@ -1337,7 +1332,7 @@ wheels = [[[package]]name = "multidict"version = "6.7.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/80/1e/5492c365f222f907de1039b91f922b93fa4f764c713ee858d235495d8f50/multidict-6.7.0.tar.gz", hash = "sha256:c6e99d9a65ca282e578dfea819cfa9c0a62b2499d8677392e09feaf305e9e6f5", size = 101834, upload-time = "2025-10-06T14:52:30.657Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/34/9e/5c727587644d67b2ed479041e4b1c58e30afc011e3d45d25bbe35781217c/multidict-6.7.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4d409aa42a94c0b3fa617708ef5276dfe81012ba6753a0370fcc9d0195d0a1fc", size = 76604, upload-time = "2025-10-06T14:48:54.277Z" },@@ -1454,7 +1449,7 @@ wheels = [[[package]]name = "mypy-extensions"version = "1.1.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" },@@ -1463,7 +1458,7 @@ wheels = [[[package]]name = "numpy"version = "2.4.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/24/62/ae72ff66c0f1fd959925b4c11f8c2dea61f47f6acaea75a08512cdfe3fed/numpy-2.4.1.tar.gz", hash = "sha256:a1ceafc5042451a858231588a104093474c6a5c57dcc724841f5c888d237d690", size = 20721320, upload-time = "2026-01-10T06:44:59.619Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a5/34/2b1bc18424f3ad9af577f6ce23600319968a70575bd7db31ce66731bbef9/numpy-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0cce2a669e3c8ba02ee563c7835f92c153cf02edff1ae05e1823f1dde21b16a5", size = 16944563, upload-time = "2026-01-10T06:42:14.615Z" },@@ -1542,7 +1537,7 @@ wheels = [[[package]]name = "ontomem"version = "0.2.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "faiss-cpu" },{ name = "langchain" },@@ -1561,7 +1556,7 @@ wheels = [[[package]]name = "ontosight"version = "0.1.3"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "fastapi" },{ name = "pydantic" },@@ -1575,7 +1570,7 @@ wheels = [[[package]]name = "openai"version = "2.14.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "anyio" },{ name = "distro" },@@ -1594,7 +1589,7 @@ wheels = [[[package]]name = "orjson"version = "3.11.5"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/04/b8/333fdb27840f3bf04022d21b654a35f58e15407183aeb16f3b41aa053446/orjson-3.11.5.tar.gz", hash = "sha256:82393ab47b4fe44ffd0a7659fa9cfaacc717eb617c93cde83795f14af5c2e9d5", size = 5972347, upload-time = "2025-12-06T15:55:39.458Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/fd/68/6b3659daec3a81aed5ab47700adb1a577c76a5452d35b91c88efee89987f/orjson-3.11.5-cp311-cp311-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:9c8494625ad60a923af6b2b0bd74107146efe9b55099e20d7740d995f338fcd8", size = 245318, upload-time = "2025-12-06T15:54:02.355Z" },@@ -1662,7 +1657,7 @@ wheels = [[[package]]name = "ormsgpack"version = "1.12.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/fe/96/34c40d621996c2f377a18decbd3c59f031dde73c3ba47d1e1e8f29a05aaa/ormsgpack-1.12.1.tar.gz", hash = "sha256:a3877fde1e4f27a39f92681a0aab6385af3a41d0c25375d33590ae20410ea2ac", size = 39476, upload-time = "2025-12-14T07:57:43.248Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/57/e2/f5b89365c8dc8025c27d31316038f1c103758ddbf87dc0fa8e3f78f66907/ormsgpack-1.12.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:4038f59ae0e19dac5e5d9aae4ec17ff84a79e046342ee73ccdecf3547ecf0d34", size = 376180, upload-time = "2025-12-14T07:56:56.521Z" },@@ -1709,7 +1704,7 @@ wheels = [[[package]]name = "packaging"version = "25.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" },@@ -1718,7 +1713,7 @@ wheels = [[[package]]name = "paginate"version = "0.5.7"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/ec/46/68dde5b6bc00c1296ec6466ab27dddede6aec9af1b99090e1107091b3b84/paginate-0.5.7.tar.gz", hash = "sha256:22bd083ab41e1a8b4f3690544afb2c60c25e5c9a63a30fa2f483f6c60c8e5945", size = 19252, upload-time = "2024-08-25T14:17:24.139Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/90/96/04b8e52da071d28f5e21a805b19cb9390aa17a47462ac87f5e2696b9566d/paginate-0.5.7-py2.py3-none-any.whl", hash = "sha256:b885e2af73abcf01d9559fd5216b57ef722f8c42affbb63942377668e35c7591", size = 13746, upload-time = "2024-08-25T14:17:22.55Z" },@@ -1727,7 +1722,7 @@ wheels = [[[package]]name = "pathspec"version = "1.0.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/28/2e/83722ece0f6ee24387d6cb830dd562ddbcd6ce0b9d76072c6849670c31b4/pathspec-1.0.1.tar.gz", hash = "sha256:e2769b508d0dd47b09af6ee2c75b2744a2cb1f474ae4b1494fd6a1b7a841613c", size = 129791, upload-time = "2026-01-06T13:02:55.15Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/d2/fe/2257c71721aeab6a6e8aa1f00d01f2a20f58547d249a6c8fef5791f559fc/pathspec-1.0.1-py3-none-any.whl", hash = "sha256:8870061f22c58e6d83463cfce9a7dd6eca0512c772c1001fb09ac64091816721", size = 54584, upload-time = "2026-01-06T13:02:53.601Z" },@@ -1736,7 +1731,7 @@ wheels = [[[package]]name = "platformdirs"version = "4.5.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/cf/86/0248f086a84f01b37aaec0fa567b397df1a119f73c16f6c7a9aac73ea309/platformdirs-4.5.1.tar.gz", hash = "sha256:61d5cdcc6065745cdd94f0f878977f8de9437be93de97c1c12f853c9c0cdcbda", size = 21715, upload-time = "2025-12-05T13:52:58.638Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/cb/28/3bfe2fa5a7b9c46fe7e13c97bda14c895fb10fa2ebf1d0abb90e0cea7ee1/platformdirs-4.5.1-py3-none-any.whl", hash = "sha256:d03afa3963c806a9bed9d5125c8f4cb2fdaf74a55ab60e5d59b3fde758104d31", size = 18731, upload-time = "2025-12-05T13:52:56.823Z" },@@ -1745,7 +1740,7 @@ wheels = [[[package]]name = "pluggy"version = "1.6.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },@@ -1754,7 +1749,7 @@ wheels = [[[package]]name = "propcache"version = "0.4.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/9e/da/e9fc233cf63743258bff22b3dfa7ea5baef7b5bc324af47a0ad89b8ffc6f/propcache-0.4.1.tar.gz", hash = "sha256:f48107a8c637e80362555f37ecf49abe20370e557cc4ab374f04ec4423c97c3d", size = 46442, upload-time = "2025-10-08T19:49:02.291Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/8c/d4/4e2c9aaf7ac2242b9358f98dccd8f90f2605402f5afeff6c578682c2c491/propcache-0.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:60a8fda9644b7dfd5dece8c61d8a85e271cb958075bfc4e01083c148b61a7caf", size = 80208, upload-time = "2025-10-08T19:46:24.597Z" },@@ -1853,7 +1848,7 @@ wheels = [[[package]]name = "pydantic"version = "2.12.5"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "annotated-types" },{ name = "pydantic-core" },@@ -1868,7 +1863,7 @@ wheels = [[[package]]name = "pydantic-core"version = "2.41.5"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "typing-extensions" },]@@ -1965,7 +1960,7 @@ wheels = [[[package]]name = "pydantic-settings"version = "2.12.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "pydantic" },{ name = "python-dotenv" },@@ -1979,7 +1974,7 @@ wheels = [[[package]]name = "pygments"version = "2.19.2"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" },@@ -1988,7 +1983,7 @@ wheels = [[[package]]name = "pymdown-extensions"version = "10.20"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "markdown" },{ name = "pyyaml" },@@ -2001,7 +1996,7 @@ wheels = [[[package]]name = "pytest"version = "9.0.2"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "colorama", marker = "sys_platform == 'win32'" },{ name = "iniconfig" },@@ -2017,7 +2012,7 @@ wheels = [[[package]]name = "python-dateutil"version = "2.9.0.post0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "six" },]@@ -2029,7 +2024,7 @@ wheels = [[[package]]name = "python-dotenv"version = "1.2.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/f0/26/19cadc79a718c5edbec86fd4919a6b6d3f681039a2f6d66d14be94e75fb9/python_dotenv-1.2.1.tar.gz", hash = "sha256:42667e897e16ab0d66954af0e60a9caa94f0fd4ecf3aaf6d2d260eec1aa36ad6", size = 44221, upload-time = "2025-10-26T15:12:10.434Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/14/1b/a298b06749107c305e1fe0f814c6c74aea7b2f1e10989cb30f544a1b3253/python_dotenv-1.2.1-py3-none-any.whl", hash = "sha256:b81ee9561e9ca4004139c6cbba3a238c32b03e4894671e181b671e8cb8425d61", size = 21230, upload-time = "2025-10-26T15:12:09.109Z" },@@ -2038,7 +2033,7 @@ wheels = [[[package]]name = "pyversity"version = "0.1.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "numpy" },]@@ -2050,7 +2045,7 @@ wheels = [[[package]]name = "pyyaml"version = "6.0.3"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/6d/16/a95b6757765b7b031c9374925bb718d55e0a9ba8a1b6a12d25962ea44347/pyyaml-6.0.3-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e", size = 185826, upload-time = "2025-09-25T21:31:58.655Z" },@@ -2105,7 +2100,7 @@ wheels = [[[package]]name = "pyyaml-env-tag"version = "1.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "pyyaml" },]@@ -2117,7 +2112,7 @@ wheels = [[[package]]name = "regex"version = "2025.11.3"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/cc/a9/546676f25e573a4cf00fe8e119b78a37b6a8fe2dc95cda877b30889c9c45/regex-2025.11.3.tar.gz", hash = "sha256:1fedc720f9bb2494ce31a58a1631f9c82df6a09b49c19517ea5cc280b4541e01", size = 414669, upload-time = "2025-11-03T21:34:22.089Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/f7/90/4fb5056e5f03a7048abd2b11f598d464f0c167de4f2a51aa868c376b8c70/regex-2025.11.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:eadade04221641516fa25139273505a1c19f9bf97589a05bc4cfcd8b4a618031", size = 488081, upload-time = "2025-11-03T21:31:11.946Z" },@@ -2209,7 +2204,7 @@ wheels = [[[package]]name = "requests"version = "2.32.5"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "certifi" },{ name = "charset-normalizer" },@@ -2224,7 +2219,7 @@ wheels = [[[package]]name = "requests-toolbelt"version = "1.0.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "requests" },]@@ -2236,7 +2231,7 @@ wheels = [[[package]]name = "rich"version = "14.2.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "markdown-it-py" },{ name = "pygments" },@@ -2249,7 +2244,7 @@ wheels = [[[package]]name = "safetensors"version = "0.7.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/29/9c/6e74567782559a63bd040a236edca26fd71bc7ba88de2ef35d75df3bca5e/safetensors-0.7.0.tar.gz", hash = "sha256:07663963b67e8bd9f0b8ad15bb9163606cd27cc5a1b96235a50d8369803b96b0", size = 200878, upload-time = "2025-11-19T15:18:43.199Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/fa/47/aef6c06649039accf914afef490268e1067ed82be62bcfa5b7e886ad15e8/safetensors-0.7.0-cp38-abi3-macosx_10_12_x86_64.whl", hash = "sha256:c82f4d474cf725255d9e6acf17252991c3c8aac038d6ef363a4bf8be2f6db517", size = 467781, upload-time = "2025-11-19T15:18:35.84Z" },@@ -2271,7 +2266,7 @@ wheels = [[[package]]name = "semhash"version = "0.4.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "frozendict" },{ name = "model2vec" },@@ -2286,7 +2281,7 @@ wheels = [[[package]]name = "setuptools"version = "80.10.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/86/ff/f75651350db3cf2ef767371307eb163f3cc1ac03e16fdf3ac347607f7edb/setuptools-80.10.1.tar.gz", hash = "sha256:bf2e513eb8144c3298a3bd28ab1a5edb739131ec5c22e045ff93cd7f5319703a", size = 1229650, upload-time = "2026-01-21T09:42:03.061Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e0/76/f963c61683a39084aa575f98089253e1e852a4417cb8a3a8a422923a5246/setuptools-80.10.1-py3-none-any.whl", hash = "sha256:fc30c51cbcb8199a219c12cc9c281b5925a4978d212f84229c909636d9f6984e", size = 1099859, upload-time = "2026-01-21T09:42:00.688Z" },@@ -2295,7 +2290,7 @@ wheels = [[[package]]name = "simsimd"version = "6.5.12"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a4/13/dbcee7d607cbcfdfdf3a0593bec46479ce4e5957b39c5e81333efe540464/simsimd-6.5.12.tar.gz", hash = "sha256:c9b8720c9bc9dcfc36f570c2f96bfd74d1c9e1d0ebeecafc7a130ad3f0affe41", size = 186676, upload-time = "2025-12-21T01:13:38.467Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e9/16/7ec9c660e72297af5a192cc5d0570993b626a3f06d58b0a21852e9d97adc/simsimd-6.5.12-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:93d0c3e06f525c3c57c33353d18e28a602f8a1a64b47a5326d7696a4f9746e54", size = 106303, upload-time = "2025-12-21T01:10:39.641Z" },@@ -2387,7 +2382,7 @@ wheels = [[[package]]name = "six"version = "1.17.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" },@@ -2396,7 +2391,7 @@ wheels = [[[package]]name = "sniffio"version = "1.3.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc", size = 20372, upload-time = "2024-02-25T23:20:04.057Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" },@@ -2405,7 +2400,7 @@ wheels = [[[package]]name = "sqlalchemy"version = "2.0.45"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "greenlet", marker = "platform_machine == 'AMD64' or platform_machine == 'WIN32' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'ppc64le' or platform_machine == 'win32' or platform_machine == 'x86_64'" },{ name = "typing-extensions" },@@ -2447,7 +2442,7 @@ wheels = [[[package]]name = "starlette"version = "0.52.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "anyio" },{ name = "typing-extensions", marker = "python_full_version < '3.13'" },@@ -2460,7 +2455,7 @@ wheels = [[[package]]name = "tenacity"version = "9.1.2"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/0a/d4/2b0cd0fe285e14b36db076e78c93766ff1d529d70408bd1d2a5a84f1d929/tenacity-9.1.2.tar.gz", hash = "sha256:1169d376c297e7de388d18b4481760d478b0e99a777cad3a9c86e556f4b697cb", size = 48036, upload-time = "2025-04-02T08:25:09.966Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e5/30/643397144bfbfec6f6ef821f36f33e57d35946c44a2352d3c9f0ae847619/tenacity-9.1.2-py3-none-any.whl", hash = "sha256:f77bf36710d8b73a50b2dd155c97b870017ad21afe6ab300326b0371b3b05138", size = 28248, upload-time = "2025-04-02T08:25:07.678Z" },@@ -2469,7 +2464,7 @@ wheels = [[[package]]name = "tiktoken"version = "0.12.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "regex" },{ name = "requests" },@@ -2523,7 +2518,7 @@ wheels = [[[package]]name = "tokenizers"version = "0.22.2"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "huggingface-hub" },]@@ -2549,7 +2544,7 @@ wheels = [[[package]]name = "tqdm"version = "4.67.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "colorama", marker = "sys_platform == 'win32'" },]@@ -2561,7 +2556,7 @@ wheels = [[[package]]name = "typing-extensions"version = "4.15.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" },@@ -2570,7 +2565,7 @@ wheels = [[[package]]name = "typing-inspect"version = "0.9.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "mypy-extensions" },{ name = "typing-extensions" },@@ -2583,7 +2578,7 @@ wheels = [[[package]]name = "typing-inspection"version = "0.4.2"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "typing-extensions" },]@@ -2595,7 +2590,7 @@ wheels = [[[package]]name = "urllib3"version = "2.6.2"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/1e/24/a2a2ed9addd907787d7aa0355ba36a6cadf1768b934c652ea78acbd59dcd/urllib3-2.6.2.tar.gz", hash = "sha256:016f9c98bb7e98085cb2b4b17b87d2c702975664e4f060c6532e64d1c1a5e797", size = 432930, upload-time = "2025-12-11T15:56:40.252Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/6d/b9/4095b668ea3678bf6a0af005527f39de12fb026516fb3df17495a733b7f8/urllib3-2.6.2-py3-none-any.whl", hash = "sha256:ec21cddfe7724fc7cb4ba4bea7aa8e2ef36f607a4bab81aa6ce42a13dc3f03dd", size = 131182, upload-time = "2025-12-11T15:56:38.584Z" },@@ -2604,7 +2599,7 @@ wheels = [[[package]]name = "usearch"version = "2.23.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "numpy" },{ name = "simsimd" },@@ -2670,7 +2665,7 @@ wheels = [[[package]]name = "uuid-utils"version = "0.12.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/0b/0e/512fb221e4970c2f75ca9dae412d320b7d9ddc9f2b15e04ea8e44710396c/uuid_utils-0.12.0.tar.gz", hash = "sha256:252bd3d311b5d6b7f5dfce7a5857e27bb4458f222586bb439463231e5a9cbd64", size = 20889, upload-time = "2025-12-01T17:29:55.494Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/8a/43/de5cd49a57b6293b911b6a9a62fc03e55db9f964da7d5882d9edbee1e9d2/uuid_utils-0.12.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:3b9b30707659292f207b98f294b0e081f6d77e1fbc760ba5b41331a39045f514", size = 603197, upload-time = "2025-12-01T17:29:30.104Z" },@@ -2699,7 +2694,7 @@ wheels = [[[package]]name = "uvicorn"version = "0.40.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "click" },{ name = "h11" },@@ -2723,7 +2718,7 @@ standard = [[[package]]name = "uvloop"version = "0.22.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/06/f0/18d39dbd1971d6d62c4629cc7fa67f74821b0dc1f5a77af43719de7936a7/uvloop-0.22.1.tar.gz", hash = "sha256:6c84bae345b9147082b17371e3dd5d42775bddce91f885499017f4607fdaf39f", size = 2443250, upload-time = "2025-10-16T22:17:19.342Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/c7/d5/69900f7883235562f1f50d8184bb7dd84a2fb61e9ec63f3782546fdbd057/uvloop-0.22.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:c60ebcd36f7b240b30788554b6f0782454826a0ed765d8430652621b5de674b9", size = 1352420, upload-time = "2025-10-16T22:16:21.187Z" },@@ -2761,7 +2756,7 @@ wheels = [[[package]]name = "vicinity"version = "0.4.3"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "numpy" },{ name = "orjson" },@@ -2780,7 +2775,7 @@ usearch = [[[package]]name = "watchdog"version = "6.0.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/db/7d/7f3d619e951c88ed75c6037b246ddcf2d322812ee8ea189be89511721d54/watchdog-6.0.0.tar.gz", hash = "sha256:9ddf7c82fda3ae8e24decda1338ede66e1c99883db93711d8fb941eaa2d8c282", size = 131220, upload-time = "2024-11-01T14:07:13.037Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e0/24/d9be5cd6642a6aa68352ded4b4b10fb0d7889cb7f45814fb92cecd35f101/watchdog-6.0.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6eb11feb5a0d452ee41f824e271ca311a09e250441c262ca2fd7ebcf2461a06c", size = 96393, upload-time = "2024-11-01T14:06:31.756Z" },@@ -2807,7 +2802,7 @@ wheels = [[[package]]name = "watchfiles"version = "1.1.1"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "anyio" },]@@ -2894,7 +2889,7 @@ wheels = [[[package]]name = "websockets"version = "16.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/04/24/4b2031d72e840ce4c1ccb255f693b15c334757fc50023e4db9537080b8c4/websockets-16.0.tar.gz", hash = "sha256:5f6261a5e56e8d5c42a4497b364ea24d94d9563e8fbd44e78ac40879c60179b5", size = 179346, upload-time = "2026-01-10T09:23:47.181Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/f2/db/de907251b4ff46ae804ad0409809504153b3f30984daf82a1d84a9875830/websockets-16.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:31a52addea25187bde0797a97d6fc3d2f92b6f72a9370792d65a6e84615ac8a8", size = 177340, upload-time = "2026-01-10T09:22:34.539Z" },@@ -2953,7 +2948,7 @@ wheels = [[[package]]name = "win32-setctime"version = "1.2.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b3/8f/705086c9d734d3b663af0e9bb3d4de6578d08f46b1b101c2442fd9aecaa2/win32_setctime-1.2.0.tar.gz", hash = "sha256:ae1fdf948f5640aae05c511ade119313fb6a30d7eabe25fef9764dca5873c4c0", size = 4867, upload-time = "2024-12-07T15:28:28.314Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e1/07/c6fe3ad3e685340704d314d765b7912993bcb8dc198f0e7a89382d37974b/win32_setctime-1.2.0-py3-none-any.whl", hash = "sha256:95d644c4e708aba81dc3704a116d8cbc974d70b3bdb8be1d150e36be6e9d1390", size = 4083, upload-time = "2024-12-07T15:28:26.465Z" },@@ -2962,7 +2957,7 @@ wheels = [[[package]]name = "xxhash"version = "3.6.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/02/84/30869e01909fb37a6cc7e18688ee8bf1e42d57e7e0777636bd47524c43c7/xxhash-3.6.0.tar.gz", hash = "sha256:f0162a78b13a0d7617b2845b90c763339d1f1d82bb04a4b07f4ab535cc5e05d6", size = 85160, upload-time = "2025-10-02T14:37:08.097Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/17/d4/cc2f0400e9154df4b9964249da78ebd72f318e35ccc425e9f403c392f22a/xxhash-3.6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b47bbd8cf2d72797f3c2772eaaac0ded3d3af26481a26d7d7d41dc2d3c46b04a", size = 32844, upload-time = "2025-10-02T14:34:14.037Z" },@@ -3065,7 +3060,7 @@ wheels = [[[package]]name = "yarl"version = "1.22.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }dependencies = [{ name = "idna" },{ name = "multidict" },@@ -3175,7 +3170,7 @@ wheels = [[[package]]name = "zstandard"version = "0.25.0"-source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" }+source = { registry = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/" }sdist = { url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/fd/aa/3e0508d5a5dd96529cdc5a97011299056e14c6505b678fd58938792794b1/zstandard-0.25.0.tar.gz", hash = "sha256:7713e1179d162cf5c7906da876ec2ccb9c3a9dcbdffef0cc7f70c3667a205f0b", size = 711513, upload-time = "2025-09-14T22:15:54.002Z" }wheels = [{ url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/2a/83/c3ca27c363d104980f1c9cee1101cc8ba724ac8c28a033ede6aab89585b1/zstandard-0.25.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:933b65d7680ea337180733cf9e87293cc5500cc0eb3fc8769f4d3c88d724ec5c", size = 795254, upload-time = "2025-09-14T22:16:26.137Z" },