Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
quality: Use same naming over all store providers
Clémence Lesnée6ecc7e12ac9
diff --git a/persistence/cosmos_db.py b/persistence/cosmos_db.pyindex 571ec9f..b5cd07d 100644--- a/persistence/cosmos_db.py+++ b/persistence/cosmos_db.py@@ -38,7 +38,7 @@ class CosmosDbStore(IStore):)async def call_aget(self, call_id: UUID) -> Optional[CallModel]:_logger.debug(f"Loading call {call_id}")- res = None+ call = Nonetry:async with self._use_db() as db:items = db.query_items(@@ -47,14 +47,14 @@ class CosmosDbStore(IStore):)raw = await anext(items)try:- res = CallModel(**raw)+ call = CallModel(**raw)except ValidationError as e:_logger.warning(f"Error parsing call: {e.errors()}")except StopAsyncIteration:passexcept CosmosHttpResponseError as e:_logger.error(f"Error accessing CosmosDB, {e}")- return res+ return call@retry(reraise=True,@@ -82,7 +82,7 @@ class CosmosDbStore(IStore):)async def call_asearch_one(self, phone_number: str) -> Optional[CallModel]:_logger.debug(f"Loading last call for {phone_number}")- res = None+ call = Nonetry:async with self._use_db() as db:items = db.query_items(@@ -97,14 +97,14 @@ class CosmosDbStore(IStore):)raw = await anext(items)try:- res = CallModel(**raw)+ call = CallModel(**raw)except ValidationError as e:_logger.warning(f"Error parsing call: {e.errors()}")except StopAsyncIteration:passexcept CosmosHttpResponseError as e:_logger.error(f"Error accessing CosmosDB: {e}")- return res+ return call@retry(reraise=True,