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.pyindex 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 TranslatedTextItemfrom azure.core.credentials import AzureKeyCredential+from azure.core.exceptions import HttpResponseErrorfrom contextlib import asynccontextmanagerfrom helpers.config import CONFIGfrom helpers.logging import build_loggerfrom typing import AsyncGenerator, Optional-from azure.core.exceptions import HttpResponseErrorfrom 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] = Noneasync with _use_client() as client: # Perform translationres: 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 Nonediff --git a/requirements-dev.txt b/requirements-dev.txtindex 78edb6a..05995d9 100644--- a/requirements-dev.txt+++ b/requirements-dev.txt@@ -1,10 +1,10 @@allure-pytest==2.13.5 # Required for pytestblack[jupyter]==24.4.2-deepeval==0.21.42+deepeval==0.21.47deptry==0.16.1pur==7.3.1pytest-assume==2.4.3-pytest-asyncio==0.23.6 # Required for pytest+pytest-asyncio==0.23.7 # Required for pytestpytest-repeat==0.9.3 # Required for pytestpytest-xdist[psutil]==3.6.1 # Required for pytest-pytest==8.2.0+pytest==8.2.1diff --git a/requirements.txt b/requirements.txtindex 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-cosmosaiosqlite==0.20.0azure-ai-contentsafety==1.0.0-azure-ai-translation-text==1.0.0b1+azure-ai-translation-text==1.0.0azure-communication-callautomation==1.2.0azure-communication-sms==1.0.1-azure-cosmos==4.6.0+azure-cosmos==4.7.0azure-eventgrid==4.19.0azure-identity==1.16.0 # Required for all Azure SDKs-azure-monitor-opentelemetry==1.4.1+azure-monitor-opentelemetry==1.4.2azure-search-documents==11.6.0b3django-htmlmin==0.11.0fastapi==0.111.0gunicorn==22.0.0jinja2==3.1.4-json-repair==0.19.1+json-repair==0.20.1mistune==3.0.2-openai==1.29.0+openai==1.30.3opentelemetry-instrumentation-aiohttp-client==0.45b0opentelemetry-instrumentation-fastapi==0.45b0opentelemetry-instrumentation-httpx==0.45b0-opentelemetry-instrumentation-openai==0.17.7+opentelemetry-instrumentation-openai==0.21.0opentelemetry-instrumentation-redis==0.45b0opentelemetry-instrumentation-sqlite3==0.45b0-phonenumbers==8.13.36 # Required for pydantic-extra-types+phonenumbers==8.13.37 # Required for pydantic-extra-typespydantic-extra-types==2.7.0 # Required for pydanticpydantic-settings==2.2.1pydantic[email]==2.7.1@@ -30,8 +30,8 @@ python-dotenv==1.0.1pytz==2024.1pyyaml==6.0.1redis==5.0.4-tenacity==8.2.3+tenacity==8.3.0tiktoken==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