A Slack chat bot that uses the Gemini 1.0 Pro Vision model. It can accept images and text from Slack.
- Navigate to Slack settings,
Tools & Settings > Manage apps
. - Click on
Build
in the top right corner. - Click on
Create new app
and selectFrom manifest
. - Copy the contents slack-manifest.yaml into the text box.
- Proceed with creation of the Slack application and install it to your workspace.
- You should now be able to view application credentials. Take the
App ID
andSigning Secret
and place them interraform.tfvars
(slack_app_id
andslack_signing_key
). - Next click on
OAuth & Permissions
and take theBot User OAuth Token
and place it interraform.tfvars
(slack_token
). - You can now run
terraform apply
to deploy the bot. After deployment, you should see the Cloud Run Json2Pubsub URL in the output. - In Slack app settings, click on
Event Subscriptions
and replace theRequest URL
with the URL from the previous step. - In Slack, create a channel and add the bot to it (channel settings,
Integrations > Add an app
). - You can now discuss with the bot via private messages or tagging it in a channel!
By setting vertex_search
parameter, you can deploy an additional Gemini function call which can search
your Vertex AI Datastore. Follow the Vertex AI Search quickstart
(which uses Alphabet's financial documents) and enable it in terraform.tfvars
:
vertex_search = {
enabled = true
location = "eu" # or global, us
datastore_id = "YOUR_DATASTORE_ID_12345678" # replace this with your datastore ID
}
Once deployed, Gemini is given the possibility to function call the Vertex Search function and integrate the results.
Please note that for now, the multimodal search functionality (eg. images) will not work in conjunction with the function calling. The model also might be less efficient at answering common knowledge questions related in any way to finance (work in progress!).
Example terraform.tfvars
file:
project_id = "<your-project-id>"
region = "europe-west1"
slack_token = "xoxb-...." # Slack OAuth token for workspace
slack_signing_key = "8e................02f" # Slack signing key
slack_app_id = "A........L" # App ID
See the previous article: Building an AI Slack Bot using Vertex Generative AI