[Bug Fix]: Fix test cases and update version to 0.1.93 (#1303)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user