case err == nil:
output, err = b.whatsapp.Find(ctx, args.Name)
}
+ case "whatsapp_send":
+ var args ToolWhatsAppSendArguments
+ err = toolDecodeArguments(arguments, &args)
+ switch {
+ case b.whatsapp == nil:
+ err = fmt.Errorf("unknown tool %q", name)
+ case err == nil:
+ output, err = b.whatsapp.Send(ctx, args.ID, args.Chat, args.Text)
+ }
default:
err = fmt.Errorf("unknown tool %q", name)
}
Name string `json:"name"`
}
+// ToolWhatsAppSendArguments are the arguments of whatsapp_send.
+type ToolWhatsAppSendArguments struct {
+ ID string `json:"id"`
+ Chat string `json:"chat"`
+ Text string `json:"text"`
+}
+
// ToolHeadTail keeps the first and the last toolClipBytes bytes written to it,
// and counts the bytes between them that it drops.
type ToolHeadTail struct {