Bump up LangChain version and bugfix (#536)
Co-authored-by: Taranjeet Singh <reachtotj@gmail.com>
This commit is contained in:
@@ -28,7 +28,7 @@ class ChromaDB(BaseVectorDB):
|
|||||||
|
|
||||||
if host and port:
|
if host and port:
|
||||||
logging.info(f"Connecting to ChromaDB server: {host}:{port}")
|
logging.info(f"Connecting to ChromaDB server: {host}:{port}")
|
||||||
self.client = chromadb.HttpClient(host=host, port=8000)
|
self.client = chromadb.HttpClient(host=host, port=port)
|
||||||
else:
|
else:
|
||||||
if db_dir is None:
|
if db_dir is None:
|
||||||
db_dir = "db"
|
db_dir = "db"
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ color = true
|
|||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = ">=3.9,<3.9.7 || >3.9.7,<4.0"
|
python = ">=3.9,<3.9.7 || >3.9.7,<4.0"
|
||||||
python-dotenv = "^1.0.0"
|
python-dotenv = "^1.0.0"
|
||||||
langchain = "^0.0.237"
|
langchain = "^0.0.279"
|
||||||
requests = "^2.31.0"
|
requests = "^2.31.0"
|
||||||
openai = "^0.27.5"
|
openai = "^0.27.5"
|
||||||
tiktoken = "^0.4.0"
|
tiktoken = "^0.4.0"
|
||||||
|
|||||||
@@ -3,11 +3,9 @@
|
|||||||
import unittest
|
import unittest
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from chromadb.config import Settings
|
|
||||||
|
|
||||||
from embedchain import App
|
from embedchain import App
|
||||||
from embedchain.config import AppConfig
|
from embedchain.config import AppConfig
|
||||||
from embedchain.vectordb.chroma_db import ChromaDB, chromadb
|
from embedchain.vectordb.chroma_db import ChromaDB
|
||||||
|
|
||||||
|
|
||||||
class TestChromaDbHosts(unittest.TestCase):
|
class TestChromaDbHosts(unittest.TestCase):
|
||||||
@@ -18,15 +16,10 @@ class TestChromaDbHosts(unittest.TestCase):
|
|||||||
host = "test-host"
|
host = "test-host"
|
||||||
port = "1234"
|
port = "1234"
|
||||||
|
|
||||||
with patch.object(chromadb, "HttpClient") as mock_client:
|
db = ChromaDB(host=host, port=port, embedding_fn=len)
|
||||||
_db = ChromaDB(host=host, port=port, embedding_fn=len)
|
settings = db.client.get_settings()
|
||||||
|
self.assertEqual(settings.chroma_server_host, host)
|
||||||
expected_settings = Settings(
|
self.assertEqual(settings.chroma_server_http_port, port)
|
||||||
chroma_server_host="test-host",
|
|
||||||
chroma_server_http_port="1234",
|
|
||||||
)
|
|
||||||
|
|
||||||
mock_client.assert_called_once_with(expected_settings)
|
|
||||||
|
|
||||||
|
|
||||||
# Review this test
|
# Review this test
|
||||||
|
|||||||
Reference in New Issue
Block a user