Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
refacto: Code comments
Clémence Lesnéa711c42ba55f
diff --git a/helpers/config_models/root.py b/helpers/config_models/root.pyindex 959feac..92741e6 100644--- a/helpers/config_models/root.py+++ b/helpers/config_models/root.py@@ -12,6 +12,9 @@ from pydantic_settings import BaseSettingsclass RootModel(BaseSettings, env_prefix=""):+ # Immutable fields+ version: str = Field(frozen=True)+ # Editable fieldsapi: ApiModelcognitive_service: CognitiveServiceModelcommunication_service: CommunicationServiceModel@@ -20,5 +23,4 @@ class RootModel(BaseSettings, env_prefix=""):openai: OpenAiModelprompts: PromptsModel = PromptsModel() # Object is fully defined by defaultresources: ResourcesModel- version: str = Field(frozen=True)workflow: WorkflowModeldiff --git a/models/call.py b/models/call.pyindex 04bf45e..86d8d92 100644--- a/models/call.py+++ b/models/call.py@@ -9,9 +9,11 @@ from uuid import UUID, uuid4class CallModel(BaseModel):+ # Immutable fieldscall_id: UUID = Field(default_factory=uuid4, frozen=True)- claim: ClaimModel = Field(default_factory=ClaimModel)created_at: datetime = Field(default_factory=datetime.utcnow, frozen=True)+ # Editable fields+ claim: ClaimModel = Field(default_factory=ClaimModel)messages: List[MessageModel] = []phone_number: strrecognition_retry: int = Field(default=0)diff --git a/models/message.py b/models/message.pyindex 234379f..9107f37 100644--- a/models/message.py+++ b/models/message.py@@ -25,8 +25,10 @@ class ToolModel(BaseModel):class MessageModel(BaseModel):+ # Immutable fields+ created_at: datetime = Field(default_factory=datetime.utcnow, frozen=True)+ # Editable fieldsaction: Action = Action.TALKcontent: str- created_at: datetime = Field(default_factory=datetime.utcnow, frozen=True)persona: Personatool_calls: List[ToolModel] = []diff --git a/models/reminder.py b/models/reminder.pyindex 0d95fc6..658def9 100644--- a/models/reminder.py+++ b/models/reminder.py@@ -4,7 +4,9 @@ from pydantic import BaseModel, Fieldclass ReminderModel(BaseModel):+ # Immutable fieldscreated_at: datetime = Field(default_factory=datetime.utcnow, frozen=True)+ # Editable fieldsdescription: strdue_date_time: strowner: Optional[str] = None # Optional for backwards compatibility