The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.
Python agentic-memoryagentic-memory-systemagentsaiai-agentschatgptgenaillmlong-term-memorymemorymemory-managementpythonragstate-management
[ Fix ] for the failing embedchain tests (#1899)
Parshva Daftari44ee48e924a0
diff --git a/embedchain/embedchain/config/model_prices_and_context_window.json b/embedchain/embedchain/config/model_prices_and_context_window.jsonindex 744a09c08..c68f90394 100644--- a/embedchain/embedchain/config/model_prices_and_context_window.json+++ b/embedchain/embedchain/config/model_prices_and_context_window.json@@ -13,14 +13,14 @@"input_cost_per_token": 0.000005,"output_cost_per_token": 0.000015},- "gpt-4o-mini": {+ "openai/gpt-4o-mini": {"max_tokens": 4096,"max_input_tokens": 128000,"max_output_tokens": 4096,"input_cost_per_token": 0.00000015,"output_cost_per_token": 0.00000060},- "gpt-4o-mini-2024-07-18": {+ "openai/gpt-4o-mini-2024-07-18": {"max_tokens": 4096,"max_input_tokens": 128000,"max_output_tokens": 4096,diff --git a/embedchain/poetry.lock b/embedchain/poetry.lockindex e986bdc02..e35ee8d32 100644--- a/embedchain/poetry.lock+++ b/embedchain/poetry.lock@@ -2364,19 +2364,19 @@ tests = ["aiohttp", "boto3", "duckdb", "pandas (>=1.4)", "polars (>=0.19)", "pyt[[package]]name = "langchain"-version = "0.2.7"+version = "0.2.16"description = "Building applications with LLMs through composability"optional = falsepython-versions = "<4.0,>=3.8.1"files = [- {file = "langchain-0.2.7-py3-none-any.whl", hash = "sha256:98e79e0b9a60a9c740b44d5b0135c85f649219308f30d373cf5f10d0efe18b87"},- {file = "langchain-0.2.7.tar.gz", hash = "sha256:8742f363d2890854501e0075af04fcb470600f201dec251c9bd5841e1990e73d"},+ {file = "langchain-0.2.16-py3-none-any.whl", hash = "sha256:8f59ee8b45f268df4b924ea3b9c63e49286efa756d16b3f6a9de5c6e502c36e1"},+ {file = "langchain-0.2.16.tar.gz", hash = "sha256:ffb426a76a703b73ac69abad77cd16eaf03dda76b42cff55572f592d74944166"},][package.dependencies]aiohttp = ">=3.8.3,<4.0.0"async-timeout = {version = ">=4.0.0,<5.0.0", markers = "python_version < \"3.11\""}-langchain-core = ">=0.2.12,<0.3.0"+langchain-core = ">=0.2.38,<0.3.0"langchain-text-splitters = ">=0.2.0,<0.3.0"langsmith = ">=0.1.17,<0.2.0"numpy = [@@ -2428,21 +2428,21 @@ langchain-community = ["langchain-community (>=0.2.4)"][[package]]name = "langchain-community"-version = "0.2.7"+version = "0.2.17"description = "Community contributed LangChain integrations."optional = falsepython-versions = "<4.0,>=3.8.1"files = [- {file = "langchain_community-0.2.7-py3-none-any.whl", hash = "sha256:c236e74249ab68a318c94c95327cbe75a76489b61f7bf93f14117d9233ce70b1"},- {file = "langchain_community-0.2.7.tar.gz", hash = "sha256:f52659dbb8a8f0c011cc7d634247686d11d768843cc3e5fe9e6f52321cde82c0"},+ {file = "langchain_community-0.2.17-py3-none-any.whl", hash = "sha256:d07c31b641e425fb8c3e7148ad6a62e1b54a9adac6e1173021a7dd3148266063"},+ {file = "langchain_community-0.2.17.tar.gz", hash = "sha256:b0745c1fcf1bd532ed4388f90b47139d6a6c6ba48a87aa68aa32d4d6bb97259d"},][package.dependencies]aiohttp = ">=3.8.3,<4.0.0"dataclasses-json = ">=0.5.7,<0.7"-langchain = ">=0.2.7,<0.3.0"-langchain-core = ">=0.2.12,<0.3.0"-langsmith = ">=0.1.0,<0.2.0"+langchain = ">=0.2.16,<0.3.0"+langchain-core = ">=0.2.39,<0.3.0"+langsmith = ">=0.1.112,<0.2.0"numpy = [{version = ">=1,<2", markers = "python_version < \"3.12\""},{version = ">=1.26.0,<2.0.0", markers = "python_version >= \"3.12\""},@@ -2454,18 +2454,18 @@ tenacity = ">=8.1.0,<8.4.0 || >8.4.0,<9.0.0"[[package]]name = "langchain-core"-version = "0.2.17"+version = "0.2.41"description = "Building applications with LLMs through composability"optional = falsepython-versions = "<4.0,>=3.8.1"files = [- {file = "langchain_core-0.2.17-py3-none-any.whl", hash = "sha256:f8b4f64c95b381bd3ac4322bafa9ecee3ca3970aa0aa2829ef11175bcad27249"},- {file = "langchain_core-0.2.17.tar.gz", hash = "sha256:f9b8d0f7b5f339ac62e11c417181e87f54e9282af82d1a64c8a7427f3d5d9118"},+ {file = "langchain_core-0.2.41-py3-none-any.whl", hash = "sha256:3278fda5ba9a05defae8bb19f1226032add6aab21917db7b3bc74e750e263e84"},+ {file = "langchain_core-0.2.41.tar.gz", hash = "sha256:bc12032c5a298d85be754ccb129bc13ea21ccb1d6e22f8d7ba18b8da64315bb5"},][package.dependencies]jsonpatch = ">=1.33,<2.0"-langsmith = ">=0.1.75,<0.2.0"+langsmith = ">=0.1.112,<0.2.0"packaging = ">=23.2,<25"pydantic = [{version = ">=1,<3", markers = "python_full_version < \"3.12.4\""},@@ -2473,6 +2473,7 @@ pydantic = []PyYAML = ">=5.3"tenacity = ">=8.1.0,<8.4.0 || >8.4.0,<9.0.0"+typing-extensions = ">=4.7"[[package]]name = "langchain-experimental"@@ -2557,16 +2558,17 @@ langchain-core = ">=0.2.10,<0.3.0"[[package]]name = "langsmith"-version = "0.1.85"+version = "0.1.126"description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform."optional = falsepython-versions = "<4.0,>=3.8.1"files = [- {file = "langsmith-0.1.85-py3-none-any.whl", hash = "sha256:c1f94384f10cea96f7b4d33fd3db7ec180c03c7468877d50846f881d2017ff94"},- {file = "langsmith-0.1.85.tar.gz", hash = "sha256:acff31f9e53efa48586cf8e32f65625a335c74d7c4fa306d1655ac18452296f6"},+ {file = "langsmith-0.1.126-py3-none-any.whl", hash = "sha256:16c38ba5dae37a3cc715b6bc5d87d9579228433c2f34d6fa328345ee2b2bcc2a"},+ {file = "langsmith-0.1.126.tar.gz", hash = "sha256:40f72e2d1d975473dd69269996053122941c1252915bcea55787607e2a7f949a"},][package.dependencies]+httpx = ">=0.23.0,<1"orjson = ">=3.9.14,<4.0.0"pydantic = [{version = ">=1,<3", markers = "python_full_version < \"3.12.4\""},@@ -2718,21 +2720,24 @@ files = [[[package]]name = "mem0ai"-version = "0.0.20"+version = "0.1.15"description = "Long-term memory for AI Agents"optional = false-python-versions = "<4.0,>=3.8"+python-versions = "<4.0,>=3.9"files = [- {file = "mem0ai-0.0.20-py3-none-any.whl", hash = "sha256:c19b2082173c818f3516279f0924bfd763e2d18175560332c94e415e5131fd3b"},- {file = "mem0ai-0.0.20.tar.gz", hash = "sha256:459b96850156c8e51e321e3ab4e5f86fb00d75532c16ad41a3eb09578e0ce00a"},+ {file = "mem0ai-0.1.15-py3-none-any.whl", hash = "sha256:b553a8a3491565f9e52de535282304218a3773069cb4d41d2da6b4236a7b06bc"},+ {file = "mem0ai-0.1.15.tar.gz", hash = "sha256:8f0d6207da36f9ffcb3b1c5ee366f1d0f550daf577d875abc96477309ef233c8"},][package.dependencies]+langchain-community = ">=0.2.12,<0.3.0"+neo4j = ">=5.23.1,<6.0.0"openai = ">=1.33.0,<2.0.0"posthog = ">=3.5.0,<4.0.0"pydantic = ">=2.7.3,<3.0.0"pytz = ">=2024.1,<2025.0"qdrant-client = ">=1.9.1,<2.0.0"+rank-bm25 = ">=0.2.2,<0.3.0"sqlalchemy = ">=2.0.31,<3.0.0"[[package]]@@ -3056,6 +3061,25 @@ fido2 = ["fido2 (==1.1.2)"]gssapi = ["gssapi (>=1.6.9,<=1.8.2)"]opentelemetry = ["Deprecated (>=1.2.6)", "typing-extensions (>=3.7.4)", "zipp (>=0.5)"]+[[package]]+name = "neo4j"+version = "5.24.0"+description = "Neo4j Bolt driver for Python"+optional = false+python-versions = ">=3.7"+files = [+ {file = "neo4j-5.24.0-py3-none-any.whl", hash = "sha256:5b4705cfe8130020f33e75e31ad3fcfe67ee958e07d0c3c4936e9c8245a1ea58"},+ {file = "neo4j-5.24.0.tar.gz", hash = "sha256:499ca35135847528f4ee70314bd49c8b08b031e4dfd588bb06c1c2fb35d729e2"},+]++[package.dependencies]+pytz = "*"++[package.extras]+numpy = ["numpy (>=1.7.0,<2.0.0)"]+pandas = ["numpy (>=1.7.0,<2.0.0)", "pandas (>=1.1.0,<3.0.0)"]+pyarrow = ["pyarrow (>=1.0.0)"]+[[package]]name = "networkx"version = "3.2.1"@@ -4392,13 +4416,13 @@ diagrams = ["jinja2", "railroad-diagrams"][[package]]name = "pypdf"-version = "4.2.0"+version = "5.0.0"description = "A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files"optional = falsepython-versions = ">=3.6"files = [- {file = "pypdf-4.2.0-py3-none-any.whl", hash = "sha256:dc035581664e0ad717e3492acebc1a5fc23dba759e788e3d4a9fc9b1a32e72c1"},- {file = "pypdf-4.2.0.tar.gz", hash = "sha256:fe63f3f7d1dcda1c9374421a94c1bba6c6f8c4a62173a59b64ffd52058f846b1"},+ {file = "pypdf-5.0.0-py3-none-any.whl", hash = "sha256:67603e2e96cdf70e676564520933c017d450f16075b9966be5fee128812ace8c"},+ {file = "pypdf-5.0.0.tar.gz", hash = "sha256:5c536ec0f7af8e2f80eb32806964652a562b9abc5477b3c195e2b842725ce55b"},][package.dependencies]@@ -4694,6 +4718,23 @@ urllib3 = ">=1.26.14,<3"fastembed = ["fastembed (==0.2.7)"]fastembed-gpu = ["fastembed-gpu (==0.2.7)"]+[[package]]+name = "rank-bm25"+version = "0.2.2"+description = "Various BM25 algorithms for document ranking"+optional = false+python-versions = "*"+files = [+ {file = "rank_bm25-0.2.2-py3-none-any.whl", hash = "sha256:7bd4a95571adadfc271746fa146a4bcfd89c0cf731e49c3d1ad863290adbe8ae"},+ {file = "rank_bm25-0.2.2.tar.gz", hash = "sha256:096ccef76f8188563419aaf384a02f0ea459503fdf77901378d4fd9d87e5e51d"},+]++[package.dependencies]+numpy = "*"++[package.extras]+dev = ["pytest"]+[[package]]name = "ratelimiter"version = "1.2.0.post0"@@ -6606,4 +6647,4 @@ weaviate = ["weaviate-client"][metadata]lock-version = "2.0"python-versions = ">=3.9,<=3.13"-content-hash = "c2dca4453a3df52a16a2e10ec27760aa2c8e4f74692e19d3f4b9ddb60b3a1031"+content-hash = "d5f785b12967cb62e2924a25b67c318239537c2c79bc75268f0f9f3e0315f169"diff --git a/embedchain/pyproject.toml b/embedchain/pyproject.tomlindex c2f22044d..78047a603 100644--- a/embedchain/pyproject.toml+++ b/embedchain/pyproject.toml@@ -100,7 +100,7 @@ chromadb = "^0.4.24"posthog = "^3.0.2"rich = "^13.7.0"beautifulsoup4 = "^4.12.2"-pypdf = "^4.0.1"+pypdf = "^5.0.0"gptcache = "^0.1.43"pysbd = "^0.3.4"mem0ai = "^0.1.15"@@ -139,6 +139,7 @@ alembic = "^1.13.1"langchain-cohere = "^0.1.4"langchain-community = "^0.2.6"langchain-aws = {version = "^0.1.10", optional = true}+langsmith = "^0.1.17"[tool.poetry.group.dev.dependencies]black = "^23.3.0"diff --git a/embedchain/tests/llm/test_openai.py b/embedchain/tests/llm/test_openai.pyindex f38281bb5..5cff056ac 100644--- a/embedchain/tests/llm/test_openai.py+++ b/embedchain/tests/llm/test_openai.py@@ -85,7 +85,7 @@ def test_get_llm_model_answer_with_token_usage(config, mocker):"prompt_tokens": 1,"completion_tokens": 2,"total_tokens": 3,- "total_cost": 5.5e-06,+ "total_cost": 1.35e-06,"cost_currency": "USD",}mocked_get_answer.assert_called_once_with("Test query", test_config)