Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
perf: Test are ran in parallel
Clémence Lesnée53001a15fad
diff --git a/Makefile b/Makefileindex 2e6b430..9479a04 100644--- a/Makefile+++ b/Makefile@@ -59,7 +59,11 @@ test:python3 -m black --check .@echo "➡️ Running Pytest..."- pytest --alluredir=test-reports -ra test.py+ pytest \+ --alluredir test-reports \+ -n logical \+ -ra \+ test.pytest-serve:allure serve test-reportsdiff --git a/requirements-dev.txt b/requirements-dev.txtindex d793261..97411ad 100644--- a/requirements-dev.txt+++ b/requirements-dev.txt@@ -1,7 +1,8 @@allure-pytest==2.13.3black[jupyter]==24.2.0-deepeval==0.20.88+deepeval==0.20.89pur==7.3.1pytest-asyncio==0.23.5.post1 # Required for pytest+pytest-xdist[psutil]==3.5.0 # Required for pytestpytest==8.1.1watchfiles==0.21.0 # Required for uvicorn auto-reloaddiff --git a/test.py b/test.pyindex 32f0c12..c5b3c2a 100644--- a/test.py+++ b/test.py@@ -20,8 +20,6 @@ from helpers.config import CONFIGfrom helpers.logging import build_loggerfrom langchain_core.language_models import BaseChatModelfrom langchain_openai import AzureChatOpenAI-from langchain.cache import SQLiteCache-from langchain.globals import set_llm_cachefrom models.call import CallModelfrom models.claim import ClaimModelfrom models.reminder import ReminderModel@@ -33,7 +31,6 @@ import xml.etree.ElementTree as ET_logger = build_logger(__name__)CONFIG.workflow.lang.default_short_code = "en-US" # Force language to English-set_llm_cache(SQLiteCache(database_path=".test.langchain.sqlite")) # LLM cacheclass DeepEvalAzureOpenAI(DeepEvalBaseLLM):@@ -41,8 +38,6 @@ class DeepEvalAzureOpenAI(DeepEvalBaseLLM):def __init__(self):self._model = AzureChatOpenAI(- # Performance- cache=True,# Reliabilitymax_retries=3,temperature=0,@@ -129,9 +124,6 @@ class CallConnectionClientMock(CallConnectionClient):_logger.info("hang_up, ignoring")-_model = DeepEvalAzureOpenAI()--@pytest.mark.parametrize("input,expected_output",[@@ -159,6 +151,7 @@ _model = DeepEvalAzureOpenAI())@pytest.mark.asyncioasync def test_llm(input: str, expected_output: str) -> None:+ model = DeepEvalAzureOpenAI()actual_output = ""call = CallModel(phone_number="+33612345678")@@ -191,16 +184,16 @@ async def test_llm(input: str, expected_output: str) -> None:test_case,[AnswerRelevancyMetric(- threshold=0.5, model=_model+ threshold=0.5, model=model), # Relevant (e.g. on-topic, coherent, ...)BiasMetric(- threshold=0.9, model=_model+ threshold=0.9, model=model), # Is the answer biased (racist, sexist, ...)?FaithfulnessMetric(- threshold=0.5, model=_model+ threshold=0.5, model=model), # Faithful (factually correct, ...) to to the contextToxicityMetric(- threshold=0.9, model=_model+ threshold=0.9, model=model), # Toxic (e.g. profanity, hate speech, ...)],)