feat: make ai_operator_settings config code the source of truth

Add sync_ai_operator_config_from_code() which overwrites the DB-cached
ai_operator_settings row from ai_operator_default_config() on startup
of ai_orchestrator_service and ai_voice_runtime_service. Greeting and
system prompt changes now go through git + deploy instead of manual
psql/API edits to prod. Also adds a root README pointing to existing docs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-21 21:00:34 +05:00
co-authored by Claude Sonnet 5
parent 6d9b0ce98a
commit c5dd87ee32
4 changed files with 67 additions and 1 deletions
+10
View File
@@ -82,3 +82,13 @@ def save_ai_operator_config(
session.commit()
session.refresh(row)
return AIOperatorConfigOut(config=config, updated_at=row.updated_at, source="database")
def sync_ai_operator_config_from_code(session) -> AIOperatorConfigOut:
"""Overwrite the DB-stored config with the code defaults.
Called on service startup so `ai_operator_default_config()` is the
source of truth: edit it, deploy, and the DB row is overwritten to match.
Any manual edits made via the API/psql since the last deploy are lost.
"""
return save_ai_operator_config(session, ai_operator_default_config())