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é68bf0807f14f
diff --git a/helpers/translation.py b/helpers/translation.py
index e6d9b36..bea453b 100644
--- a/helpers/translation.py
+++ b/helpers/translation.py
@@ -1,16 +1,16 @@
from azure.ai.translation.text.aio import TextTranslationClient
-from azure.ai.translation.text.models import InputTextItem, TranslatedTextItem
+from azure.ai.translation.text.models import TranslatedTextItem
from azure.core.credentials import AzureKeyCredential
+from azure.core.exceptions import HttpResponseError
from contextlib import asynccontextmanager
from helpers.config import CONFIG
from helpers.logging import build_logger
from typing import AsyncGenerator, Optional
-from azure.core.exceptions import HttpResponseError
from tenacity import (
+ retry_if_exception_type,
retry,
stop_after_attempt,
wait_random_exponential,
- retry_if_exception_type,
)
@@ -47,9 +47,9 @@ async def translate_text(
translation: Optional[str] = None
async with _use_client() as client: # Perform translation
res: list[TranslatedTextItem] = await client.translate(
- content=[InputTextItem(text=text)], # type: ignore
- from_parameter=source_lang,
- to=[target_lang],
+ body=[text],
+ from_language=source_lang,
+ to_language=[target_lang],
)
translation = (
res[0].translations[0].text if res and res[0].translations else None
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 78edb6a..05995d9 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,10 +1,10 @@
allure-pytest==2.13.5 # Required for pytest
black[jupyter]==24.4.2
-deepeval==0.21.42
+deepeval==0.21.47
deptry==0.16.1
pur==7.3.1
pytest-assume==2.4.3
-pytest-asyncio==0.23.6 # Required for pytest
+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.0
+pytest==8.2.1
diff --git a/requirements.txt b/requirements.txt
index 80256a7..a0539c2 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,28 +1,28 @@
aiohttp==3.9.5 # Required for azure-search-documents, azure-ai-contentsafety, azure-cosmos
aiosqlite==0.20.0
azure-ai-contentsafety==1.0.0
-azure-ai-translation-text==1.0.0b1
+azure-ai-translation-text==1.0.0
azure-communication-callautomation==1.2.0
azure-communication-sms==1.0.1
-azure-cosmos==4.6.0
+azure-cosmos==4.7.0
azure-eventgrid==4.19.0
azure-identity==1.16.0 # Required for all Azure SDKs
-azure-monitor-opentelemetry==1.4.1
+azure-monitor-opentelemetry==1.4.2
azure-search-documents==11.6.0b3
django-htmlmin==0.11.0
fastapi==0.111.0
gunicorn==22.0.0
jinja2==3.1.4
-json-repair==0.19.1
+json-repair==0.20.1
mistune==3.0.2
-openai==1.29.0
+openai==1.30.3
opentelemetry-instrumentation-aiohttp-client==0.45b0
opentelemetry-instrumentation-fastapi==0.45b0
opentelemetry-instrumentation-httpx==0.45b0
-opentelemetry-instrumentation-openai==0.17.7
+opentelemetry-instrumentation-openai==0.21.0
opentelemetry-instrumentation-redis==0.45b0
opentelemetry-instrumentation-sqlite3==0.45b0
-phonenumbers==8.13.36 # Required for pydantic-extra-types
+phonenumbers==8.13.37 # Required for pydantic-extra-types
pydantic-extra-types==2.7.0 # Required for pydantic
pydantic-settings==2.2.1
pydantic[email]==2.7.1
@@ -30,8 +30,8 @@ python-dotenv==1.0.1
pytz==2024.1
pyyaml==6.0.1
redis==5.0.4
-tenacity==8.2.3
+tenacity==8.3.0
tiktoken==0.7.0
-twilio==9.0.5
-typing-extensions==4.11.0
-uvicorn[standard]==0.29.0 # Required for Gunicorn
+twilio==9.1.0
+typing-extensions==4.12.0
+uvicorn[standard]==0.30.0 # Required for Gunicorn