Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

[Bug Fix]: Fix test cases and update version to 0.1.93 (#1303)

Deshraj Yadav4428768eaa9d
diff --git a/embedchain/config/llm/base.py b/embedchain/config/llm/base.py
index a5a7364d7..72dfd0156 100644
--- a/embedchain/config/llm/base.py
+++ b/embedchain/config/llm/base.py
@@ -97,7 +97,6 @@ class BaseLlmConfig(BaseConfig):
endpoint: Optional[str] = None,
model_kwargs: Optional[dict[str, Any]] = None,
local: Optional[bool] = False,
- base_url: Optional[str] = None,
):
"""
Initializes a configuration class instance for the LLM.
@@ -172,7 +171,6 @@ class BaseLlmConfig(BaseConfig):
self.endpoint = endpoint
self.model_kwargs = model_kwargs
self.local = local
- self.base_url = base_url
if isinstance(prompt, str):
prompt = Template(prompt)
diff --git a/pyproject.toml b/pyproject.toml
index 8a9546c3c..4f7cb3c71 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "embedchain"
-version = "0.1.92"
+version = "0.1.93"
description = "Simplest open source retrieval(RAG) framework"
authors = [
"Taranjeet Singh <[email protected]>",
diff --git a/tests/evaluation/test_answer_relevancy_metric.py b/tests/evaluation/test_answer_relevancy_metric.py
index 8a0a0efe9..03458ed38 100644
--- a/tests/evaluation/test_answer_relevancy_metric.py
+++ b/tests/evaluation/test_answer_relevancy_metric.py
@@ -30,6 +30,7 @@ def mock_data():
@pytest.fixture
def mock_answer_relevance_metric(monkeypatch):
monkeypatch.setenv("OPENAI_API_KEY", "test_api_key")
+ monkeypatch.setenv("OPENAI_API_BASE", "test_api_base")
metric = AnswerRelevance()
return metric
diff --git a/tests/llm/test_openai.py b/tests/llm/test_openai.py
index c39d52da4..d95f942a4 100644
--- a/tests/llm/test_openai.py
+++ b/tests/llm/test_openai.py
@@ -73,6 +73,7 @@ def test_get_llm_model_answer_without_system_prompt(config, mocker):
max_tokens=config.max_tokens,
model_kwargs={"top_p": config.top_p},
api_key=os.environ["OPENAI_API_KEY"],
+ base_url=os.environ["OPENAI_API_BASE"],
)
@@ -98,6 +99,7 @@ def test_get_llm_model_answer_with_tools(config, mocker, mock_return, expected):
max_tokens=config.max_tokens,
model_kwargs={"top_p": config.top_p},
api_key=os.environ["OPENAI_API_KEY"],
+ base_url=os.environ["OPENAI_API_BASE"],
)
mocked_convert_to_openai_tool.assert_called_once_with({"test": "test"})
mocked_json_output_tools_parser.assert_called_once()
diff --git a/tests/test_app.py b/tests/test_app.py
index f230a9f9d..a2eb0132a 100644
--- a/tests/test_app.py
+++ b/tests/test_app.py
@@ -14,6 +14,7 @@ from embedchain.vectordb.chroma import ChromaDB
@pytest.fixture
def app():
os.environ["OPENAI_API_KEY"] = "test_api_key"
+ os.environ["OPENAI_API_BASE"] = "test_api_base"
return App()
diff --git a/tests/test_factory.py b/tests/test_factory.py
index b6d7f6251..c6e1ea0e5 100644
--- a/tests/test_factory.py
+++ b/tests/test_factory.py
@@ -26,6 +26,7 @@ class TestFactories:
def test_llm_factory_create(self, provider_name, config_data, expected_class):
os.environ["ANTHROPIC_API_KEY"] = "test_api_key"
os.environ["OPENAI_API_KEY"] = "test_api_key"
+ os.environ["OPENAI_API_BASE"] = "test_api_base"
llm_instance = LlmFactory.create(provider_name, config_data)
assert isinstance(llm_instance, expected_class)