Documentation
¶
Overview ¶
Package whatsapp provides tools for WhatsApp Business via the Cloud API.
Authentication: WhatsApp Business Cloud API (Meta for Developers). Required env vars:
WHATSAPP_PHONE_NUMBER_ID — phone number ID from Meta Business dashboard WHATSAPP_TOKEN — permanent or temporary access token WHATSAPP_VERIFY_TOKEN — webhook verify token (for receiving messages)
All messaging through WhatsApp API requires:
- A Meta Business account
- An approved WhatsApp Business app
- Message templates approved by Meta for outbound-initiated messages
Tools planned (see GitHub issue):
whatsapp_send — send a text or template message whatsapp_send_media — send image/document/audio whatsapp_webhook — receive and parse incoming messages (via webhook)
Index ¶
- Constants
- Variables
- type SendTool
- func (t *SendTool) BackfillInput(_ context.Context, input map[string]any) map[string]any
- func (t *SendTool) Call(_ context.Context, _ tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *SendTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *SendTool) Definition() tool.Definition
- func (t *SendTool) Description(_ context.Context) (string, error)
- func (t *SendTool) FormatResult(data any) string
- func (t *SendTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *SendTool) IsEnabled() bool
- func (t *SendTool) IsReadOnly(_ map[string]any) bool
- func (t *SendTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)
Constants ¶
View Source
const ( SendToolName = "whatsapp_send" SendDisplayName = "Send WhatsApp Message" SendDescription = `` /* 710-byte string literal not displayed */ )
Variables ¶
View Source
var ErrNotImplemented = errors.New("whatsapp tools: not implemented — see GitHub issue")
ErrNotImplemented is returned by all WhatsApp tools until the API client is complete (see GitHub issue). WhatsApp Business API requires Meta developer account approval before testing is possible.
Functions ¶
This section is empty.
Types ¶
type SendTool ¶
type SendTool struct{}
func NewSendTool ¶
func NewSendTool() *SendTool
func (*SendTool) BackfillInput ¶
func (*SendTool) Call ¶
func (t *SendTool) Call(_ context.Context, _ tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
func (*SendTool) CheckPermissions ¶
func (t *SendTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*SendTool) Definition ¶
func (t *SendTool) Definition() tool.Definition
func (*SendTool) FormatResult ¶
Click to show internal directories.
Click to hide internal directories.