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:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user