Skip to main content

Slack

Connect Slack to Squid to send AI-powered messages

The Slack connector's functionality

The Slack connector currently enables Squid AI agents to send Slack messages to either channels or individual users. By providing AI agents with these capabilities, users can simply ask the AI agent to send a message, and the agent will take the desired action.

Configuring the Slack connector

Squid connects to a Slack application to send messages in your Slack workspace.

Creating a Slack application

  1. Navigate to the Slack applications landing page.
  2. Click Create New App and provide a meaningful App Name and the corresponding Slack workspace.

Adding the Slack connector to your Squid application

  1. Navigate to the Squid Console and select the Connectors tab.
  2. Switch to the Available Connectors tab and add a Slack connector.
  3. The configuration details can all be found on the settings page of the Slack application you just created:

Connector ID: A meaningful string that uniquely identifies the connector in the code.

App ID: The ID of the Slack application, which can be found on the Basic Information tab of your Slack app's settings.

Client ID: The Client ID of the Slack application, which can also be found on the Basic Information tab.

Bot User OAuth Token: The Bot User OAuth token of the Slack application, which can be found on the OAuth & Permissions tab. This token is used to authenticate the requests to the Slack API.

Client Secret: The Client Secret of the Slack app, which can be found on the Basic Information tab.

Signing Secret: The Signing Secret of the Slack app, which can be found on the Basic Information tab.

Verification Token: The Verification Token of the Slack app, which can be found on the Basic Information tab.

Using the Slack connector in your application

There are two ways to use the Slack connector in your application:

  1. Using the Agent Studio: If you are using the Agent Studio to create your AI agent, you can add the Slack connector by clicking the Add Abilities button and adding the Slack ability. Learn more about abilities here. After adding the ability, you can ask your agent to send Slack messages in the Test Agent tab.
  2. Using the Squid SDK: If you are using the Squid SDK to create your AI agent, you can use the squid.ai().agent('AGENT_ID').ask() function to chat with your agent. Learn more here. Use the Slack connector by adding it in the connectedIntegrations option of the ask() function.
await this.squid.ai().agent('AGENT_ID').ask('Send a slack message saying "Hello!" to the general channel', {
connectedIntegrations: [{
integrationId: 'SLACK_CONNECTOR_ID',
integrationType: 'slack',
description: 'Call this connector whenever a user asks to send a Slack message',
}],
});

Congratulations! You can now can send Slack messages via your AI agent!