examples/integration-slack/README.md
This example shows how to collect human feedback via Slack for evaluating AI responses.
Install the Slack Web API (optional dependency):
npm install @slack/web-api
Create a Slack App:
Add Bot Token Scopes:
chat:writechannels:historychannels:readgroups:historygroups:readim:historyim:readInstall to Workspace:
xoxb-)Set Environment Variable:
export SLACK_BOT_TOKEN=xoxb-your-token-here
Invite Bot to Channel:
/invite @your-bot-nameYou can run this example with:
npx promptfoo@latest init --example integration-slack
cd integration-slack
Then update the channel ID in promptfooconfig.yaml and run:
npx promptfoo@latest eval
The example compares AI responses with human feedback:
providers:
- openai:gpt-4o-mini # AI model
- slack:C_YOUR_CHANNEL_ID # Human feedback
When you run the evaluation:
In Slack:
For more advanced configurations (specific user feedback, timeout settings, etc.), see the Slack provider documentation.