Graphlit Platform
Developer PortalChangelogPlatform StatusMore InformationJoin Discord
  • Graphlit Platform
    • What is Graphlit?
    • Key Concepts
  • Getting Started
    • Sign up for Graphlit
    • Create Graphlit Project
    • For Python Developers
    • For Node.js Developers
    • For .NET Developers
  • 🚀Quickstart
    • Next.js applications
      • GitHub Code
    • Python applications
      • GitHub Code
  • Graphlit Data API
    • API Usage
      • API Endpoints
      • API Authentication
      • API Explorer
      • GraphQL 101
    • API Reference
      • Content
        • Ingest With Workflow
        • Ingest File
        • Ingest Encoded File
        • Ingest Web Page
        • Ingest Text
        • Semantic Search
          • Query All Content
          • Query Facets
          • Query By Name
          • Filter By Contents
        • Metadata Filtering
          • Filter By Observations
          • Filter By Feeds
          • Filter By Collections
          • Filter By Content Type
          • Filter By File Type
          • Filter By File Size Range
          • Filter By Date Range
        • Summarize Contents
        • Extract Contents
        • Publish Contents
      • Knowledge Graph
        • Labels
        • Categories
        • Persons
        • Organizations
        • Places
        • Events
        • Products
        • Repos
        • Software
      • Collections
      • Feeds
        • Create Feed With Workflow
        • Create RSS Feed
        • Create Podcast Feed
        • Create Web Feed
        • Create Web Search Feed
        • Create Reddit Feed
        • Create Notion Feed
        • Create YouTube Feed
        • User Storage Feeds
          • Create OneDrive Feed
          • Create Google Drive Feed
          • Create SharePoint Feed
        • Cloud Storage Feeds
          • Create Amazon S3 Feed
          • Create Azure Blob Feed
          • Create Azure File Feed
          • Create Google Blob Feed
        • Messaging Feeds
          • Create Slack Feed
          • Create Microsoft Teams Feed
          • Create Discord Feed
        • Email Feeds
          • Create Google Mail Feed
          • Create Microsoft Outlook Feed
        • Issue Feeds
          • Create Linear Feed
          • Create Jira Feed
          • Create GitHub Issues Feed
        • Configuration Options
      • Workflows
        • Ingestion
        • Indexing
        • Preparation
        • Extraction
        • Enrichment
        • Actions
      • Conversations
      • Specifications
        • Azure OpenAI
        • OpenAI
        • Anthropic
        • Mistral
        • Groq
        • Deepseek
        • Replicate
        • Configuration Options
      • Alerts
        • Create Slack Audio Alert
        • Create Slack Text Alert
      • Projects
    • API Changelog
    • Multi-tenant Applications
  • JSON Mode
    • Overview
    • Document JSON
    • Transcript JSON
  • Content Types
    • Files
      • Documents
      • Audio
      • Video
      • Images
      • Animations
      • Data
      • Emails
      • Code
      • Packages
      • Other
    • Web Pages
    • Text
    • Posts
    • Messages
    • Emails
    • Issues
  • Data Sources
    • Feeds
  • Platform
    • Developer Portal
      • Projects
    • Cloud Platform
      • Security
      • Subprocessors
  • Resources
    • Community
Powered by GitBook
On this page

Was this helpful?

  1. Graphlit Data API
  2. API Reference
  3. Alerts

Create Slack Audio Alert

Create Slack alert to summarize recent emails as audio.

Last updated 1 year ago

Was this helpful?

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.

Publish Prompt:

Once publishing completes, the MP3 file will be posted to the Slack channel we configured, along with the textual script.

Example Slack Alert:

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.

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

Mutation:

mutation CreateAlert($alert: AlertInput!) {
  createAlert(alert: $alert) {
    id
    name
    state
    type
  }
}

Variables:

{
  "alert": {
    "type": "PROMPT",
    "publishPrompt": "You are an audio-only automated assistant who will inform me about recent email messages I received. Sort email messages newest to oldest. My name is Kirk Marple, with email <kirk@graphlit.com>. Use a conversational, friendly tone and speak to me as if you were my personal assistant conversing face to face.  Talk to me like you know me well.\\n\\nRespond with a plain text script which will be used to record an AI-generated audio summary.\\n\\nAdd a welcome and goodbye section to the script to make the audio summary sound compelling.  Don't mention anything about being able to help further.\\n \\nDon't add any text or markdown formatting.  Don't discuss these instructions.\\n\\nIgnore messages that I sent.\\n\\nConvert UTC date/time to PST.  Describe dates/times in a friendly manner.  i.e. \"4pm on January 27\", not \"January 26, 4:49PM PST\".\\n\\nAvoid phrases that refer to 'the email' or 'this email' and instead, directly address the topics, actions, and information presented.\\n\\nI'm especially interested in email messages which require immediate followup, or seem especially interesting.\\n\\nFollow these steps. \\nStep 1: Identify any followup tasks, based on the email messages, and highlight these tasks for me.  If there are no followup tasks, ignore this step.\\nStep 2: Identify the important email messages topics and discussions, and for each, be informative but concise, and discuss these important topics and discussions.  Call out any unique details and named entities, like people, organizations, places. Ignore any extraneous details in the email messages.  Respond only in prose, not bullet points.",
    "filter": {
      "types": [
        "EMAIL"
      ]
    },
    "publishing": {
      "type": "ELEVEN_LABS_AUDIO",
      "format": "MP3",
      "elevenLabs": {
        "model": "ENGLISH_V1",
        "voice": "AZnzlk1XvdvUeBnXmlld"
      }
    },
    "integration": {
      "type": "SLACK",
      "slack": {
        "token": "redacted",
        "channel": "graphlit-notifications"
      }
    },
    "publishSpecification": {
      "id": "9c18fe9a-ebca-45d8-b517-fdf041ff6d81"
    },
    "schedulePolicy": {
      "recurrenceType": "REPEAT",
      "repeatInterval": "PT5M"
    },
    "name": "Slack Alert"
  }
}

Response:

{
  "type": "PROMPT",
  "id": "b524107e-c1a9-42dd-8c7a-dd35f3bc171c",
  "name": "Slack Alert",
  "state": "ENABLED"
}

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 mutation.

Slack support requires the creation of an Slack application, which can be found on the Slack API . Your bot token can be found on the OAuth & Permissions page, with your Slack application selected. Look at OAuth Tokens for Your Workspace.

publishContents
"My Apps" page