Slack Toolkit
This will help you getting started with the Slack toolkit. For detailed documentation of all SlackToolkit features and configurations head to the API reference.
Setup
To use this toolkit, you will need to get a token as explained in the Slack API docs. Once you've received a SLACK_USER_TOKEN, you can input it as an environment variable below.
import getpass
import os
if not os.getenv("SLACK_USER_TOKEN"):
os.environ["SLACK_USER_TOKEN"] = getpass.getpass("Enter your Slack user token: ")
If you want to get automated tracing from runs of individual tools, you can also set your LangSmith API key by uncommenting below:
# os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")
# os.environ["LANGSMITH_TRACING"] = "true"
Installation
This toolkit lives in the langchain-community
package. We will also need the Slack SDK:
%pip install -qU langchain-community slack_sdk
Optionally, we can install beautifulsoup4 to assist in parsing HTML messages:
%pip install -qU beautifulsoup4 # This is optional but is useful for parsing HTML messages