Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ChatGPT in SlackでAI Slackbotを楽しく運用する
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
iwamot
PRO
September 13, 2023
Technology
710
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ChatGPT in SlackでAI Slackbotを楽しく運用する
2023-09-14
みんなのPython勉強会#97
https://startpython.connpass.com/event/294703/
iwamot
PRO
September 13, 2023
More Decks by iwamot
See All by iwamot
MCP Appsを作ってみよう
iwamot
PRO
4
760
自己紹介
iwamot
PRO
1
99
パワポ作るマンをMCP Apps化してみた
iwamot
PRO
0
750
8万デプロイ
iwamot
PRO
2
390
AIエージェント・マイクロサービス時代。AWSでの手軽な構築法を考えて試してみた
iwamot
PRO
1
120
これがLambdaレス時代のChatOpsだ!実例で学ぶAmazon Q Developerカスタムアクション活用法
iwamot
PRO
10
2.8k
Developer Certificate of Origin、よさそう
iwamot
PRO
0
100
復号できなくなると怖いので、AWS KMSキーの削除を「面倒」にしてみた CODT 2025 クロージングイベント版
iwamot
PRO
1
210
復号できなくなると怖いので、AWS KMSキーの削除を「面倒」にしてみた
iwamot
PRO
3
180
Other Decks in Technology
See All in Technology
データエンジニアリングとドメイン駆動設計
masuda220
PRO
9
1.5k
アップデートで何が変わった?デモで学んで使いこなすIBM Bob2.0
muehara
0
200
最適な自走を最小限の支援で — M&Aで拡大する組織で少人数SREが挑んだ1年 / SRE NEXT 2026
genda
0
1.6k
AI時代の開発生産性は、個人技からチーム設計へ
moongift
PRO
4
2.4k
Playwright × AI Agent でE2Eテストはどう変わるか AI駆動テストの可能性と実用検証の結果
taiga7543
1
680
個人開発で育てる「大規模設計の苗床」 - AI時代の1人開発から始める業務への知識接続 / The Seedbed for Large-Scale Design - From AI-Era Solo Projects to Professional Knowledge
bitkey
PRO
1
290
ソニー銀行におけるビジネスアジリティ向上のためのクラウドシフト戦略
srenext
0
950
LLMやAIエージェントをソフトウェアに組み込むプラクティス
shibuiwilliam
2
440
第67回コンピュータビジョン勉強会CVPR2026読会前編
tsukamotokenji
0
160
SRE本の知られざる名シーン / The Hidden Gems of Google SRE Book
nari_ex
2
440
マルチアカウント環境でSecurity Hubの運用、その後どうなった? / SRE NEXT 2026 miniLT会
genda
0
110
「休む」重要さ
smt7174
2
440
Featured
See All Featured
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
490
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
240
Test your architecture with Archunit
thirion
1
2.3k
KATA
mclloyd
PRO
35
15k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Paper Plane (Part 1)
katiecoart
PRO
1
9.7k
Faster Mobile Websites
deanohume
310
32k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
220
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
190
Transcript
ChatGPT in SlackでAI Slackbotを楽しく運用する 2023-09-14 みんなのPython勉強会#97 https://startpython.connpass.com/event/294703/ ENECHANGE株式会社 CTO室 インフラエンジニア兼SRE 岩本隆史
(iwamot)
ChatGPT in Slackとは
OSSのAI Slackbotアプリ https://github.com/seratch/ChatGPT-in-Slack
Slackの瀬良さんが個人で開発 https://www.linkedin.com/in/seratch/
もちろんPythonで実装 https://github.com/seratch/ChatGPT-in-Slack
いろんな環境で実行可能
ローカル環境・Amazon EC2等 # Create an app-level token with connections:write scope
export SLACK_APP_TOKEN=xapp-1-... # Install the app into your workspace to grab this token export SLACK_BOT_TOKEN=xoxb-... # Visit https://platform.openai.com/account/api-keys for this token export OPENAI_API_KEY=sk-... (snip) python -m venv .venv source .venv/bin/activate pip install -r requirements.txt python main.py https://github.com/seratch/ChatGPT-in-Slack/blob/main/README.md
Amazon ECS on AWS Fargate等 (Docker) FROM python:3.11.4-slim-buster as builder
COPY requirements.txt /build/ WORKDIR /build/ RUN pip install -U pip && pip install -r requirements.txt FROM python:3.11.4-slim-buster as app WORKDIR /app/ COPY *.py /app/ RUN mkdir /app/app/ COPY app/*.py /app/app/ COPY --from=builder /usr/local/bin/ /usr/local/bin/ COPY --from=builder /usr/local/lib/ /usr/local/lib/ ENTRYPOINT python main.py https://github.com/seratch/ChatGPT-in-Slack/blob/main/Dockerfile
AWS Lambda + Amazon API Gateway (Serverless Framework) frameworkVersion: '3'
service: slack-chat-gpt-bot provider: name: aws runtime: python3.9 region: us-east-1 ... https://github.com/seratch/ChatGPT-in-Slack/blob/main/serverless.yml
おすすめ記事 ChatGPTとSlack上で会話するアプリを10分で構築しよう(前編:ローカル環境) https://qiita.com/rubita/items/f143f199e20b0310980a ChatGPTとSlack上で会話するアプリを10分で構築しよう(後編:AWS Lambda) https://qiita.com/rubita/items/f8d08552f98cc3b25a1a
ぼくの提案で追加された機能
Azure OpenAIの利用 # To use Azure OpenAI, set the following
optional environment variables according to your environment # default: None export OPENAI_API_TYPE=azure # default: https://api.openai.com/v1 export OPENAI_API_BASE=https://YOUR_RESOURCE_NAME.openai.azure.com # default: None export OPENAI_API_VERSION=2023-05-15 # default: None export OPENAI_DEPLOYMENT_ID=YOUR-DEPLOYMENT-ID https://github.com/seratch/ChatGPT-in-Slack/blob/main/README.md
Function Calling(実験的機能) # Experimental: You can try out the Function
Calling feature (default: None) export OPENAI_FUNCTION_CALL_MODULE_NAME=tests.function_call_example https://github.com/seratch/ChatGPT-in-Slack/blob/main/README.md
Function Callingの利用例
DALL·E 2を使った画像作成
qrcodeライブラリを使ったQRコード作成
Amazon Pollyを使った音声読み上げ
まとめ
運用も開発も楽しいので是非お試しを! https://github.com/seratch/ChatGPT-in-Slack