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

feat: Add a new "owner" field to the reminders

Clémence Lesné088fa600be2b
diff --git a/main.py b/main.py
index cc6113a..a6a15dc 100644
--- a/main.py
+++ b/main.py
@@ -686,6 +686,10 @@ async def gpt_chat(call: CallModel) -> ActionModel:
"description": "Short title of the reminder. Should be short and concise, in the format 'Verb + Subject'. Title is unique and allows the reminder to be updated. Example: 'Call back customer', 'Send analysis report', 'Study replacement estimates for the stolen watch'.",
"type": "string",
},
+ "owner": {
+ "description": "The owner of the reminder. Can be 'customer', 'assistant', or a third party from the claim. Try to be as specific as possible, with a name. Example: 'customer', 'assistant', 'policyholder', 'witness', 'police'.",
+ "type": "string",
+ },
f"{customer_response_prop}": {
"description": "The text to be read to the customer to confirm the reminder. Only speak about this action. Use an imperative sentence. Example: 'I am creating a reminder for next week to call back the customer', 'I am creating a reminder for next week to send the report'.",
"type": "string",
@@ -696,6 +700,7 @@ async def gpt_chat(call: CallModel) -> ActionModel:
"description",
"due_date_time",
"title",
+ "owner",
],
"type": "object",
},
@@ -787,6 +792,7 @@ async def gpt_chat(call: CallModel) -> ActionModel:
if reminder.title == parameters["title"]:
reminder.description = parameters["description"]
reminder.due_date_time = parameters["due_date_time"]
+ reminder.owner = parameters["owner"]
model.content = (
f"Reminder \"{parameters['title']}\" updated."
)
diff --git a/models/reminder.py b/models/reminder.py
index 6fe2b08..0d95fc6 100644
--- a/models/reminder.py
+++ b/models/reminder.py
@@ -1,4 +1,5 @@
from datetime import datetime
+from typing import Optional
from pydantic import BaseModel, Field
@@ -6,4 +7,5 @@ class ReminderModel(BaseModel):
created_at: datetime = Field(default_factory=datetime.utcnow, frozen=True)
description: str
due_date_time: str
+ owner: Optional[str] = None # Optional for backwards compatibility
title: str