# ChatGPT dots

URL: https://swb.one/zh-Hant/docs/setup/dots

dot 是個人專屬的 ChatGPT 代理。`dots` 模組預設用 Slack 傳送訊息。這份指南改用 SwB 信箱，信箱會為單一代理保存訊息。

## 開始之前 [#開始之前]

確認[你的方案和地區](https://help.openai.com/en/articles/20001530-getting-started-with-your-dot)是否支援 dot。

工作空間要具備 dot 使用權限和[自訂 MCP 寫入權限](https://help.openai.com/en/articles/12584461-connecting-custom-mcp-servers-in-chatgpt)。MCP 伺服器讓應用程式能使用外部工具。

如果工作空間限制 dot 的使用，請管理員啟用 **Use dots**。

SwB 伺服器需要公開 HTTPS 網址、擁有者登入和 `dots` 模組。一個模組就是一項 SwB 連線，要在設定檔中啟用。

## 複製設定提示詞 [#複製設定提示詞]

https://swb.one/prompts/dots.md

```
Read the setup guide at https://swb.one/docs/setup/dots.

Help me connect my ChatGPT dot to SwB. A dot is my personal ChatGPT agent. SwB carries messages between my agents and channels.

Check your tools first. If the SwB tools are missing, follow https://swb.one/docs/setup/chatgpt to add the connector. Ask me to add the plugin to my dot.

Call `connect(what="chatgpt")` to check the sign-in. Ask me for my dot's name. From a client with owner access, call `connect(what="dots", choose={"dot":"<name>"})`. Do each step marked "you" yourself. Give me each step marked "person" one at a time with the exact click path and links. Wait for me to say done after each step. Call `connect` again with the same choices. For direct delivery, set `delivery: mailbox` in the dots block in `config/switchboard.yaml`. Restart SwB after the change.

When `connect` reports that the dot is ready, find its address with `targets(block="dots")`. Ask me to send a test to that address from another SwB app.

The default mailbox is `chatgpt`. If your app supports MCP events, subscribe to switchboard.message.created for your SwB mailbox. Otherwise, call wait or inbox at the start of each task. SwB checks your callback address before it sends events. Use the event's `message_id` with `get_message`. Answer with `reply` and the message's `handle`. Tell me how you received the test.
```

把 SwB 加入 dot 後，再貼上提示詞。

## 設定信箱傳遞 [#設定信箱傳遞]

### 啟用 dots 模組 [#啟用-dots-模組]

把下面的設定加入 `config/switchboard.yaml`，然後重新啟動 SwB。

```yaml
blocks:
  dots:
    delivery: mailbox
    dots:
      dot:
        mailbox: chatgpt
```

### 開啟 Plugins [#開啟-plugins]

用桌面瀏覽器開啟 [chatgpt.com/plugins](https://chatgpt.com/plugins)。

### 新增伺服器 [#新增伺服器]

選取 **+**，再選取 **Add custom MCP server**。

### 輸入網址 [#輸入網址]

名稱輸入 `SwB`。在 **Server URL** 中輸入你的 SwB MCP 網址，例如 `https://swb.example.com/mcp`。

### 建立外掛程式 [#建立外掛程式]

選取 **OAuth**，選取 **I understand and want to continue**，再選取 **Create as a plugin**。

### 安裝並登入 [#安裝並登入]

安裝外掛程式。以擁有者身分登入 SwB，並核准存取。

### 開啟你的 dot [#開啟你的-dot]

在 [chatgpt.com](https://chatgpt.com) 開啟你的 dot，把 SwB 外掛程式加進去。 

## 代理會做什麼 [#代理會做什麼]

dot 呼叫 `connect(what="chatgpt")` 檢查 OAuth 登入。使用 OAuth 時，由你在 SwB 頁面上核准存取。請具備完整擁有者存取權的代理執行 `connect(what="dots")`，檢查 `dots` 模組。

如果 dot 支援 MCP Events，它可以為 `chatgpt` 信箱訂閱 `switchboard.message.created`。訊息送達時，事件會通知 dot。SwB 會驗證接收事件的網址。dot 用 `get_message` 讀取訊息，再用 `reply` 回覆。在開啟中的聊天裡，用 `wait` 或 `inbox` 收取訊息。

## 憑證 [#憑證]

| 權杖 | 顯示位置 | 格式 | 去處 |
| - | - | - | - |
| SwB 登入權杖 | 登入時由 ChatGPT 取得 | 隨機字串 | 由 ChatGPT 代為保存 |
| 事件簽署密鑰 | 用戶端訂閱時一併送出 | `whsec_` 加上一段 Base64 字串 | 由 SwB 加密儲存 |

## 檢查連線 [#檢查連線]

請另一個 SwB 代理執行 `send(to="dots:dot:dot", task="SwB setup test: reply pong")`。事件訂閱正常運作時，dot 會醒來，並在該對話中回覆。另外在 dot 中呼叫 `inbox`，單獨檢查信箱存取權。

## 疑難排解 [#疑難排解]

如果 `connect` 回傳啟用 `dots` 模組的指示，加入該模組，再重新啟動 SwB。

如果 `connect` 要求提供 Slack 工作空間，表示模組目前經由 Slack 傳遞。設定 `delivery: mailbox`，再重新啟動 SwB。
