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

doc: Code comments

Clémence Lesné17d3f5fa10e2
diff --git a/helpers/llm.py b/helpers/llm.py
index 00be314..1cf58de 100644
--- a/helpers/llm.py
+++ b/helpers/llm.py
@@ -274,10 +274,12 @@ async def _use_oai() -> AsyncGenerator[AsyncAzureOpenAI, None]:
@asynccontextmanager
async def _use_contentsafety() -> AsyncGenerator[ContentSafetyClient, None]:
client = ContentSafetyClient(
+ # Azure deployment
+ endpoint=CONFIG.content_safety.endpoint,
+ # Authentication with API key
credential=AzureKeyCredential(
CONFIG.content_safety.access_key.get_secret_value()
),
- endpoint=CONFIG.content_safety.endpoint,
)
yield client
await client.close()
diff --git a/persistence/cosmos.py b/persistence/cosmos.py
index 1a915f9..1dedf48 100644
--- a/persistence/cosmos.py
+++ b/persistence/cosmos.py
@@ -114,9 +114,12 @@ class CosmosStore(IStore):
@asynccontextmanager
async def _use_db(self) -> AsyncGenerator[ContainerProxy, None]:
client = CosmosClient(
+ # Reliability
connection_timeout=5,
- credential=self._config.access_key.get_secret_value(),
+ # Azure deployment
url=self._config.endpoint,
+ # Authentication with API key
+ credential=self._config.access_key.get_secret_value(),
)
database = client.get_database_client(self._config.database)
yield database.get_container_client(self._config.container)