]> git.giacomolli.uk - onechat/blobdiff - prompt.go
Log Telegram outages once in plain words
[onechat] / prompt.go
index 8210575e99ce2e4db0926cacc6075fa5e322ce6a..465029c927a062107e1c25d54f7aa64f592676cf 100644 (file)
--- a/prompt.go
+++ b/prompt.go
@@ -185,9 +185,9 @@ func promptSubagent(name, instructions string) string {
 }
 
 // promptTools returns the function tools of every call of the agent: the tools
 }
 
 // promptTools returns the function tools of every call of the agent: the tools
-// of promptSubagentTools, then spawn, tell, and the WhatsApp tools. A
-// compaction sends them too and never calls them, because a change of the tools
-// ends the shared prompt cache.
+// of promptSubagentTools, then spawn, tell, the WhatsApp tools, and the
+// schedule tools. A compaction sends them too and never calls them, because a
+// change of the tools ends the shared prompt cache.
 func promptTools() []ModelTool {
        return append(promptSubagentTools(), ModelTool{
                Type:        "function",
 func promptTools() []ModelTool {
        return append(promptSubagentTools(), ModelTool{
                Type:        "function",
@@ -233,6 +233,30 @@ func promptTools() []ModelTool {
                        "text": promptStringSchema("The text of the message."),
                }),
                Strict: true,
                        "text": promptStringSchema("The text of the message."),
                }),
                Strict: true,
+       }, ModelTool{
+               Type:        "function",
+               Name:        "schedule_set",
+               Description: `Set a reminder or a timed task, only when the user asks for one. At its time, the text reaches you as a message "[Schedule ID]" that starts a turn, and you do the task then. Give at for one time, or cron for a repeating schedule, and null for the other. Turn a time such as "tomorrow at 9" into a local time from the Now line.`,
+               Parameters: promptObjectSchema(map[string]any{
+                       "text": promptStringSchema(`The task for you at that time, as an order to yourself, with all you need to know, such as "Remind the user to drink water."`),
+                       "at":   promptNullableStringSchema("A local time YYYY-MM-DD HH:MM after now, or null."),
+                       "cron": promptNullableStringSchema(`A cron expression of five fields, minute hour day-of-month month day-of-week, with *, lists, ranges, and steps, such as "0 8 * * 1-5", or null. Its runs must be at least 5 minutes apart.`),
+               }),
+               Strict: true,
+       }, ModelTool{
+               Type:        "function",
+               Name:        "schedule_list",
+               Description: "List the schedules by their next time, each as ID | next time | cron expression or once | text.",
+               Parameters:  promptObjectSchema(map[string]any{}),
+               Strict:      true,
+       }, ModelTool{
+               Type:        "function",
+               Name:        "schedule_remove",
+               Description: "Remove a schedule by its ID, when the user asks.",
+               Parameters: promptObjectSchema(map[string]any{
+                       "id": promptIntegerSchema("The ID of the schedule."),
+               }),
+               Strict: true,
        })
 }
 
        })
 }