Add configurable AI operator persona
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user