Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
refacto: List editable claim fields
Clémence Lesné28d2d79e07e7
diff --git a/main.py b/main.pyindex 86e6a72..9aa1b7c 100644--- a/main.py+++ b/main.py@@ -695,9 +695,7 @@ async def gpt_chat(call: CallModel) -> ActionModel:"properties": {"field": {"description": "The claim field to update.",- "enum": list(- ClaimModel.model_json_schema()["properties"].keys()- ),+ "enum": list(ClaimModel.editable_fields()),"type": "string",},"value": {diff --git a/models/claim.py b/models/claim.pyindex 8745a6b..b22ad77 100644--- a/models/claim.py+++ b/models/claim.py@@ -1,5 +1,6 @@from pydantic import BaseModelfrom typing import Optional+from typing import Optional, Setclass ClaimModel(BaseModel):@@ -23,3 +24,7 @@ class ClaimModel(BaseModel):stolen_lost_items: Optional[str] = Nonevehicle_info: Optional[str] = Nonewitnesses: Optional[str] = None++ @staticmethod+ def editable_fields() -> Set[str]:+ return ClaimModel.model_json_schema()["properties"].keys()