X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/5a93b6124068c2a8748fc0bfbb2a2d151815bcf0..723f6e18adc6482ed913e1618c8a76e981720c2b:/prompt.go?ds=inline diff --git a/prompt.go b/prompt.go index 6bc737d..36fda32 100644 --- a/prompt.go +++ b/prompt.go @@ -149,7 +149,9 @@ Use agent_create for permanent children, whose areas are in the state. Use tell for children and subagents, and zoom("Name") for their memory. Pass area messages from mixed chats to the right child with sender, date, and words. Never send a WhatsApp reply drafted by a child without the user's -agreement.` +agreement. +Propose routing a source that talks only about one area to its child. +Set or remove a route only after the user agrees.` // promptSubagentText is the system prompt of a subagent, from the subagent // prompt of the reference design: its head, then the doc of the view, without @@ -230,8 +232,8 @@ func promptSubagent(name, instructions string) string { // promptTools returns the function tools of every call of the agent: the tools // of promptSubagentTools, then spawn, agent_create, 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. +// the route 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", @@ -286,6 +288,29 @@ func promptTools() []ModelTool { "text": promptStringSchema("The text of the message."), }), Strict: true, + }, ModelTool{ + Type: "function", + Name: "route", + Description: "Route a source to your child, only after the user agrees. Use whatsapp:CHAT-ID with the ID from whatsapp_find or a [WhatsApp] message.", + Parameters: promptObjectSchema(map[string]any{ + "source": promptStringSchema("The source key, whatsapp:CHAT-ID."), + "agent": promptStringSchema("The name of your child."), + }), + Strict: true, + }, ModelTool{ + Type: "function", + Name: "unroute", + Description: "Remove a source route, only after the user agrees. New inputs go to you.", + Parameters: promptObjectSchema(map[string]any{ + "source": promptStringSchema("The source key, whatsapp:CHAT-ID."), + }), + Strict: true, + }, ModelTool{ + Type: "function", + Name: "routes", + Description: "List source routes to your children.", + Parameters: promptObjectSchema(map[string]any{}), + Strict: true, }, ModelTool{ Type: "function", Name: "schedule_set",