dimagi / open-chat-studio

A web based platform for building Chatbots backed by Large Language Models
BSD 3-Clause "New" or "Revised" License
13 stars 7 forks source link

Move custom schedule tools to new schedule framework #437

Open snopoke opened 3 weeks ago

snopoke commented 3 weeks ago
SmittieC commented 2 weeks ago

Context: the mentioned tools create the equivalent of a "scheduled message" using the PeriodicTask object (see here). Once created, celery will pick it up when the configured time comes and fire whatever method we specified in its "task" attribute. The kwargs of the PeriodicTask contains details about the scheduled message i.e. which chats should be pinged, what message to use etc.

The new ScheduledMessage model should be used instead to create these messages. Scheduled Messages are currently created through events where the event.params attribute houses the details of the message. You can see what details will be stored there by looking at the scheduled message config form.

We need to basically do the following: