Skip to content

Commit

Permalink
Bump up LangChain version and bugfix (mem0ai#536)
Browse files Browse the repository at this point in the history
Co-authored-by: Taranjeet Singh <[email protected]>
  • Loading branch information
Mark-Zeng and taranjeet committed Sep 3, 2023
1 parent c07fbc0 commit 2aa25a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion embedchain/vectordb/chroma_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, db_dir=None, embedding_fn=None, host=None, port=None):

if host and 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:
if db_dir is None:
db_dir = "db"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ color = true
[tool.poetry.dependencies]
python = ">=3.9,<3.9.7 || >3.9.7,<4.0"
python-dotenv = "^1.0.0"
langchain = "^0.0.237"
langchain = "^0.0.279"
requests = "^2.31.0"
openai = "^0.27.5"
tiktoken = "^0.4.0"
Expand Down
17 changes: 5 additions & 12 deletions tests/vectordb/test_chroma_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import unittest
from unittest.mock import patch

from chromadb.config import Settings

from embedchain import App
from embedchain.config import AppConfig
from embedchain.vectordb.chroma_db import ChromaDB, chromadb
from embedchain.vectordb.chroma_db import ChromaDB


class TestChromaDbHosts(unittest.TestCase):
Expand All @@ -18,15 +16,10 @@ def test_init_with_host_and_port(self):
host = "test-host"
port = "1234"

with patch.object(chromadb, "HttpClient") as mock_client:
_db = ChromaDB(host=host, port=port, embedding_fn=len)

expected_settings = Settings(
chroma_server_host="test-host",
chroma_server_http_port="1234",
)

mock_client.assert_called_once_with(expected_settings)
db = ChromaDB(host=host, port=port, embedding_fn=len)
settings = db.client.get_settings()
self.assertEqual(settings.chroma_server_host, host)
self.assertEqual(settings.chroma_server_http_port, port)


# Review this test
Expand Down

0 comments on commit 2aa25a5

Please sign in to comment.