{"id":45375055,"url":"https://github.com/danishi/slack-bot-adk-python-cloudrun","last_synced_at":"2026-02-21T16:10:12.222Z","repository":{"id":311382044,"uuid":"1043536911","full_name":"danishi/slack-bot-adk-python-cloudrun","owner":"danishi","description":"Slack Bot using Google Agent Development Kit (Python, Cloud Run)","archived":false,"fork":false,"pushed_at":"2025-09-30T07:38:07.000Z","size":335,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-26T16:22:32.463Z","etag":null,"topics":["adk","adk-python","cloudrun","gemini","googlecloud","python","slack","slack-bot","vertexai"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danishi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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},"funding":{"github":"danishi","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2025-08-24T04:26:12.000Z","updated_at":"2025-09-18T19:58:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"a5269466-a37c-46f6-8cb3-82355164b10e","html_url":"https://github.com/danishi/slack-bot-adk-python-cloudrun","commit_stats":null,"previous_names":["danishi/slack-bot-adk-python-cloudrun"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/danishi/slack-bot-adk-python-cloudrun","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danishi%2Fslack-bot-adk-python-cloudrun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danishi%2Fslack-bot-adk-python-cloudrun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danishi%2Fslack-bot-adk-python-cloudrun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danishi%2Fslack-bot-adk-python-cloudrun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danishi","download_url":"https://codeload.github.com/danishi/slack-bot-adk-python-cloudrun/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danishi%2Fslack-bot-adk-python-cloudrun/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29685390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T15:51:39.154Z","status":"ssl_error","status_checked_at":"2026-02-21T15:49:03.425Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["adk","adk-python","cloudrun","gemini","googlecloud","python","slack","slack-bot","vertexai"],"created_at":"2026-02-21T16:10:11.727Z","updated_at":"2026-02-21T16:10:12.217Z","avatar_url":"https://github.com/danishi.png","language":"Python","funding_links":["https://github.com/sponsors/danishi"],"categories":[],"sub_categories":[],"readme":"# Slack Bot using Google Agent Development Kit (Python, Cloud Run)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/danishi/slack-bot-adk-python-cloudrun)\n![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)\n\n\u003cimg width=\"1024\" alt=\"image\" src=\"https://github.com/user-attachments/assets/815339c0-5299-498e-8372-d03acc442830\" /\u003e\n\nThis repository provides a Slack bot backend implemented in Python that uses [Slack Bolt](https://slack.dev/bolt-python) and Google Cloud's [Vertex AI Gemini](https://cloud.google.com/vertex-ai) model via the [Agent Development Kit](https://google.github.io/adk-docs/). The bot responds to text, images, PDFs, plain text files, videos, and audio messages, while maintaining conversation context within Slack threads. It is designed to run on [Cloud Run](https://cloud.google.com/run).\n\nIf you want to use the [Google Gen AI SDK](https://googleapis.github.io/python-genai/), please refer to [this repository](https://github.com/danishi/slack-gemini-bot-on-google-cloud)💡\n\nIf you want a simpler, lightweight Slack bot without the ADK framework, check out [Nano Banana](https://github.com/danishi/slack-nano-banana-bot-on-google-cloud)🍌\n\n## Features\n- Responds to `@mention` messages in Slack channels.\n- Supports text, image, PDF, text file, video, and audio inputs from Slack messages. Files are fetched via authenticated URLs and sent to Gemini for multimodal understanding.\n- Maintains conversation context by retrieving prior messages in a thread and sending them as conversation history to Gemini.\n- Formats responses using Slack-compatible Markdown for rich text output.\n- FastAPI-based web server suitable for Cloud Run.\n- Deployment script for building and deploying to Cloud Run.\n\n## Project Structure\n```\napp/\n  main.py           # FastAPI app and Slack Bolt handlers\n  agents/\n    comedian.py     # ex: Comedian agent implementation\n  tools/\n    get_current_datetime.py  # ex: Date/time utility tool\nscripts/\n  deploy.sh         # Helper script to deploy to Cloud Run\nDockerfile          # Container definition for Cloud Run\nrequirements.txt    # Python dependencies\nllms.txt           # ADK documentation for LLM reference\nllms-full.txt      # Extended ADK documentation for LLM context\n```\n\n## Prerequisites\n- Python 3.13\n- [Google Cloud SDK](https://cloud.google.com/sdk) with `gcloud` authenticated\n- Slack workspace admin privileges\n\n## Local Development\n1. Install dependencies\n   ```bash\n   python -m venv venv\n   source venv/bin/activate\n   pip install -r requirements.txt\n   ```\n2. Configure environment variables\n   ```bash\n   cp .env.example .env\n   # edit .env and set your Slack and Google Cloud credentials\n   # ALLOWED_SLACK_WORKSPACE is the Slack team ID to allow requests from\n   ```\n3. Run the server\n   ```bash\n   uvicorn app.main:fastapi_app --host 0.0.0.0 --port 8080 --reload\n   ```\n4. Use a tunneling tool like `ngrok` to expose `http://localhost:8080/slack/events` to Slack during development.\n\n### Optional: Use the ADK Web Development UI\n\nThe Agent Development Kit includes a built-in web-based Development UI that you can run locally. It's a powerful tool for testing, debugging, and interacting with your agent during development. It provides a chat interface to send messages to your agent and inspect the results.\n\n1.  **Start the ADK web server:**\n    ```bash\n    gcloud auth application-default login\n    adk web\n    ```\n\n2.  **Interact with your agent:**\n    Open the local URL (usually `http://127.0.0.1:8000`) in your browser to use the Development UI.\n\n## Slack App Configuration\n1. Create a new Slack app at \u003chttps://api.slack.com/apps\u003e.\n2. Under **OAuth \u0026 Permissions**, add the following Bot Token scopes:\n   - `app_mentions:read`\n   - `chat:write`\n   - `channels:history`\n   - `groups:history`\n   - `im:history`\n   - `mpim:history`\n   - `files:read`\n   - `reactions:write`\n   - `users:read`\n3. Install the app to your workspace to obtain `SLACK_BOT_TOKEN` and `SLACK_SIGNING_SECRET`.\n4. Enable **Event Subscriptions** and set the Request URL to `https://\u003cyour-cloud-run-service-url\u003e/slack/events`.\n5. Subscribe to bot events: `app_mention`.\n6. Invite the bot to channels where you want to use it.\n\n## Deploy to Cloud Run\nThe repository includes a helper script to build the container and deploy to Cloud Run. Ensure your `.env` contains `SLACK_BOT_TOKEN` and `SLACK_SIGNING_SECRET` before running:\n\n### One-time setup (first run only)\nEnable the Cloud Build API for your project:\n```bash\ngcloud services enable cloudbuild.googleapis.com\n```\n\nThen deploy:\n```bash\n./scripts/deploy.sh\n```\n\nThe script will:\n1. Build the container image using Cloud Build.\n2. Deploy the image to Cloud Run.\n3. Set the required environment variables on the service.\n\nAfter deployment, configure the Slack app's event subscription URL to the Cloud Run service URL.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanishi%2Fslack-bot-adk-python-cloudrun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanishi%2Fslack-bot-adk-python-cloudrun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanishi%2Fslack-bot-adk-python-cloudrun/lists"}