Skip to content

Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!

Python

security: Upgrade deps

Clémence Lesné9c3908170fa7
diff --git a/requirements-dev.txt b/requirements-dev.txt
index dc20b0d..5ac4432 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,9 +1,9 @@
black[jupyter]==24.4.2
deepeval==0.21.59
deptry==0.16.1
-pur==7.3.1
+pur==7.3.2
pytest-assume==2.4.3
pytest-asyncio==0.23.7 # Required for pytest
pytest-repeat==0.9.3 # Required for pytest
pytest-xdist[psutil]==3.6.1 # Required for pytest
-pytest==8.2.1
+pytest==8.2.2
diff --git a/requirements.txt b/requirements.txt
index 062a98c..54acd84 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,32 +5,32 @@ azure-ai-translation-text==1.0.0
azure-communication-callautomation==1.2.0
azure-communication-sms==1.0.1
azure-cosmos==4.7.0
-azure-eventgrid==4.19.0
-azure-functions==1.19.0
-azure-identity==1.16.0 # Required for all Azure SDKs
-azure-monitor-opentelemetry==1.4.2
+azure-eventgrid==4.20.0
+azure-functions==1.20.0
+azure-identity==1.17.0 # Required for all Azure SDKs
+azure-monitor-opentelemetry==1.6.0
azure-search-documents==11.6.0b4
azure-storage-queue==12.10.0
django-htmlmin==0.11.0
jinja2==3.1.4
-json-repair==0.20.1
+json-repair==0.25.1
mistune==3.0.2
-openai==1.35.2
+openai==1.35.3
opentelemetry-instrumentation-aiohttp-client==0.46b0
opentelemetry-instrumentation-httpx==0.46b0
-opentelemetry-instrumentation-openai==0.21.4
+opentelemetry-instrumentation-openai==0.23.0
opentelemetry-instrumentation-redis==0.46b0
opentelemetry-instrumentation-sqlite3==0.46b0
opentelemetry-semantic-conventions==0.46b0
-phonenumbers==8.13.37 # Required for pydantic-extra-types
-pydantic-extra-types==2.7.0 # Required for pydantic
-pydantic-settings==2.2.1
+phonenumbers==8.13.39 # Required for pydantic-extra-types
+pydantic-extra-types==2.8.2 # Required for pydantic
+pydantic-settings==2.3.3
pydantic[email]==2.7.4
python-dotenv==1.0.1
pytz==2024.1
pyyaml==6.0.1
-redis==5.0.4
+redis==5.0.6
tenacity==8.2.3
tiktoken==0.7.0
-twilio==9.1.0
-typing-extensions==4.12.0
+twilio==9.2.1
+typing-extensions==4.12.2
diff --git a/tests/conftest.py b/tests/conftest.py
index 89f9f84..dcdeb59 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -165,8 +165,18 @@ class DeepEvalAzureOpenAI(GPTModel):
self._cache = cache
self._model = AzureChatOpenAI(**_langchain_kwargs)
- def generate(self, *args, **kwargs):
- raise NotImplementedError
+ def generate(self, prompt: str) -> Tuple[str, float]:
+ prompt = dedent(prompt).strip()
+ cache_key = self._cache_key(prompt)
+ # Try cache
+ content: Tuple[str, float] = self._cache.get(cache_key, None)
+ if content:
+ return content
+ # Try live
+ res = super().generate(prompt)
+ # Update cache
+ self._cache.set(cache_key, res)
+ return res
async def a_generate(self, prompt: str) -> Tuple[str, float]:
prompt = dedent(prompt).strip()
diff --git a/tests/llm.py b/tests/llm.py
index a026087..ad9678f 100644
--- a/tests/llm.py
+++ b/tests/llm.py
@@ -42,6 +42,7 @@ class ClaimRelevancyMetric(BaseMetric):
model: GPTModel,
threshold: float = 0.5,
):
+ super().__init__()
self.call = call
self.model = model
self.threshold = threshold
@@ -203,7 +204,8 @@ class ClaimRelevancyMetric(BaseMetric):
return {
extract["key"]: extract["value"]
for extract in extracts
- if extract["value"]
+ if "value" in extract
+ and "key" in extract
and any(
claim_field.name == extract["key"]
for claim_field in self.call.initiate.claim