# Teams/Slack chatbots

> Teams/Slack chatbots - An accelerator for collaborative app plug-ins, such as bots for Teams and
> Slack.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-05-06T18:17:09.578028+00:00` (UTC).

## Primary page

- [Teams/Slack chatbots](https://docs.datarobot.com/en/docs/api/dev-learning/accelerators/llm-and-genai-apps/chatbot-teams-slack.html): Full documentation for this topic (HTML).

## Related documentation

- [Developer documentation](https://docs.datarobot.com/en/docs/api/index.html): Linked from this page.
- [Developer learning](https://docs.datarobot.com/en/docs/api/dev-learning/index.html): Linked from this page.
- [AI accelerators](https://docs.datarobot.com/en/docs/api/dev-learning/accelerators/index.html): Linked from this page.
- [LLM and GenAI applications](https://docs.datarobot.com/en/docs/api/dev-learning/accelerators/llm-and-genai-apps/index.html): Linked from this page.
- [custom metrics](https://docs.datarobot.com/en/docs/api/reference/sdk/custom-metrics.html): Linked from this page.

## Documentation content

Slack and Microsoft teams support the creation of applications or bots that can interact with a DataRobot deployment. Using Slack or Teams as a front-end for a LLM-based chat application enables broad availability in an organization, providing the ability to upload documents easily as well as leverage internal knowledge stored in team channels or conversations.

**Slack setup:**
Obtain permissions from your IT organization to create a Slack App in your Slack organization. Then, [create the app](https://api.slack.com/apps) with the Slack API.

**Teams setup:**
Obtain permissions from your IT organization to upload a customized app. Then, register for an application and a ot in the [Microsoft Developer Portal](https://login.microsoftonline.com).


Within the message send action in both Slack and Teams, export the user question as a prompt into your DataRobot LLM deployment, and provide the response from the REST API call to the user message in your bot. DataRobot enables you to track token usage, prompts, responses, toxicity, and other [custom metrics](https://docs.datarobot.com/en/docs/api/reference/sdk/custom-metrics.html) to monitor and govern your application internally.

The following code can be adapted to the Slack or Teams messaging structure to pass a message as a query to the DataRobot LLM deployment and get a response.

```
    import datarobotx as drx

    # configure drx LLM Deployment
    RAG = drx.Deployment.from_url(
        url=f'https://app.datarobot.com/deployments/{RAG_did}/overview'
    )

    def make_datarobot_deployment_unstructured_predictions(
        data,
        **kwargs,
    ):
        query = json.loads(data)
        response = RAG.predict_unstructured(query)
        return json.dumps(response)

    def make_prediction(prompt, history=None) -> dict:

        data = {
            "prompt": prompt,
        }
        if history:
            data["chat_history"] = [
                [entry.get("user", ""), entry.get("chatbot", "")] for entry in history
            ]
        response = make_datarobot_deployment_unstructured_predictions(
            json.dumps(data)
        )
        response = json.loads(response)

        return response
```
