# Teams/Slackのチャットボット

> Teams/Slackのチャットボット - Teamsや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-07-27T18:44:30.227040+00:00` (UTC).

## Primary page

- [Teams/Slackのチャットボット](https://docs.datarobot.com/ja/docs/api/dev-learning/accelerators/llm-and-genai-apps/chatbot-teams-slack.html.md): Full documentation for this topic (Markdown sidecar).

## Documentation content

SlackとMicrosoft Teamsは、DataRobotのデプロイと対話できるアプリケーションやボットの作成をサポートしています。 LLMベースのチャットアプリケーションのフロントエンドとしてSlackまたはTeamsを使用することで、組織内での幅広い利用が可能になり、ドキュメントを簡単にアップロードできるだけでなく、チームチャネルまたは会話に保存された内部知識を活用できます。

**Slackのセットアップ:**
IT組織から権限を取得し、Slack組織にSlackアプリを作成します。 次に、Slack APIを使用して、 [アプリを作成します](https://api.slack.com/apps) 。

**Teamsのセットアップ:**
IT組織から権限を取得し、カスタマイズされたアプリをアップロードします。 次に、 [Microsoftの開発者ポータル](https://login.microsoftonline.com) でアプリケーションとotを登録します。


SlackとTeamsの両方のメッセージ送信アクションで、ユーザーの質問をプロンプトとしてDataRobot LLMデプロイにエクスポートし、REST APIコールからのレスポンスをボットのユーザーメッセージに提供します。 DataRobotを使用すると、トークンの使用状況、プロンプト、レスポンス、毒性、およびその他の [カスタム指標](https://docs.datarobot.com/ja/docs/api/reference/sdk/custom-metrics.html.md) を追跡し、組織内でアプリケーションの監視とガバナンスを行うことができます。

以下のコードをSlackまたはTeamsのメッセージング構造に適応させることで、DataRobot LLMデプロイにクエリーとしてメッセージを渡し、レスポンスを得ることができます。

```
    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 
```
