免費諮詢
技術OpenAI Cookbook Agents 主題 2026-09-10 新增三篇之一AI自動化工作流

OpenAI Cookbook:用 Agents API 做一個會查資料、開 PR 的 Slack 機器人

Build a Slack bot with the Agents API

來源:OpenAI Cookbook・發布 2026-09-10・本站摘要分析(非全文轉載)

📌 一句話啟示:把 AI agent 接進公司已在用的 Slack,是上班族最容易說服主管的導入切入點。

摘要分析

OpenAI Cookbook 2026 年 9 月新增的 Agents API 應用範例。同事在 Slack 標記機器人就能搜尋對話、調查專案、分析資料或準備 GitHub PR;每條 thread 對應一個 Agents API session 與獨立沙箱,追問會延續同一調查。步驟:複製 .env 範例 → docker build 沙箱映像 → 填 API key 與受限的 executor key → 用 manifest 建 Slack app 取得 token → uv run main.py 以 Socket Mode 啟動,不需公開 webhook。可選接 Notion、Google Drive、GitHub。

  • 需 Python 3.14+、uv、Docker;cp .env.example .env
  • docker build -t agent-api-sandbox:latest examples/agents_api/sandboxes/docker/application_managed
  • 填 OPENAI_API_KEY 與 OPENAI_EXECUTOR_API_KEY(只有後者進沙箱)
  • 用 manifest 建 Slack app,設 SLACK_BOT_TOKEN、SLACK_APP_TOKEN
  • uv run examples/agents_api/apps/slack_bot/main.py,thread 內 @機器人即可用

One of the Agents API application recipes OpenAI added in September 2026 (alongside an SRE incident-response agent and a data analyst). Teammates tag the bot in Slack to search conversations, investigate projects, analyze data or prepare a GitHub pull request; each Slack thread maps to its own Agents API session and isolated sandbox workspace, so follow-ups continue the same investigation. Slack supplies the trigger and interface, the Agents API keeps conversation state, runs the agent and streams progress, and your application controls Slack access, credentials and sandbox lifecycle. Steps: copy the .env example, build the Docker sandbox image, set OPENAI_API_KEY plus a restricted executor key with api.agents.environments.connect permission, create the Slack app from the provided manifest and collect the bot and app-level tokens, then start with uv run main.py in Socket Mode (no public webhook needed). Optional shared tools include Notion, Google Drive and GitHub.

  • Python 3.14+, uv, Docker; copy .env.example
  • Build the sandbox Docker image
  • Set OPENAI_API_KEY and a restricted executor key
  • Create the Slack app from the manifest
  • uv run main.py and mention the bot in a thread

關鍵字:OpenAI Agents APISlack bot沙箱自動化Socket Mode

來源原文:https://developers.openai.com/cookbook/examples/agents_api/apps/slack_bot/readme.md
本頁為報導內容的摘要與分析,版權屬原媒體所有;請以原文為準。

看完趨勢,下一步

對應的變現路徑與聯成課程

路徑 A 職場加薪路徑 C 創業接案

到聯成官網免費諮詢

同主題報導

技術文章・Dify 官方文件(docs.dify.ai)・langgenius/dify ⭐158.6k(2026-10-16 gh api)・2026-10-16・AI自動化工作流

Dify 官方 30 分鐘快速入門:不寫程式建一個多平台內容生成工作流

Dify Docs: 30-minute Quick Start

Dify(⭐15.9 萬)是開源 LLM 應用與 Agent 工作流平台。官方中文 30 分鐘快速入門帶你在 Dify Cloud(新帳號含 200 則訊息額度,免安裝)建「多平台內容生成器」:輸入草稿與目標平台 → P…

看摘要分析 →
技術文章・專案經理 PM 編輯部(projectmanager.com.tw)・n8n-io/n8n ⭐207.6k(2026-10-16 gh api);繁中教學 2026-09-30 更新・2026-09-30・AI自動化工作流

【n8n 中文教學】從零打造自動化工作流|7 大核心節點+實戰範例

n8n 是 GitHub 星數逾 20.7 萬的開源工作流自動化平台,可串 400 多種服務並內建 AI 節點。這篇繁中教學(2026-04-17 發布、09-30 更新)用「觸發→處理→動作」說明介面,介紹 Webho…

看摘要分析 →

1 分鐘測出你的變現路徑

免費職涯/變現診斷 → 專屬學習地圖 → 成果里程碑計畫書。全台 26 校,週一至五 09:00–18:00。

免費變現路徑診斷LINE 官方帳號撥打 0800-580-581