@graphai/slack_agent
v0.0.2
Published
Slack message agents for GraphAI.
Downloads
3
Readme
@graphai/slack_agent for GraphAI
Slack message agents for GraphAI.
Install
yarn add @graphai/slack_agent
setup
Acquiring a Slack Token for Posting Messages
Obtain a Slack Token:
- Go to the Slack API Developer Portal and select or create your app.
- Follow the steps in the Permissions or Authentication section to generate the necessary token for your use case (e.g., user token, bot token).
Set the Token as an Environment Variable:
- Export the token as an environment variable by running the following command in your terminal:
export SLACK_TOKEN=your-slack-token-here
- Export the token as an environment variable by running the following command in your terminal:
Using a Bot Token:
- If you are using a bot token, ensure that the bot is added to the channel where you intend to post messages. This can be done from the Slack app by inviting the bot to the relevant channel.
Usage
import { GraphAI } from "graphai";
import { slackAgent } from "@graphai/slack_agent";
const agents = { slackAgent };
const graph = new GraphAI(graph_data, agents);
const result = await graph.run();