Create Slack Audio Alert
Create Slack alert to summarize recent emails as audio.
Last updated
Create Slack alert to summarize recent emails as audio.
Last updated
In this example, we will create a Slack alert to generate an audio summary of our recent Google emails.
The createAlert
mutation enables the creation of a alert by accepting the alert name
, type
, publishing
and integration
alert parameters and it returns essential details, including the ID, name, state, and type of the newly generated alert.
Depending on the specified type
parameter, Graphlit requires the specific alert parameters including the publishPrompt
and publishSpecification
.
Given the schedulePolicy
we assigned, the alert will execute every 5 minutes, and look for recently received email. Graphlit will summarize each email, and then use the publishPrompt
to create a script for an audio summary which is passed to an ElevenLabs text-to-speech model.
You can optionally assign a publishSpecification
, which configures the LLM used to publish the script. In this case, you can assume we have already created a specification using the latest OpenAI GPT-4 Turbo model.
We have also assigned a content filter
, so the alert only queries EMAIL
content types.
Once publishing completes, the MP3 file will be posted to the Slack channel we configured, along with the textual script.
In this case, we want to generate an audio summary, so we specify the ELEVEN_LABS_AUDIO
publishing type, the MP3
format, and the ElevenLabs model
and voice
. These match the publishing configuration in the publishContents
mutation.
Then we need to tell the alert where to send the alert. We assign the integration type
to SLACK
, and provide the Slack channel and Slack bot token.
Slack support requires the creation of an Slack application, which can be found on the Slack API "My Apps" page. Your bot token can be found on the OAuth & Permissions page, with your Slack application selected. Look at OAuth Tokens for Your Workspace.
You will need to add your bot to any channel where you want Graphlit to post messages.
Here is a suggested set of Bot Token Scopes you need to assign to your bot, so Graphlit can post to the channel:
chat:write
chat:write.customize