Bot Interfaces
Bot interfaces are the settings that enable interaction with a specific bot. There are two “bot interfaces” that Montag supports: Slack, and OpenAI API server.
Slack Clients
Montag uses a Slack SDK to connect to the Slack websocket API, this enables multiple bots to connect to Slack and react in real-time to events.
In Montag, the only settings required for a bot are:
- The App token (this starts with
xapp-
) - The Bot token (this starts with
xoxb-
)
How to set up a new Bot in Slack
To set up a Slack Bot and get these permissions, you will need to set up a new bot in the Slack Workspace Admin:
Then in the window that pops up, select “Build” in the top nav to get to the developer center:
Select “Create New App” > From Scratch > And select the Tyk Workspace
Select “Socket Mode” and enable it with the toggle, you should not need to add any new scopes. It will ask for a name for your token, give it a name and save the token.
On the same page, select “Event Subscriptions” and enable to toggle.
Select subscribe to bot events and add:
- app_mention
- message.channels
Click “save changes”
Go back to “Basic Information” in the left hand nav and set up the Display Information settings (the name, description and an avatar for the bot)
Finally, select “Install your app” near the top of the page and follow the instructions, this will install the bot and provide you with the second token you need. Set up in Montag The final step is to add the credentials and name in the “Slack Clients’ section of the UI. You can then use the client elsewhere in the app.
OpenAI API Server
The second interface is an OpenAI API shium, here Montag will launch a local server on a port you choose that mimics the OpenAI /v1/completions
endpoint. You can then use this to interact with a bot just like you would with OpenAI, the difference being that it is not a direct proxy, and you can use all the advanced features of a Bot to work with OpenAI-compatible tools.