{"id":27773563,"url":"https://github.com/shunji-taki/aichan","last_synced_at":"2026-05-04T13:36:31.852Z","repository":{"id":290401026,"uuid":"971506836","full_name":"shunji-taki/aichan","owner":"shunji-taki","description":" Slack上でOpenAIを使う会話型AIボット「AIちゃん」のソースコード","archived":false,"fork":false,"pushed_at":"2025-06-11T08:13:34.000Z","size":135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-16T19:20:23.353Z","etag":null,"topics":["chatbot","openai","openai-api-chatbot","python","slack","slack-bolt","slack-bot","sqlite"],"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/shunji-taki.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-23T16:14:54.000Z","updated_at":"2025-06-11T08:13:38.000Z","dependencies_parsed_at":"2025-10-16T15:35:18.005Z","dependency_job_id":"49087b7a-bcac-4cff-a918-a72b3f063d73","html_url":"https://github.com/shunji-taki/aichan","commit_stats":null,"previous_names":["shunji-taki/aichan"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shunji-taki/aichan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shunji-taki%2Faichan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shunji-taki%2Faichan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shunji-taki%2Faichan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shunji-taki%2Faichan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shunji-taki","download_url":"https://codeload.github.com/shunji-taki/aichan/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shunji-taki%2Faichan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32610100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["chatbot","openai","openai-api-chatbot","python","slack","slack-bolt","slack-bot","sqlite"],"created_at":"2025-04-30T01:10:20.688Z","updated_at":"2026-05-04T13:36:31.846Z","avatar_url":"https://github.com/shunji-taki.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AIちゃん (Aichan - Slack Bot for OpenAI)\n\nSlack 上で OpenAI API を活用する、会話型 AI ボットです。\n\n会話履歴やシステムプロンプトの記録、統計管理、スレッドごとの文脈保持などを特徴としています。\n\nSlack Bolt + OpenAI + SQLite3 + FastAPIによるシンプルかつ柔軟な構成です。\n\n## 構成ファイル\n- app.py : メインアプリケーション。Slackイベントやコマンド処理のロジックを含みます。\n- onetime_www.py : OpenAIに画像ファイルを渡す処理の実装\n- requirements.txt : 必要な Python パッケージ一覧。\n\n## 主な機能\n- GPT-4.1（nano/mini含む）によるスレッド文脈を加味した対話\n- Slackチャンネルごとのモデル切替対応（gpt-4.1, gpt-4.1-mini, gpt-4.1-nano）\n- Slackチャンネルごとのシステムプロンプト（スラッシュコマンドで設定可能）\n- SQLite による会話履歴と統計の保存\n- メンションやスレッド内での応答、時々発話機能\n- URL引き渡しによる画像ファイルのAI入力（画像生成には未対応）\n- トークン使用量と想定コストを表示（USD/JPY換算）\n\n## セットアップ方法\n1.\tリポジトリをクローン\n\n```bash\ngit clone https://github.com/shunji-taki/aichan.git\ncd aichan\n```\n\n2.\tPython 仮想環境を作成し、依存関係をインストール\n\n```bash\npython3 -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\n3.\t.env ファイルを作成し、以下を記述\n\n```env\nSLACK_BOT_TOKEN=（Slack Bot Token）\nSLACK_APP_TOKEN=（Socket Mode Token）\nOPENAI_API_KEY=（OpenAI API Key）\nBOSS_SLACK_USERID=（オーナーのSlack User ID）\nBOT_FILESERVER_BASEURL=（OpenAIから到達可能なURL。https必須）\n```\n\n4.\tアプリ起動\n\n```bash\npython app.py\n```\n\n## スラッシュコマンド一覧\n- /ai_replace_sysprompt : システムプロンプトを新しい内容に置き換える\n- /ai_set_persona       : チャンネルでのペルソナを設定する\n- /ai-model             : チャンネルでのOpenAIモデルを変更する\n- /ai-tokens            : トークン使用状況とコスト統計を表示する\n- /ai-tweet             : ときどき発話する機能を設定する\n\n## データファイル（SQLite）\n- conversation.db : 会話ログの記録\n- sysmemory.db    : システムプロンプトやトークン統計の保存\n\n## 画像ファイル置き場\n- /tmp/image_files/*\n\n## 依存ライブラリ（抜粋）\n- slack-bolt\n- openai\n- python-dotenv\n- tiktoken\n- fastapi + uvicorn\n- pillow\n\n## ライセンス\n\n本プロジェクトのライセンスは未定です。再利用・商用利用については著作権者の許可を得てください。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshunji-taki%2Faichan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshunji-taki%2Faichan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshunji-taki%2Faichan/lists"}