Skip to content

Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!

Python

fix: Serialize claim data with datetime objects

Clémence Lesné21c29d74a4d5
diff --git a/models/call.py b/models/call.py
index 92092ed..3b83b3e 100644
--- a/models/call.py
+++ b/models/call.py
@@ -62,7 +62,12 @@ class CallGetModel(BaseModel):
if not initiate:
return {}
return (
- initiate.claim_model().model_validate(claim).model_dump(exclude_none=True)
+ initiate.claim_model()
+ .model_validate(claim)
+ .model_dump(
+ exclude_none=True,
+ mode="json", # Field must be serialized as JSON in other parts of the code
+ )
)