Spaces:
Paused
Paused
lanny xu
commited on
Commit
·
90b33eb
1
Parent(s):
371a40c
resolve conflict
Browse files- entity_extractor.py +5 -1
- graph_retriever.py +5 -1
- knowledge_graph.py +4 -1
- routers_and_graders.py +5 -1
- workflow_nodes.py +4 -1
entity_extractor.py
CHANGED
|
@@ -4,7 +4,11 @@
|
|
| 4 |
"""
|
| 5 |
|
| 6 |
from typing import List, Dict, Tuple
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
from langchain_community.chat_models import ChatOllama
|
| 9 |
from langchain_core.output_parsers import JsonOutputParser
|
| 10 |
from config import LOCAL_LLM
|
|
|
|
| 4 |
"""
|
| 5 |
|
| 6 |
from typing import List, Dict, Tuple
|
| 7 |
+
try:
|
| 8 |
+
from langchain_core.prompts import PromptTemplate
|
| 9 |
+
except ImportError:
|
| 10 |
+
from langchain.prompts import PromptTemplate
|
| 11 |
+
|
| 12 |
from langchain_community.chat_models import ChatOllama
|
| 13 |
from langchain_core.output_parsers import JsonOutputParser
|
| 14 |
from config import LOCAL_LLM
|
graph_retriever.py
CHANGED
|
@@ -4,7 +4,11 @@ GraphRAG检索器
|
|
| 4 |
"""
|
| 5 |
|
| 6 |
from typing import List, Dict, Set, Tuple
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
from langchain_community.chat_models import ChatOllama
|
| 9 |
from langchain_core.output_parsers import StrOutputParser, JsonOutputParser
|
| 10 |
|
|
|
|
| 4 |
"""
|
| 5 |
|
| 6 |
from typing import List, Dict, Set, Tuple
|
| 7 |
+
try:
|
| 8 |
+
from langchain_core.prompts import PromptTemplate
|
| 9 |
+
except ImportError:
|
| 10 |
+
from langchain.prompts import PromptTemplate
|
| 11 |
+
|
| 12 |
from langchain_community.chat_models import ChatOllama
|
| 13 |
from langchain_core.output_parsers import StrOutputParser, JsonOutputParser
|
| 14 |
|
knowledge_graph.py
CHANGED
|
@@ -15,7 +15,10 @@ except ImportError:
|
|
| 15 |
LOUVAIN_AVAILABLE = False
|
| 16 |
print("⚠️ python-louvain未安装,社区检测功能受限")
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
| 19 |
from langchain_community.chat_models import ChatOllama
|
| 20 |
from langchain_core.output_parsers import StrOutputParser
|
| 21 |
from config import LOCAL_LLM
|
|
|
|
| 15 |
LOUVAIN_AVAILABLE = False
|
| 16 |
print("⚠️ python-louvain未安装,社区检测功能受限")
|
| 17 |
|
| 18 |
+
try:
|
| 19 |
+
from langchain_core.prompts import PromptTemplate
|
| 20 |
+
except ImportError:
|
| 21 |
+
from langchain.prompts import PromptTemplate
|
| 22 |
from langchain_community.chat_models import ChatOllama
|
| 23 |
from langchain_core.output_parsers import StrOutputParser
|
| 24 |
from config import LOCAL_LLM
|
routers_and_graders.py
CHANGED
|
@@ -3,7 +3,11 @@
|
|
| 3 |
包含查询路由、文档相关性评分、答案质量评分和幻觉检测
|
| 4 |
"""
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
from langchain_community.chat_models import ChatOllama
|
| 8 |
from langchain_core.output_parsers import JsonOutputParser, StrOutputParser
|
| 9 |
|
|
|
|
| 3 |
包含查询路由、文档相关性评分、答案质量评分和幻觉检测
|
| 4 |
"""
|
| 5 |
|
| 6 |
+
try:
|
| 7 |
+
from langchain_core.prompts import PromptTemplate
|
| 8 |
+
except ImportError:
|
| 9 |
+
from langchain.prompts import PromptTemplate
|
| 10 |
+
|
| 11 |
from langchain_community.chat_models import ChatOllama
|
| 12 |
from langchain_core.output_parsers import JsonOutputParser, StrOutputParser
|
| 13 |
|
workflow_nodes.py
CHANGED
|
@@ -12,7 +12,10 @@ except ImportError:
|
|
| 12 |
from langchain_community.chat_models import ChatOllama
|
| 13 |
from langchain_core.output_parsers import StrOutputParser
|
| 14 |
from langchain_community.tools.tavily_search import TavilySearchResults
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
from config import LOCAL_LLM, WEB_SEARCH_RESULTS_COUNT
|
| 18 |
from pprint import pprint
|
|
|
|
| 12 |
from langchain_community.chat_models import ChatOllama
|
| 13 |
from langchain_core.output_parsers import StrOutputParser
|
| 14 |
from langchain_community.tools.tavily_search import TavilySearchResults
|
| 15 |
+
try:
|
| 16 |
+
from langchain_core.prompts import PromptTemplate
|
| 17 |
+
except ImportError:
|
| 18 |
+
from langchain.prompts import PromptTemplate
|
| 19 |
|
| 20 |
from config import LOCAL_LLM, WEB_SEARCH_RESULTS_COUNT
|
| 21 |
from pprint import pprint
|