python-slack-agents 0.5.0__tar.gz → 0.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/AGENTS.md +22 -0
- python_slack_agents-0.6.1/CHANGELOG.md +60 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/CONTRIBUTING.md +13 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/PKG-INFO +38 -10
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/README.md +37 -9
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/cli.md +10 -0
- python_slack_agents-0.6.1/docs/private-repo.md +65 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/setup.md +25 -8
- python_slack_agents-0.6.1/llms-full.txt +1179 -0
- python_slack_agents-0.6.1/llms.txt +60 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/pyproject.toml +4 -1
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/Dockerfile +5 -4
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/__init__.py +2 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/build_docker.py +22 -0
- python_slack_agents-0.6.1/src/slack_agents/cli/init.py +128 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/config.py +6 -0
- python_slack_agents-0.6.1/src/slack_agents/scripts/generate_llms_full.py +75 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/uv.lock +1 -1
- python_slack_agents-0.5.0/CHANGELOG.md +0 -22
- python_slack_agents-0.5.0/docs/private-repo.md +0 -72
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/.dockerignore +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/.env.example +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/.github/workflows/ci.yml +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/.github/workflows/publish.yml +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/.gitignore +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/.pre-commit-config.yaml +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/CODE_OF_CONDUCT.md +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/LICENSE +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/SECURITY.md +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/agents/README.md +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/agents/docs-assistant/config.yaml +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/agents/docs-assistant/system_prompt.txt +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/agents/hello-world/config.yaml +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/agents/hello-world/system_prompt.txt +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/agents/kitchen-sink/config.yaml +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/agents/kitchen-sink/system_prompt.txt +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/access-control.md +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/agents.md +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/canvas.md +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/deployment.md +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/llm.md +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/media/demo.gif +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/observability.md +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/slack-app-manifest.json +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/storage.md +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/tools.md +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/docs/user-context.md +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/__init__.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/access/__init__.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/access/allow_all.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/access/allow_list.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/access/base.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/agent_loop.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/export_conversations.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/export_conversations_html.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/export_usage.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/export_usage_csv.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/healthcheck.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/run.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/conversations.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/files.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/llm/__init__.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/llm/anthropic.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/llm/base.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/llm/openai.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/main.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/observability.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/py.typed +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/scripts/__init__.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/scripts/download_fonts.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/__init__.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/actions.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/agent.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/canvases.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/files.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/format.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/streaming.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/streaming_formatter.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/tool_blocks.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/__init__.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/base.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/postgres.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/postgres.sql +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/sqlite.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/sqlite.sql +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/__init__.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/base.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/canvas.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/file_exporter.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/file_importer.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/mcp_http.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/user_context.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/__init__.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_access.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_agent_loop.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_cli.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_config.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_conversations.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_cost.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_export_documents.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_export_usage.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_file_extractors.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_format.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_llm_factory.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_mcp_client.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_openai_convert.py +0 -0
- {python_slack_agents-0.5.0 → python_slack_agents-0.6.1}/tests/test_tool_blocks.py +0 -0
|
@@ -90,9 +90,31 @@ Each agent lives in `agents/<name>/` with `config.yaml` and `system_prompt.txt`.
|
|
|
90
90
|
- **Tool definitions in Anthropic format** -- `{"name", "description", "input_schema"}` is the canonical format everywhere
|
|
91
91
|
- **1 replica per agent** -- Socket Mode requires exactly one WebSocket connection per app
|
|
92
92
|
|
|
93
|
+
## AI Documentation Files
|
|
94
|
+
|
|
95
|
+
The project includes AI-agent-friendly documentation following the llms.txt convention:
|
|
96
|
+
|
|
97
|
+
- `llms.txt` (repo root) -- concise index pointing to docs and llms-full.txt
|
|
98
|
+
- `llms-full.txt` (repo root) -- generated from docs via `python3 src/slack_agents/scripts/generate_llms_full.py`
|
|
99
|
+
- `llms-full.txt` is bundled in the PyPI wheel via `force-include` in pyproject.toml
|
|
100
|
+
|
|
101
|
+
**When modifying docs:** re-run `python3 src/slack_agents/scripts/generate_llms_full.py` and commit the result.
|
|
102
|
+
|
|
103
|
+
## Releasing
|
|
104
|
+
|
|
105
|
+
1. Update `version` in `pyproject.toml`
|
|
106
|
+
2. Update `CHANGELOG.md` with the new version and changes
|
|
107
|
+
3. Run `python3 src/slack_agents/scripts/generate_llms_full.py` to regenerate `llms-full.txt`
|
|
108
|
+
4. Commit and push to `main`
|
|
109
|
+
5. Create a GitHub Release (which creates a git tag)
|
|
110
|
+
6. The `publish.yml` workflow automatically builds and publishes to PyPI via trusted publishing
|
|
111
|
+
|
|
112
|
+
The PyPI deployment requires manual approval in the GitHub Actions UI. Do NOT publish to PyPI manually — the GitHub Release trigger handles it.
|
|
113
|
+
|
|
93
114
|
## Style
|
|
94
115
|
|
|
95
116
|
- Python 3.12+, line length 100
|
|
96
117
|
- Ruff rules: E, F, I (errors, pyflakes, isort)
|
|
97
118
|
- Keep it simple. Minimal abstractions, no unnecessary indirection.
|
|
98
119
|
- Commit messages: Conventional Commits — `feat:`, `fix:`, `docs:`, `chore:`, `test:`, `refactor:`. Lowercase, imperative, under 72 chars.
|
|
120
|
+
- **Always propose the commit message and wait for explicit user approval before committing or pushing.** Never commit or push autonomously.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.6.1] - 2026-03-19
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `slack-agents init` now generates `.gitignore`
|
|
14
|
+
- `.env.example` template includes comments explaining where to get each token and links to setup guide
|
|
15
|
+
- `build-docker` lists required environment variables after build completes
|
|
16
|
+
- `build-docker` errors if `req*.txt` files are found (dependencies must be in `pyproject.toml`)
|
|
17
|
+
- `init` warns when `req*.txt` files are found with migration instructions
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- `pyproject.toml` template uses `python-slack-agents<2` (no minimum pin)
|
|
22
|
+
- Setup flow uses venv-first approach: create venv, install package, then `slack-agents init`
|
|
23
|
+
- Updated README, docs/setup.md, and docs/private-repo.md with new setup flow
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- Config loader now strips YAML comments before env var interpolation — commented-out `{ENV_VAR}` patterns no longer cause `KeyError`
|
|
28
|
+
- `init` shows proposed file content when skipping existing files
|
|
29
|
+
|
|
30
|
+
## [0.6.0] - 2026-03-18
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- `slack-agents init <project_name>` CLI command to scaffold new projects
|
|
35
|
+
- `llms.txt` and `llms-full.txt` for AI agent discoverability
|
|
36
|
+
- `llms-full.txt` bundled in PyPI wheel
|
|
37
|
+
- Script to generate `llms-full.txt` from docs (`src/slack_agents/scripts/generate_llms_full.py`)
|
|
38
|
+
- "Project Structure" section in README
|
|
39
|
+
- Release process documentation in AGENTS.md
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- Simplified Dockerfile: empty placeholders for README.md and llms-full.txt so builds work for both framework and user projects
|
|
44
|
+
- Updated docs/private-repo.md to use `slack-agents init`
|
|
45
|
+
- Updated docs/cli.md with `init` command reference
|
|
46
|
+
|
|
47
|
+
## [0.5.0] - 2025-03-13
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- Plugin architecture for LLM providers, storage backends, and tools
|
|
52
|
+
- Anthropic and OpenAI LLM providers
|
|
53
|
+
- SQLite and PostgreSQL storage providers
|
|
54
|
+
- MCP over HTTP tool provider
|
|
55
|
+
- Built-in document export tools (PDF, DOCX, XLSX, CSV, PPTX)
|
|
56
|
+
- Streaming output with native Slack table rendering
|
|
57
|
+
- Socket Mode support (no public URL required)
|
|
58
|
+
- OpenTelemetry observability
|
|
59
|
+
- `{ENV_VAR}` interpolation in agent configs
|
|
60
|
+
- Per-agent Docker builds via `docker-build-and-push.sh`
|
|
@@ -67,6 +67,19 @@ Keep PRs focused — one concern per PR. Small PRs get reviewed faster.
|
|
|
67
67
|
|
|
68
68
|
LLM providers, storage backends, and tools all follow the same pattern: a module with a `Provider` class. See the [docs/](docs/) directory for guides on creating each type.
|
|
69
69
|
|
|
70
|
+
## AI Documentation
|
|
71
|
+
|
|
72
|
+
This project ships `llms.txt` and `llms-full.txt` for AI agent discoverability. `llms-full.txt` is bundled in the PyPI wheel and generated from the docs by concatenation:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
python3 src/slack_agents/scripts/generate_llms_full.py
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
When making changes that affect docs:
|
|
79
|
+
- Update the relevant file in `docs/` as you normally would
|
|
80
|
+
- Re-run the script above to regenerate `llms-full.txt` and commit the result
|
|
81
|
+
- `llms.txt` only needs updating if you add/remove/rename a doc file
|
|
82
|
+
|
|
70
83
|
## License
|
|
71
84
|
|
|
72
85
|
By contributing, you agree that your contributions will be licensed under the Apache 2.0 License.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-slack-agents
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.1
|
|
4
4
|
Summary: A Python framework for deploying AI agents as Slack bots
|
|
5
5
|
Project-URL: Homepage, https://github.com/CompareNetworks/python-slack-agents
|
|
6
6
|
Project-URL: Repository, https://github.com/CompareNetworks/python-slack-agents
|
|
@@ -82,15 +82,17 @@ Each agent is a directory with two files: a `config.yaml` and a `system_prompt.t
|
|
|
82
82
|
## Quick Start
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
+
mkdir my-agents && cd my-agents
|
|
86
|
+
python3 -m venv .venv
|
|
87
|
+
source .venv/bin/activate
|
|
85
88
|
pip install python-slack-agents
|
|
86
89
|
|
|
87
|
-
#
|
|
88
|
-
|
|
90
|
+
# Scaffold the project
|
|
91
|
+
slack-agents init my-agents
|
|
89
92
|
|
|
90
|
-
#
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
ANTHROPIC_API_KEY=sk-ant-...
|
|
93
|
+
# Add your tokens and install for development
|
|
94
|
+
cp .env.example .env # add your Slack and LLM tokens
|
|
95
|
+
pip install -e .
|
|
94
96
|
|
|
95
97
|
# Run the hello-world agent
|
|
96
98
|
slack-agents run agents/hello-world
|
|
@@ -170,6 +172,7 @@ All secrets in `{ENV_VAR}` are resolved from environment variables at startup.
|
|
|
170
172
|
## CLI
|
|
171
173
|
|
|
172
174
|
```bash
|
|
175
|
+
slack-agents init <project-name> # scaffold a new project
|
|
173
176
|
slack-agents run agents/<name> # start an agent
|
|
174
177
|
slack-agents healthcheck agents/<name> # liveness probe (for k8s)
|
|
175
178
|
slack-agents export-conversations agents/<name> \ # export conversation history
|
|
@@ -238,20 +241,39 @@ tools:
|
|
|
238
241
|
- "get_document" # exact match works too
|
|
239
242
|
```
|
|
240
243
|
|
|
244
|
+
## Project Structure
|
|
245
|
+
|
|
246
|
+
When you add custom providers (tools, LLM, storage, or access control), your project needs a `pyproject.toml` and a `src/` directory so that `pip install -e .` makes your code importable and `slack-agents build-docker` works:
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
my-agents/
|
|
250
|
+
├── pyproject.toml # declares python-slack-agents as dependency
|
|
251
|
+
├── src/
|
|
252
|
+
│ └── my_agents/ # your custom providers go here
|
|
253
|
+
│ └── __init__.py
|
|
254
|
+
├── agents/
|
|
255
|
+
│ └── my-agent/
|
|
256
|
+
│ ├── config.yaml
|
|
257
|
+
│ └── system_prompt.txt
|
|
258
|
+
└── .env
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
`slack-agents init` scaffolds this for you. See [Organizing agents](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/private-repo.md) for details.
|
|
262
|
+
|
|
241
263
|
## Extending
|
|
242
264
|
|
|
243
|
-
Every pluggable component follows the same pattern. Add a new LLM provider, storage backend, tool, or access policy by creating a module with a `Provider` class
|
|
265
|
+
Every pluggable component follows the same pattern. Add a new LLM provider, storage backend, tool, or access policy by creating a module with a `Provider` class in `src/`:
|
|
244
266
|
|
|
245
267
|
```yaml
|
|
246
268
|
# In config.yaml
|
|
247
269
|
llm:
|
|
248
|
-
type:
|
|
270
|
+
type: my_agents.my_llm_provider
|
|
249
271
|
model: my-model
|
|
250
272
|
api_key: "{MY_API_KEY}"
|
|
251
273
|
```
|
|
252
274
|
|
|
253
275
|
```python
|
|
254
|
-
# In
|
|
276
|
+
# In src/my_agents/my_llm_provider.py
|
|
255
277
|
from slack_agents.llm.base import BaseLLMProvider
|
|
256
278
|
|
|
257
279
|
class Provider(BaseLLMProvider):
|
|
@@ -259,6 +281,8 @@ class Provider(BaseLLMProvider):
|
|
|
259
281
|
...
|
|
260
282
|
```
|
|
261
283
|
|
|
284
|
+
After `pip install -e .`, your providers are importable and the `type` field in config resolves them. This also works with `slack-agents build-docker` — the bundled Dockerfile runs `pip install .` automatically.
|
|
285
|
+
|
|
262
286
|
See the docs for the full interface for each component:
|
|
263
287
|
|
|
264
288
|
- [LLM providers](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/llm.md)
|
|
@@ -299,6 +323,10 @@ To create a Slack app, use the manifest in [`docs/slack-app-manifest.json`](http
|
|
|
299
323
|
- [CLI](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/cli.md) — command reference
|
|
300
324
|
- [Organizing agents](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/private-repo.md) — in-repo, separate directory, or private repository
|
|
301
325
|
|
|
326
|
+
## For AI Agents
|
|
327
|
+
|
|
328
|
+
If you're an AI agent or coding assistant, see [`llms-full.txt`](https://raw.githubusercontent.com/CompareNetworks/python-slack-agents/main/llms-full.txt) for a complete, single-file reference to the config schema, all providers, and the plugin system. After `pip install`, the reference is available locally inside the package at `slack_agents/llms-full.txt`.
|
|
329
|
+
|
|
302
330
|
## Related Projects
|
|
303
331
|
|
|
304
332
|
If this framework isn't the right fit, here are some good alternatives:
|
|
@@ -36,15 +36,17 @@ Each agent is a directory with two files: a `config.yaml` and a `system_prompt.t
|
|
|
36
36
|
## Quick Start
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
+
mkdir my-agents && cd my-agents
|
|
40
|
+
python3 -m venv .venv
|
|
41
|
+
source .venv/bin/activate
|
|
39
42
|
pip install python-slack-agents
|
|
40
43
|
|
|
41
|
-
#
|
|
42
|
-
|
|
44
|
+
# Scaffold the project
|
|
45
|
+
slack-agents init my-agents
|
|
43
46
|
|
|
44
|
-
#
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
ANTHROPIC_API_KEY=sk-ant-...
|
|
47
|
+
# Add your tokens and install for development
|
|
48
|
+
cp .env.example .env # add your Slack and LLM tokens
|
|
49
|
+
pip install -e .
|
|
48
50
|
|
|
49
51
|
# Run the hello-world agent
|
|
50
52
|
slack-agents run agents/hello-world
|
|
@@ -124,6 +126,7 @@ All secrets in `{ENV_VAR}` are resolved from environment variables at startup.
|
|
|
124
126
|
## CLI
|
|
125
127
|
|
|
126
128
|
```bash
|
|
129
|
+
slack-agents init <project-name> # scaffold a new project
|
|
127
130
|
slack-agents run agents/<name> # start an agent
|
|
128
131
|
slack-agents healthcheck agents/<name> # liveness probe (for k8s)
|
|
129
132
|
slack-agents export-conversations agents/<name> \ # export conversation history
|
|
@@ -192,20 +195,39 @@ tools:
|
|
|
192
195
|
- "get_document" # exact match works too
|
|
193
196
|
```
|
|
194
197
|
|
|
198
|
+
## Project Structure
|
|
199
|
+
|
|
200
|
+
When you add custom providers (tools, LLM, storage, or access control), your project needs a `pyproject.toml` and a `src/` directory so that `pip install -e .` makes your code importable and `slack-agents build-docker` works:
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
my-agents/
|
|
204
|
+
├── pyproject.toml # declares python-slack-agents as dependency
|
|
205
|
+
├── src/
|
|
206
|
+
│ └── my_agents/ # your custom providers go here
|
|
207
|
+
│ └── __init__.py
|
|
208
|
+
├── agents/
|
|
209
|
+
│ └── my-agent/
|
|
210
|
+
│ ├── config.yaml
|
|
211
|
+
│ └── system_prompt.txt
|
|
212
|
+
└── .env
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
`slack-agents init` scaffolds this for you. See [Organizing agents](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/private-repo.md) for details.
|
|
216
|
+
|
|
195
217
|
## Extending
|
|
196
218
|
|
|
197
|
-
Every pluggable component follows the same pattern. Add a new LLM provider, storage backend, tool, or access policy by creating a module with a `Provider` class
|
|
219
|
+
Every pluggable component follows the same pattern. Add a new LLM provider, storage backend, tool, or access policy by creating a module with a `Provider` class in `src/`:
|
|
198
220
|
|
|
199
221
|
```yaml
|
|
200
222
|
# In config.yaml
|
|
201
223
|
llm:
|
|
202
|
-
type:
|
|
224
|
+
type: my_agents.my_llm_provider
|
|
203
225
|
model: my-model
|
|
204
226
|
api_key: "{MY_API_KEY}"
|
|
205
227
|
```
|
|
206
228
|
|
|
207
229
|
```python
|
|
208
|
-
# In
|
|
230
|
+
# In src/my_agents/my_llm_provider.py
|
|
209
231
|
from slack_agents.llm.base import BaseLLMProvider
|
|
210
232
|
|
|
211
233
|
class Provider(BaseLLMProvider):
|
|
@@ -213,6 +235,8 @@ class Provider(BaseLLMProvider):
|
|
|
213
235
|
...
|
|
214
236
|
```
|
|
215
237
|
|
|
238
|
+
After `pip install -e .`, your providers are importable and the `type` field in config resolves them. This also works with `slack-agents build-docker` — the bundled Dockerfile runs `pip install .` automatically.
|
|
239
|
+
|
|
216
240
|
See the docs for the full interface for each component:
|
|
217
241
|
|
|
218
242
|
- [LLM providers](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/llm.md)
|
|
@@ -253,6 +277,10 @@ To create a Slack app, use the manifest in [`docs/slack-app-manifest.json`](http
|
|
|
253
277
|
- [CLI](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/cli.md) — command reference
|
|
254
278
|
- [Organizing agents](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/private-repo.md) — in-repo, separate directory, or private repository
|
|
255
279
|
|
|
280
|
+
## For AI Agents
|
|
281
|
+
|
|
282
|
+
If you're an AI agent or coding assistant, see [`llms-full.txt`](https://raw.githubusercontent.com/CompareNetworks/python-slack-agents/main/llms-full.txt) for a complete, single-file reference to the config schema, all providers, and the plugin system. After `pip install`, the reference is available locally inside the package at `slack_agents/llms-full.txt`.
|
|
283
|
+
|
|
256
284
|
## Related Projects
|
|
257
285
|
|
|
258
286
|
If this framework isn't the right fit, here are some good alternatives:
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All commands are available as `slack-agents <command>`.
|
|
4
4
|
|
|
5
|
+
## init
|
|
6
|
+
|
|
7
|
+
Scaffold a new project in the current directory.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
slack-agents init <project_name>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Creates `pyproject.toml`, `src/<package>/`, `.env.example`, and a `hello-world` agent. Existing files are skipped with a warning.
|
|
14
|
+
|
|
5
15
|
## run
|
|
6
16
|
|
|
7
17
|
Start a Slack agent.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Organizing Your Agents
|
|
2
|
+
|
|
3
|
+
Agents are just directories with `config.yaml` and `system_prompt.txt`. Where you put them depends on your situation.
|
|
4
|
+
|
|
5
|
+
## Option 1: In the framework repo
|
|
6
|
+
|
|
7
|
+
If you're developing the framework itself, add agents directly to `agents/`. To keep private agents out of version control, use a gitignored directory instead:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
slack-agents run agents-local/my-agent
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Option 2: Separate repository
|
|
14
|
+
|
|
15
|
+
For production agents with company-specific prompts, tools, and configs, create a standalone repository:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
mkdir my-agents && cd my-agents
|
|
19
|
+
python3 -m venv .venv
|
|
20
|
+
source .venv/bin/activate
|
|
21
|
+
pip install python-slack-agents
|
|
22
|
+
slack-agents init my-agents
|
|
23
|
+
pip install -e .
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This scaffolds:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
my-agents/
|
|
30
|
+
├── pyproject.toml
|
|
31
|
+
├── src/
|
|
32
|
+
│ └── my_agents/
|
|
33
|
+
│ └── __init__.py
|
|
34
|
+
├── agents/
|
|
35
|
+
│ └── hello-world/
|
|
36
|
+
│ ├── config.yaml
|
|
37
|
+
│ └── system_prompt.txt
|
|
38
|
+
└── .env.example
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The `pyproject.toml` and `src/` directory are required so that:
|
|
42
|
+
|
|
43
|
+
- **`slack-agents run`** can import custom providers under `src/` (via `pip install -e .`)
|
|
44
|
+
- **`slack-agents build-docker`** works (the bundled Dockerfile runs `pip install .`)
|
|
45
|
+
|
|
46
|
+
### Custom providers
|
|
47
|
+
|
|
48
|
+
Add custom providers to `src/` and reference them in config:
|
|
49
|
+
|
|
50
|
+
```yaml
|
|
51
|
+
tools:
|
|
52
|
+
internal-api:
|
|
53
|
+
type: my_agents.tools.internal_api
|
|
54
|
+
allowed_functions: [".*"]
|
|
55
|
+
base_url: "{INTERNAL_API_URL}"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Docker
|
|
59
|
+
|
|
60
|
+
No custom Dockerfile needed — `python-slack-agents` bundles one:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
slack-agents build-docker agents/my-agent
|
|
64
|
+
slack-agents build-docker agents/my-agent --push registry.example.com
|
|
65
|
+
```
|
|
@@ -6,9 +6,32 @@
|
|
|
6
6
|
- A Slack workspace (all plans supported, including free)
|
|
7
7
|
- API key for your LLM provider (Anthropic and/or OpenAI)
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## New Project
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
+
mkdir my-agents && cd my-agents
|
|
13
|
+
python3 -m venv .venv
|
|
14
|
+
source .venv/bin/activate
|
|
15
|
+
pip install python-slack-agents
|
|
16
|
+
|
|
17
|
+
# Scaffold the project
|
|
18
|
+
slack-agents init my-agents
|
|
19
|
+
|
|
20
|
+
# Add your tokens and install for development
|
|
21
|
+
cp .env.example .env # add your Slack and LLM tokens (see below)
|
|
22
|
+
pip install -e .
|
|
23
|
+
|
|
24
|
+
# Run the hello-world agent
|
|
25
|
+
slack-agents run agents/hello-world
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Framework Development
|
|
29
|
+
|
|
30
|
+
If you're working on the framework itself:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clone https://github.com/CompareNetworks/python-slack-agents.git
|
|
34
|
+
cd python-slack-agents
|
|
12
35
|
python3 -m venv .venv
|
|
13
36
|
source .venv/bin/activate
|
|
14
37
|
pip install -e ".[dev]"
|
|
@@ -40,7 +63,7 @@ ANTHROPIC_API_KEY=sk-ant-...
|
|
|
40
63
|
- Copy: App Token (eg, SLACK_APP_TOKEN=xapp-...)
|
|
41
64
|
- Settings > Install App
|
|
42
65
|
- Copy: Bot User OAuth Token (eg, SLACK_BOT_TOKEN=xoxb-...)
|
|
43
|
-
3. If App does not
|
|
66
|
+
3. If App does not appear in your Slack client:
|
|
44
67
|
- ... > Tools > Apps > (search by name and add the app)
|
|
45
68
|
|
|
46
69
|
## Download Fonts
|
|
@@ -53,12 +76,6 @@ python -m slack_agents.scripts.download_fonts
|
|
|
53
76
|
|
|
54
77
|
This downloads `DejaVuSans.ttf` and `DejaVuSans-Bold.ttf` into `fonts/` (~700KB total). Without these fonts, PDF generation falls back to Helvetica (latin-1 only).
|
|
55
78
|
|
|
56
|
-
## Running an Agent
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
slack-agents run agents/hello-world
|
|
60
|
-
```
|
|
61
|
-
|
|
62
79
|
## Optional: PostgreSQL
|
|
63
80
|
|
|
64
81
|
For conversation persistence via PostgreSQL, update your agent's `config.yaml`:
|