Prerequisites
The following example requires theslack-sdk
library.
Example
The following agent will use Slack to send a message to a channel, list all channels, and get the message history of a specific channel.cookbook/tools/slack_tools.py
Toolkit Params
Parameter | Type | Default | Description |
---|---|---|---|
token | str | None | Slack API token for authentication |
enable_send_message | bool | True | Enables functionality to send messages to Slack channels |
enable_send_message_thread | bool | True | Enables functionality to send threaded messages |
enable_list_channels | bool | True | Enables functionality to list available Slack channels |
enable_get_channel_history | bool | True | Enables functionality to retrieve message history from channels |
all | bool | False | Enables all functionality when set to True |
Toolkit Functions
Function | Description |
---|---|
send_message | Sends a message to a specified Slack channel |
list_channels | Lists all available channels in the Slack workspace |
get_channel_history | Retrieves message history from a specified channel |