Toolkits
Telegram
TelegramTools enable an Agent to send messages to a Telegram chat using the Telegram Bot API.
Prerequisites
Example
The following agent will send a message to a Telegram chat.
cookbook/tools/tavily_tools.py
Toolkit Params
Parameter | Type | Default | Description |
---|---|---|---|
token | Optional[str] | None | Telegram Bot API token. If not provided, will check TELEGRAM_TOKEN environment variable. |
chat_id | Union[str, int] | - | The ID of the chat to send messages to. |
Toolkit Functions
Function | Description |
---|---|
send_message | Sends a message to the specified Telegram chat. Takes a message string as input and returns the API response as text. If an error occurs, returns an error message. |