Spaces:
Sleeping
Sleeping
jedick commited on
Commit ·
3663260
1
Parent(s): 30edd26
Migrate to LangChain v1
Browse files- graph.py +1 -1
- mods/file_system.py +5 -8
- requirements.txt +14 -21
- retriever.py +1 -1
graph.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from langchain_core.messages import SystemMessage, ToolMessage, HumanMessage, AIMessage
|
| 2 |
from langgraph.graph import START, END, MessagesState, StateGraph
|
| 3 |
-
from langchain_core.tools import tool
|
| 4 |
from langgraph.prebuilt import ToolNode, tools_condition
|
|
|
|
| 5 |
from typing import Optional
|
| 6 |
import datetime
|
| 7 |
import os
|
|
|
|
| 1 |
from langchain_core.messages import SystemMessage, ToolMessage, HumanMessage, AIMessage
|
| 2 |
from langgraph.graph import START, END, MessagesState, StateGraph
|
|
|
|
| 3 |
from langgraph.prebuilt import ToolNode, tools_condition
|
| 4 |
+
from langchain_core.tools import tool
|
| 5 |
from typing import Optional
|
| 6 |
import datetime
|
| 7 |
import os
|
mods/file_system.py
CHANGED
|
@@ -1,13 +1,10 @@
|
|
| 1 |
-
import
|
| 2 |
-
import re
|
| 3 |
-
import time
|
| 4 |
from collections.abc import Iterator, Sequence
|
| 5 |
-
from pathlib import Path
|
| 6 |
from typing import Optional, Union
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
|
| 12 |
|
| 13 |
class LocalFileStore(ByteStore):
|
|
|
|
| 1 |
+
from langchain_core.stores import ByteStore, InvalidKeyException
|
|
|
|
|
|
|
| 2 |
from collections.abc import Iterator, Sequence
|
|
|
|
| 3 |
from typing import Optional, Union
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
import time
|
| 6 |
+
import os
|
| 7 |
+
import re
|
| 8 |
|
| 9 |
|
| 10 |
class LocalFileStore(ByteStore):
|
requirements.txt
CHANGED
|
@@ -1,32 +1,25 @@
|
|
| 1 |
# To load API keys
|
| 2 |
-
python-dotenv==1.
|
| 3 |
|
| 4 |
-
# To download
|
| 5 |
-
boto3==1.
|
| 6 |
|
| 7 |
# Retrieval
|
| 8 |
-
bm25s==0.2.
|
| 9 |
-
chromadb=
|
| 10 |
-
# NOTE: chromadb==1.0.13 was giving intermittent error:
|
| 11 |
-
# ValueError('Could not connect to tenant default_tenant. Are you sure it exists?')
|
| 12 |
-
# posthog<6.0.0 is temporary fix for ChromaDB telemetry error log messages
|
| 13 |
-
# https://github.com/vanna-ai/vanna/issues/917
|
| 14 |
-
posthog==5.4.0
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
langchain==
|
| 18 |
-
langchain-
|
| 19 |
-
langchain-
|
| 20 |
-
langchain-
|
| 21 |
-
langchain-community==0.
|
| 22 |
-
|
| 23 |
-
langgraph==0.4.7
|
| 24 |
-
langgraph-sdk==0.1.72
|
| 25 |
-
langgraph-prebuilt==0.5.2
|
| 26 |
-
langgraph-checkpoint==2.1.0
|
| 27 |
|
| 28 |
# Evaluations
|
| 29 |
ragas==0.2.15
|
|
|
|
| 30 |
|
| 31 |
# Frontend
|
| 32 |
gradio==5.38.2
|
|
|
|
|
|
| 1 |
# To load API keys
|
| 2 |
+
python-dotenv==1.2.1
|
| 3 |
|
| 4 |
+
# To download files from S3
|
| 5 |
+
boto3==1.42.21
|
| 6 |
|
| 7 |
# Retrieval
|
| 8 |
+
bm25s==0.2.14
|
| 9 |
+
chromadb=1.4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
# LangChain packages
|
| 12 |
+
langchain==1.2.0
|
| 13 |
+
langchain-chroma==1.1.0
|
| 14 |
+
langchain-openai==1.1.6
|
| 15 |
+
langchain-classic==1.0.1
|
| 16 |
+
langchain-community==0.4.1
|
| 17 |
+
langgraph==1.0.5
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Evaluations
|
| 20 |
ragas==0.2.15
|
| 21 |
+
#ragas==0.4.2
|
| 22 |
|
| 23 |
# Frontend
|
| 24 |
gradio==5.38.2
|
| 25 |
+
#gradio==6.2.0
|
retriever.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# Main retriever modules
|
| 2 |
-
from
|
| 3 |
from langchain_core.retrievers import BaseRetriever, RetrieverLike
|
| 4 |
from langchain_core.callbacks import CallbackManagerForRetrieverRun
|
| 5 |
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
|
|
|
| 1 |
# Main retriever modules
|
| 2 |
+
from langchain_classic.retrievers import ParentDocumentRetriever, EnsembleRetriever
|
| 3 |
from langchain_core.retrievers import BaseRetriever, RetrieverLike
|
| 4 |
from langchain_core.callbacks import CallbackManagerForRetrieverRun
|
| 5 |
from langchain_text_splitters import RecursiveCharacterTextSplitter
|