Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
fix: Create path if not exists
Clémence Lesnéb03f638adc8a
diff --git a/main.py b/main.pyindex fe9b91a..c2ec8b7 100644--- a/main.py+++ b/main.py@@ -37,6 +37,7 @@ from openai import AsyncAzureOpenAIfrom uuid import UUID, uuid4import jsonimport aiosqlite+import os_logger = build_logger(__name__)@@ -951,7 +952,14 @@ async def callback_url(caller_id: str) -> str:async def init_db():- async with aiosqlite.connect(CONFIG.database.sqlite_path) as db:+ # Create folder+ db_path = CONFIG.database.sqlite_path+ db_folder = db_path[: db_path.rfind("/")]+ if not os.path.exists(db_folder):+ os.makedirs(db_folder)++ # Create table+ async with aiosqlite.connect(db_path) as db:await db.execute("CREATE TABLE IF NOT EXISTS calls (id VARCHAR(32) PRIMARY KEY, phone_number TEXT, data TEXT, created_at TEXT)")