Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
quality: Code comments
Clémence Lesné9dd3dc09529b
diff --git a/persistence/ai_search.py b/persistence/ai_search.pyindex abfe4f5..076c072 100644--- a/persistence/ai_search.py+++ b/persistence/ai_search.py@@ -128,6 +128,9 @@ class AiSearchSearch(ISearch):@asynccontextmanagerasync def _use_db(self) -> AsyncGenerator[SearchClient, None]:+ """+ Generate the AI Search client and close it after use.+ """db = SearchClient(credential=AzureKeyCredential(self._config.access_key.get_secret_value()),endpoint=self._config.endpoint,diff --git a/persistence/cosmos_db.py b/persistence/cosmos_db.pyindex 6323a5b..4612964 100644--- a/persistence/cosmos_db.py+++ b/persistence/cosmos_db.py@@ -139,6 +139,9 @@ class CosmosDbStore(IStore):@asynccontextmanagerasync def _use_db(self) -> AsyncGenerator[ContainerProxy, None]:+ """+ Generate the Cosmos DB client and close it after use.+ """client = CosmosClient(# Reliabilityconnection_timeout=10,diff --git a/persistence/redis.py b/persistence/redis.pyindex 5799739..884aa77 100644--- a/persistence/redis.py+++ b/persistence/redis.py@@ -48,6 +48,9 @@ class RedisCache(ICache):@asynccontextmanagerasync def _use_db(self) -> AsyncGenerator[Redis, None]:+ """+ Generate the Redis client and close it after use.+ """client = Redis(# Database locationdb=self._config.database,diff --git a/persistence/sqlite.py b/persistence/sqlite.pyindex 09a62f0..8946ec3 100644--- a/persistence/sqlite.py+++ b/persistence/sqlite.py@@ -123,6 +123,9 @@ class SqliteStore(IStore):@asynccontextmanagerasync def _use_db(self) -> AsyncGenerator[SQLiteConnection, None]:+ """+ Generate the SQLite client and close it after use.+ """# Create folderdb_path = self._config.full_path()first_run = False