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
iwamot
September 13, 2023
Technology
1
350
ChatGPT in SlackでAI Slackbotを楽しく運用する
2023-09-14
みんなのPython勉強会#97
https://startpython.connpass.com/event/294703/
iwamot
September 13, 2023
Tweet
Share
More Decks by iwamot
See All by iwamot
ECS on FargateへのSeekable OCI導入レポート
iwamot
0
340
サービスクォータ、ちゃんと監視してますか?
iwamot
0
620
AWS Well-Architected Toolで信頼性をレビューした結果
iwamot
0
320
テックカンパニーとしてのENECHANGEの中期目標
iwamot
0
55
AIの活用状況と今後の展望
iwamot
0
48
ENECHANGE社のAWSセキュリティ改革ストーリー
iwamot
0
120
ALBのアクセスログをAthenaで分析してSLOをゆるく決める
iwamot
2
1k
Function callingによるSlackbotの機能拡張
iwamot
2
160
Airflowのチュートリアルやってみた
iwamot
0
150
Other Decks in Technology
See All in Technology
[新卒向け研修資料] テスト文字列に「うんこ」と入れるな(2024年版)
infiniteloop_inc
4
18k
AOAI をきっかけに 社内の Azure 管理を見直した話
recruitengineers
PRO
1
450
地理空間データ可視化・解析・活用ソリューション Pacific Spatial Solutions (PSS)
pacificspatialsolutions
0
330
Azure犬駆動開発の記録/GlobalAzureFukuoka2024_20240420
nina01
1
240
Building Dashboards as a Hobby
egmc
0
360
VSCodeの拡張機能を作っている話
ebarakazuhiro
1
790
R3のコードから見る実践LINQ実装最適化・コンカレントプログラミング実例
neuecc
3
2.2k
Cloud Service Mesh に触れ合う
phaya72
1
160
Rustで「プリズモイダル法」を利用して「土量計算」をガチでやる
nokonoko1203
1
270
Google Cloud Next '24でブログを10本書いた方法と勉強会を沸かせた方法
yasumuusan
0
330
Next.js に疲れた私は Vue3 に癒やされた
akagire
0
130
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
2.1k
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
91
13k
YesSQL, Process and Tooling at Scale
rocio
165
13k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
126
32k
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
Teambox: Starting and Learning
jrom
128
8.4k
GitHub's CSS Performance
jonrohan
1025
450k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
19
6.9k
Art, The Web, and Tiny UX
lynnandtonic
290
19k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
242
1.2M
Agile that works and the tools we love
rasmusluckow
325
20k
Build The Right Thing And Hit Your Dates
maggiecrowley
25
2k
Mobile First: as difficult as doing things right
swwweet
217
8.6k
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