https://github.com/isystk/lambda-linebot-openai
LINEから質問すると、ChatGPTが返答してくれるアプリケーションです。
https://github.com/isystk/lambda-linebot-openai
Last synced: 3 months ago
JSON representation
LINEから質問すると、ChatGPTが返答してくれるアプリケーションです。
- Host: GitHub
- URL: https://github.com/isystk/lambda-linebot-openai
- Owner: isystk
- Created: 2023-05-01T11:29:53.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-07T15:09:57.000Z (about 2 years ago)
- Last Synced: 2025-01-10T13:53:04.819Z (5 months ago)
- Language: TypeScript
- Size: 417 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
🌙 lambda-linebot-openai
====


## 📗 プロジェクトの概要
LINEから質問すると、ChatGPTが返答してくれるアプリケーションです。
AWS-Lambdaで動作しています。SAMを利用して自動デプロイ可能です。## 🌐 Demo

## 📦 ディレクトリ構造
```
.
├── README.md
├── app (Lambdaのモジュール)
│ ├── dist
│ ├── jest.config.ts
│ ├── node_modules
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ ├── tests
│ └── tsconfig.json
├── layers (共通モジュール)
│ └── app-layer
├── samconfig.toml
├── task
│ ├── env.json
│ └── env.json.example
└── template.yaml
```## 🔧 開発環境の構築
IAM ユーザーを用意する
```
ユーザ名:「lambda-user」
アクセス権限:
「AdministratorAccess」
```SAM CLI をインストールする
```
$ pip install aws-sam-cli
```AWSにアクセスする為の設定を作成する
```
$ aws configure --profile lambda-user
AWS Access Key ID [None]: xxxxxxxxxx
AWS Secret Access Key [None]: xxxxxxxxxx
Default region name [None]: ap-northeast-1
Default output format [None]: json
```LIMEアプリを作成する
https://developers.line.biz/console
Messaging API設定
## 💬 使い方
AWS にデプロイする
```
# ESModuleでビルドできるようにする
$ npm install -g esbuild
# ビルドを実行する(.aws-samディレクトリに生成される)
$ sam build
# AWSに反映する
$ sam deploy --config-env stg# AWSから、Lambda&APIGatewayを削除する
$ sam delete --stack-name lambda-linebot-openai --profile lambda-user
```## 🎨 参考
| プロジェクト| 概要|
| :---------------------------------------| :-------------------------------|
| [【今日から始めるAWS】Lambdaを使ってLINEのbotをつくる](https://qiita.com/theFirstPenguin/items/8168e8ba3d65e34c24e0)| 【今日から始めるAWS】Lambdaを使ってLINEのbotをつくる |## 🎫 Licence
[MIT](https://github.com/isystk/lambda-linebot-openai/blob/master/LICENSE)
## 👀 Author
[isystk](https://github.com/isystk)