Add configurable AI operator persona

This commit is contained in:
Magzhan Zhumabayev
2026-05-11 17:37:26 +05:00
parent 67a0255c0d
commit ce3ba270aa
11 changed files with 473 additions and 19 deletions
+33
View File
@@ -151,6 +151,39 @@ class VoiceTTSConfigOut(BaseModel):
voice_options: dict[str, dict[str, list[VoiceTTSVoiceOption]]] = Field(default_factory=dict)
class AIOperatorConfig(BaseModel):
agent_name: str = Field(default="Айнур", min_length=1)
company_name: str = Field(default="DigiOps", min_length=1)
base_system_prompt: str = Field(min_length=1)
identity_reply_ru: str = Field(min_length=1)
identity_reply_kz: str = Field(min_length=1)
voice_greeting_ru: str = Field(min_length=1)
voice_greeting_kz: str = Field(min_length=1)
@field_validator(
"agent_name",
"company_name",
"base_system_prompt",
"identity_reply_ru",
"identity_reply_kz",
"voice_greeting_ru",
"voice_greeting_kz",
mode="before",
)
@classmethod
def _trim_required_text(cls, value: str) -> str:
normalized = str(value or "").strip()
if not normalized:
raise ValueError("Text value is required")
return normalized
class AIOperatorConfigOut(BaseModel):
config: AIOperatorConfig
updated_at: str | None = None
source: Literal["defaults", "database"] = "defaults"
class HealthResponse(BaseModel):
status: str
service: str