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
340
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
54
AIの活用状況と今後の展望
iwamot
0
48
ENECHANGE社のAWSセキュリティ改革ストーリー
iwamot
0
120
ALBのアクセスログをAthenaで分析してSLOをゆるく決める
iwamot
2
1k
Function callingによるSlackbotの機能拡張
iwamot
2
150
Airflowのチュートリアルやってみた
iwamot
0
150
Other Decks in Technology
See All in Technology
よく聞くけど使ったことないソフトウェアNo.1 KafkaとSnowflake
foursue
4
370
Building a RAG-poweredAI chat appwith Python and VS Code
pamelafox
0
130
チームでロジカルシンキングに改めて向き合っている話 〜学習環境と実践⽅法〜
sansantech
PRO
3
3.1k
DMM.com アルファ室採用案内資料
hsugita
1
200
競技としてのKaggle、役に立つKaggle
yu4u
6
2.2k
AWS学習者向けにAzureの解説スライドを作成した話
handy
3
110
地理空間データ可視化・解析・活用ソリューション Pacific Spatial Solutions (PSS)
pacificspatialsolutions
0
320
ゼロから始めるVue.jsコミュニティ貢献 / first-vuejs-community-contribution-link-and-motivation
lmi
1
140
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
2
270
Janus
bkuhlmann
1
490
今日からできる!簡単 .NET 高速化 Tips -2024 edition-
xin9le
6
3.1k
VS CodeでAWSを操作しよう
smt7174
9
1.9k
Featured
See All Featured
Design by the Numbers
sachag
274
18k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
19
6.9k
Building an army of robots
kneath
300
41k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
10
1k
Raft: Consensus for Rubyists
vanstee
133
6.3k
Creatively Recalculating Your Daily Design Routine
revolveconf
211
11k
Building Flexible Design Systems
yeseniaperezcruz
320
37k
Into the Great Unknown - MozCon
thekraken
13
1k
Building Better People: How to give real-time feedback that sticks.
wjessup
356
18k
BBQ
matthewcrist
80
8.8k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
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