]> git.giacomolli.uk - onechat/blobdiff - prompt.go
Send WhatsApp messages with an ID
[onechat] / prompt.go
index cd70250b2b999370931b20d4f327f07b04d142e0..fdcee0fadac2700566f0054684dedd7ec708b0b2 100644 (file)
--- a/prompt.go
+++ b/prompt.go
@@ -217,11 +217,21 @@ func promptTools() []ModelTool {
        }, ModelTool{
                Type:        "function",
                Name:        "whatsapp_find",
-               Description: "Find the WhatsApp contacts and groups of the user whose name contains the text, with no regard to case and accents. Gives up to 20 matches, each as ID | name | contact or group.",
+               Description: "Find the WhatsApp contacts and groups of the user whose name contains the text, with no regard to case and accents. Gives up to 20 matches, each as ID | name | contact or group. Give the ID to whatsapp_send.",
                Parameters: promptObjectSchema(map[string]any{
                        "name": promptStringSchema("A part of the name of the contact or the group."),
                }),
                Strict: true,
+       }, ModelTool{
+               Type:        "function",
+               Name:        "whatsapp_send",
+               Description: "Send a text message to a WhatsApp chat. Send only a message that the user asked you to send, to the chat that the user named. Give a new id for each message: a call with an id that was used gives the answer of the first call and sends nothing.",
+               Parameters: promptObjectSchema(map[string]any{
+                       "id":   promptStringSchema("A new id for this message, such as a short random word."),
+                       "chat": promptStringSchema("The ID of the chat, from whatsapp_find or from a [WhatsApp] message."),
+                       "text": promptStringSchema("The text of the message."),
+               }),
+               Strict: true,
        })
 }