adjust regex and requirements
This commit is contained in:
parent
16b7267411
commit
26a320dd2d
|
@ -0,0 +1,54 @@
|
|||
diff --git a/pers/langchain/tools/browser.py b/pers/langchain/tools/browser.py
|
||||
index 957ea1d..db54f35 100644
|
||||
--- a/pers/langchain/tools/browser.py
|
||||
+++ b/pers/langchain/tools/browser.py
|
||||
@@ -17,7 +17,7 @@ def get_chrome_webdriver():
|
||||
chrome_options.add_argument('--disable-extensions')
|
||||
chrome_options.add_argument('disable-infobars')
|
||||
chrome_options.add_argument("--incognito")
|
||||
- driver = undetected_chromedriver.Chrome(headless=True, options=chrome_options)
|
||||
+ driver = undetected_chromedriver.Chrome(headless=True, options=chrome_options, version_main=120) # use the chrome version you have
|
||||
return driver
|
||||
diff --git a/pers/langchain/tools/document_manager.py b/pers/langchain/tools/document_manager.py
|
||||
index c36a894..401069d 100644
|
||||
--- a/pers/langchain/tools/document_manager.py
|
||||
+++ b/pers/langchain/tools/document_manager.py
|
||||
@@ -1,6 +1,6 @@
|
||||
from langchain.chains import RetrievalQA
|
||||
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
||||
-from langchain_community.vectorstores.faiss import FAISS
|
||||
+from langchain_community.vectorstores import Chroma
|
||||
from langchain_core.tools import tool
|
||||
from langchain_openai import OpenAIEmbeddings
|
||||
|
||||
@@ -11,7 +11,7 @@ class DocumentManager:
|
||||
"""
|
||||
A class to manage loading large documents into the chain and giving the agent the ability to read it on subsequent loops.
|
||||
"""
|
||||
- index: FAISS
|
||||
+ index: Chroma
|
||||
qa_chain: RetrievalQA
|
||||
|
||||
def __init__(self):
|
||||
@@ -21,7 +21,7 @@ class DocumentManager:
|
||||
assert isinstance(data, str)
|
||||
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
|
||||
splits = text_splitter.split_text(data)
|
||||
- self.index = FAISS.from_texts(splits, self.embeddings)
|
||||
+ self.index = Chroma.from_texts(splits, self.embeddings)
|
||||
|
||||
def create_retrieval(self):
|
||||
self.qa_chain = RetrievalQA.from_chain_type(
|
||||
diff --git a/run.py b/run.py
|
||||
index 9d620c2..432238a 100755
|
||||
--- a/run.py
|
||||
+++ b/run.py
|
||||
@@ -43,13 +46,13 @@ readline.get_completion_type()
|
||||
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
|
||||
-MANUAL_STOP_RE = re.compile(r'(\n|\s)*(functions\.)*end_my_response(\(\))*')
|
||||
+MANUAL_STOP_RE = re.compile(r'(\n|\s)*(functions\.)*end_my_response(\(\))*(.*)', re.MULTILINE)
|
||||
|
||||
|
||||
def init():
|
|
@ -7,7 +7,7 @@ langchain-experimental==0.0.50
|
|||
trafilatura
|
||||
newspaper3k
|
||||
playwright
|
||||
beautifulsoup4
|
||||
beautifulsoup4==4.12.3
|
||||
chromedriver-autoinstaller==0.6.4
|
||||
undetected-chromedriver==3.5.4
|
||||
redis==5.0.1
|
||||
|
|
Reference in New Issue