Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
quality: Code quality
Clémence Lesnédb293193b457
diff --git a/requirements-dev.txt b/requirements-dev.txtindex 456c4fb..01fb9ef 100644--- a/requirements-dev.txt+++ b/requirements-dev.txt@@ -1,4 +1,4 @@-allure-pytest==2.13.3+allure-pytest==2.13.3 # Required for pytestblack[jupyter]==24.2.0deepeval==0.20.89pur==7.3.1diff --git a/tests/cache.py b/tests/cache.pyindex e25a578..c8e1216 100644--- a/tests/cache.py+++ b/tests/cache.py@@ -19,9 +19,20 @@ _cache = CONFIG.cache.instance()),],)[email protected] # Allow async functions@pytest.mark.repeat(10) # Catch multi-threading and concurrency issuesasync def test_acid(random_text: str, cache_mode: CacheModeEnum) -> None:+ """+ Test ACID properties of the cache backend.++ Steps:+ 1. Create a mock data+ 2. Test not exists+ 3. Insert test data+ 4. Check it exists++ Test is repeated 10 times to catch multi-threading and concurrency issues.+ """# Set cache modeCONFIG.cache.mode = cache_modediff --git a/tests/llm.py b/tests/llm.pyindex 9e8ef52..6e19452 100644--- a/tests/llm.py+++ b/tests/llm.py@@ -139,7 +139,7 @@ CONFIG.workflow.lang.default_short_code = "en-US" # Force language to English),],)[email protected] # Allow async functions@pytest.mark.repeat(3) # Catch non deterministic issuesasync def test_llm(call_mock: CallModel,@@ -149,6 +149,15 @@ async def test_llm(expected_output: str,inputs: list[str],) -> None:+ """+ Test the LLM with a mocked conversation against the expected output.++ Steps:+ 1. Run application with mocked inputs+ 2. Combine all outputs+ 3. Test claim data exists+ 4. Test LLM metrics+ """actual_output = ""latency_per_input = 0diff --git a/tests/search.py b/tests/search.pyindex 9fe9ff6..ade6d5c 100644--- a/tests/search.py+++ b/tests/search.py@@ -35,7 +35,7 @@ _search = CONFIG.ai_search.instance()),],)[email protected] # Allow async functions@pytest.mark.repeat(10) # Catch multi-threading and concurrency issuesasync def test_relevancy(call_mock: CallModel,@@ -43,6 +43,16 @@ async def test_relevancy(user_lang: str,user_message: str,) -> None:+ """+ Test the relevancy of the user message to the training data.++ Steps:+ 1. Search for training data+ 2. Ask the LLM for relevancy score+ 3. Assert the relevancy score is above 0.5++ Test is repeated 10 times to catch multi-threading and concurrency issues.+ """# Configure contextcall_mock.lang.short_code = user_langdiff --git a/tests/store.py b/tests/store.pyindex 209e0e0..3981745 100644--- a/tests/store.py+++ b/tests/store.py@@ -20,9 +20,20 @@ _db = CONFIG.database.instance()),],)[email protected] # Allow async functions@pytest.mark.repeat(10) # Catch multi-threading and concurrency issuesasync def test_acid(call_mock: CallModel, database_mode: DatabaseModeEnum) -> None:+ """+ Test ACID properties of the database backend.++ Steps:+ 1. Create a mock data+ 2. Test not exists+ 3. Insert test data+ 4. Check it exists++ Test is repeated 10 times to catch multi-threading and concurrency issues.+ """# Set database modeCONFIG.database.mode = database_mode