It has two components:
- router - decides if it needs to invoke the second function
- automator - the main logic
It's split into two parts to work around Slack's 3 second timeout
First, deploy the router:
cd router
bash publish.sh
Next, deploy the automator:
make deploy
This README provides an overview of the configuration file for our application, which manages various aspects of our Slack workspace and automated responses.
The configuration file is structured in YAML format and consists of the following main sections:
- Admins
- Channels
- Reactions
This section lists the user IDs of administrators who have special privileges within the application.
admins:
- U01AXE0P5M3
This section maps channel IDs to their corresponding names. It helps identify specific channels for various operations.
channels:
C02R98X7DS9: "course-mlops-zoomcamp"
C01FABYF2RG: "course-data-engineering"
C0288NJ5XSA: "course-ml-zoomcamp"
C06TEGTGM3J: "course-llm-zoomcamp"
This section defines automated responses to specific reactions or triggers in the Slack workspace. Each reaction has a type, corresponding action, and may include placeholders.
SLACK_POST
: Posts a message in the Slack channelDELETE_MESSAGE
: Removes a message and sends a notification to the userASK_AI
: Utilizes an AI model to generate a response
{user}
: Replaced with the username of the person who triggered the reaction{channel}
: Replaced with the channel name where the reaction was triggered{user_message}
: Replaced with the content of the user's message that triggered the reaction
Some reactions use custom placeholders, such as {link}
in the faq
reaction. These are defined in the placeholders
section of each reaction.
For reactions with channel-specific placeholders (like {link}
in the faq
reaction):
- If a matching channel is found, the corresponding value is used.
- If no matching channel is found, but a
default
value is set, the default value is used. - If no matching channel is found and no default value is set, no action is taken.
-
dont-ask-to-ask-just-ask
:- Type:
SLACK_POST
- Action: Posts a message encouraging users to ask their questions directly
- Type:
-
thread
:- Type:
SLACK_POST
- Action: Reminds users to use threads for organized discussions
- Type:
-
faq
:- Type:
SLACK_POST
- Action: Provides links to course-specific FAQs
- Placeholders:
{link}
: Channel-specific FAQ links
- Default behavior: Uses a default link if the channel doesn't match
- Type:
-
error-log-to-thread-please
:- Type:
SLACK_POST
- Action: Instructs users on how to properly share error logs
- Placeholders:
{link}
: Channel-specific guidelines for sharing error logs
- Default behavior: Uses a default link if the channel doesn't match
- Type:
-
no-screenshot
:- Type:
SLACK_POST
- Action: Advises against posting screenshots of code
- Placeholders:
{link}
: Channel-specific guidelines for sharing code
- Default behavior: Uses a default link if the channel doesn't match
- Type:
-
shameless-rules
:- Type:
DELETE_MESSAGE
- Action: Enforces rules for shameless promotion channels
- Uses pre-defined placeholders:
{user}
,{channel}
,{user_message}
- Type:
-
jobs-rules
:- Type:
DELETE_MESSAGE
- Action: Enforces rules for job postings
- Uses pre-defined placeholders:
{user}
,{channel}
,{user_message}
- Type:
-
ask-ai
:- Type:
ASK_AI
- Action: Utilizes an AI model (
llama3-70b-8192
) to answer user questions - Model:
llama3-70b-8192
- Prompt template: Includes the user's message
- Answer template: Formats the AI's response for posting in Slack
- Type:
This configuration file is used by the application to manage automated responses and actions within the Slack workspace. It helps maintain community guidelines, provides helpful resources, and ensures a smooth experience for all users in the various course-related channels.
To modify the configuration, edit the YAML file directly. Ensure that you follow the existing structure and formatting to maintain compatibility with the application.