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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
iwamot
PRO
September 13, 2023
Technology
690
1
Share
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
0
350
8万デプロイ
iwamot
PRO
2
320
AIエージェント・マイクロサービス時代。AWSでの手軽な構築法を考えて試してみた
iwamot
PRO
1
77
これがLambdaレス時代のChatOpsだ!実例で学ぶAmazon Q Developerカスタムアクション活用法
iwamot
PRO
10
2.3k
Developer Certificate of Origin、よさそう
iwamot
PRO
0
63
復号できなくなると怖いので、AWS KMSキーの削除を「面倒」にしてみた CODT 2025 クロージングイベント版
iwamot
PRO
1
170
復号できなくなると怖いので、AWS KMSキーの削除を「面倒」にしてみた
iwamot
PRO
3
140
IPA&AWSダブル全冠が明かす、人生を変えた勉強法のすべて
iwamot
PRO
14
12k
2年でここまで成長!AWSで育てたAI Slack botの軌跡
iwamot
PRO
4
1.3k
Other Decks in Technology
See All in Technology
Agents CLI と Gemini Enterprise Agent Platform で マルチエージェント開発が楽しくなる!
kaz1437
0
110
Azure Static Web Apps の自動ビルドがタイムアウトしやすくなった状況に対応した件/global-azure2026
thara0402
0
420
これからの「データマネジメント」の話をしよう
sansantech
PRO
0
140
AI時代 に増える データ活用先
takahal
0
270
No Types Needed, Just Callable Method Check
dak2
1
1.4k
AWS認定資格は本当に意味があるのか?
nrinetcom
PRO
2
280
AIコーディング時代における、ソフトウェアサプライチェーン攻撃に対する防衛術(簡易版)
soysoysoyb
0
110
弁護士ドットコム株式会社 エンジニア職向け 会社紹介資料
bengo4com
1
160
小説執筆のハーネスエンジニアリング
yoshitetsu
0
730
ARIA Notifyについて
ryokatsuse
1
120
M5Stack CoreS3とZephyr(RTOS)で Edge AIっぽいことしてみた
iotengineer22
0
270
AIが書いたコードを信じられない問題 〜レビュー負荷を下げるために変えたこと〜 / The AI Code Trust Gap: Reducing the Review Burden
bitkey
PRO
8
1.3k
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
170
Game over? The fight for quality and originality in the time of robots
wayneb77
1
160
Are puppies a ranking factor?
jonoalderson
1
3.3k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Pragmatic Product Professional
lauravandoore
37
7.2k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
180
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
53k
Believing is Seeing
oripsolob
1
110
Building Applications with DynamoDB
mza
96
7k
Utilizing Notion as your number one productivity tool
mfonobong
4
290
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