{"id":22438538,"url":"https://github.com/gs1068/fast-api-slack-gpt-bot","last_synced_at":"2026-05-06T22:10:54.074Z","repository":{"id":266624568,"uuid":"898876239","full_name":"gs1068/fast-api-slack-gpt-bot","owner":"gs1068","description":"This bot is a service that analyzes Slack thread messages and automatically generates responses using ChatGPT. It is built with FastAPI and follows Domain-Driven Design (DDD). Its main use cases include improving team communication efficiency and automating question responses.","archived":false,"fork":false,"pushed_at":"2025-01-01T11:20:01.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T14:17:26.056Z","etag":null,"topics":["ddd","fastapi","gpt-4","python","slack","spreadsheet"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gs1068.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-05T07:50:17.000Z","updated_at":"2025-01-01T13:46:52.000Z","dependencies_parsed_at":"2024-12-05T08:33:34.771Z","dependency_job_id":"a45af02f-e8fe-432f-a9f6-aecfcf07f756","html_url":"https://github.com/gs1068/fast-api-slack-gpt-bot","commit_stats":null,"previous_names":["gs1068/fast-api-slack-gpt-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gs1068%2Ffast-api-slack-gpt-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gs1068%2Ffast-api-slack-gpt-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gs1068%2Ffast-api-slack-gpt-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gs1068%2Ffast-api-slack-gpt-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gs1068","download_url":"https://codeload.github.com/gs1068/fast-api-slack-gpt-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245814746,"owners_count":20676808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ddd","fastapi","gpt-4","python","slack","spreadsheet"],"created_at":"2024-12-06T01:10:29.485Z","updated_at":"2026-05-06T22:10:49.046Z","avatar_url":"https://github.com/gs1068.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slack GPT Bot\n\n## ディレクトリ構成\n\n```\n├── Dockerfile\n├── Makefile\n├── README.md\n├── config\n│   └── load_env.py\n├── domain\n│   ├── model\n│   │   ├── gpt.py\n│   │   ├── slack.py\n│   │   └── spreadsheet.py\n│   └── repository\n│       ├── gpt.py\n│       ├── slack.py\n│       └── spreadsheet.py\n├── infrastructure\n│   ├── __init__.py\n│   ├── gpt\n│   │   └── gpt.py\n│   ├── slack\n│   │   └── slack.py\n│   └── spreadsheet\n│       └── spreadsheet.py\n├── interfaces\n│   ├── __init__.py\n│   ├── gpt.py\n│   └── slack.py\n├── main.py\n├── requirements.txt\n├── router\n│   ├── __init__.py\n│   ├── gpt.py\n│   ├── ping.py\n│   └── slack.py\n└── usecase\n    ├── __init__.py\n    ├── gpt.py\n    └── slack.py\n```\n\n## インフラ構成\n\n![インフラ構成](./images/001.jpg)\n\n### 使用技術\n\n- **言語**: Python(FastAPI)\n- **API**:\n  - Slack API\n  - OpenAI GPT API\n  - Google Spreadsheet API\n- **インフラ**:\n  - Docker\n  - ECR\n  - AWS App Runner\n \n\n## Slack APP\nOAuth \u0026 Permissions\n- app_mentions:read\n- channels:history\n- channels:read\n- chat:write\n- groups:history\n- groups:read\n- im:history\n- im:read\n- im:write\n\nEvent Subscription\n- app_mention\n- message.im\n\n## スプレッドシート\nGCPでこのプロジェクトを作成し、credential.jsonを取得\nプレッドシートの作成とActivityタブを作る\n\n最終利用日時が変わると「一日のトークン使用量」がリセットされる。\n\n![スプレッドシート](./images/002.jpg)\n\n## 環境設定\n\n### `.env` ファイル\n\n以下の環境変数を設定してください。\n\n```plaintext\nSLACK_BOT_TOKEN=\"xoxb-xxxx-xxxx-xxxx-xxxx\"\nOPENAI_API_KEY=\"sk-xxxx-xxxx-xxxx-xxxx\"\nSPREADSHEET_ID=\"xxxx-xxxx-xxxx-xxxx-xxxx\"\nGOOGLE_CREDENTIALS_PATH=\"./credential.json\"\n```\n\nGCP から取得した `credentials.json` ファイルを `./` ディレクトリに配置してください。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgs1068%2Ffast-api-slack-gpt-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgs1068%2Ffast-api-slack-gpt-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgs1068%2Ffast-api-slack-gpt-bot/lists"}