open-swarm 0.1.1744936333__py3-none-any.whl → 0.1.1744937124__py3-none-any.whl
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.
- {open_swarm-0.1.1744936333.dist-info → open_swarm-0.1.1744937124.dist-info}/METADATA +101 -1
- {open_swarm-0.1.1744936333.dist-info → open_swarm-0.1.1744937124.dist-info}/RECORD +6 -5
- swarm/extensions/blueprint/slash_commands.py +17 -0
- {open_swarm-0.1.1744936333.dist-info → open_swarm-0.1.1744937124.dist-info}/WHEEL +0 -0
- {open_swarm-0.1.1744936333.dist-info → open_swarm-0.1.1744937124.dist-info}/entry_points.txt +0 -0
- {open_swarm-0.1.1744936333.dist-info → open_swarm-0.1.1744937124.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: open-swarm
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.1744937124
|
4
4
|
Summary: Open Swarm: Orchestrating AI Agent Swarms with Django
|
5
5
|
Project-URL: Homepage, https://github.com/yourusername/open-swarm
|
6
6
|
Project-URL: Documentation, https://github.com/yourusername/open-swarm/blob/main/README.md
|
@@ -111,6 +111,106 @@ Open Swarm can be used in two primary ways:
|
|
111
111
|
|
112
112
|
---
|
113
113
|
|
114
|
+
## Environment Variables
|
115
|
+
|
116
|
+
Open Swarm and its blueprints use a variety of environment variables for configuration, security, and integration with external services. Set these in your shell, `.env` file, Docker environment, or deployment platform as appropriate.
|
117
|
+
|
118
|
+
### Core Framework Environment Variables
|
119
|
+
|
120
|
+
| Variable | Description | Default / Required |
|
121
|
+
|--------------------------|------------------------------------------------------------------|----------------------------|
|
122
|
+
| `OPENAI_API_KEY` | API key for OpenAI LLMs (used by agents and blueprints) | Required for OpenAI usage |
|
123
|
+
| `SWARM_API_KEY` | API key for securing API endpoints (swarm-api) | Optional (recommended) |
|
124
|
+
| `LITELLM_BASE_URL` | Override base URL for LiteLLM/OpenAI-compatible endpoints | Optional |
|
125
|
+
| `LITELLM_API_KEY` | API key for LiteLLM endpoints | Optional |
|
126
|
+
| `SWARM_CONFIG_PATH` | Path to the main Swarm config file (`swarm_config.json`) | `../swarm_config.json` |
|
127
|
+
| `BLUEPRINT_DIRECTORY` | Directory containing blueprint files | `src/swarm/blueprints` |
|
128
|
+
| `DJANGO_SECRET_KEY` | Django secret key (for API mode) | Auto-generated/dev default |
|
129
|
+
| `DJANGO_DEBUG` | Enable Django debug mode | `True` |
|
130
|
+
| `DJANGO_ALLOWED_HOSTS` | Comma-separated allowed hosts for Django API | `localhost,127.0.0.1` |
|
131
|
+
| `API_AUTH_TOKEN` | Token for authenticating API requests | Optional |
|
132
|
+
| `DJANGO_LOG_LEVEL` | Log level for Django app | `INFO` |
|
133
|
+
| `SWARM_LOG_LEVEL` | Log level for Swarm app | `DEBUG` |
|
134
|
+
| `REDIS_HOST` | Host for Redis (if used) | `localhost` |
|
135
|
+
| `REDIS_PORT` | Port for Redis (if used) | `6379` |
|
136
|
+
| `DJANGO_CSRF_TRUSTED_ORIGINS` | Comma-separated trusted origins for CSRF protection | `http://localhost:8000,...`|
|
137
|
+
| `ENABLE_ADMIN` | Enable admin web interface | `false` |
|
138
|
+
| `ENABLE_API_AUTH` | Require API authentication | `true` |
|
139
|
+
|
140
|
+
#### Blueprint/Tool-Specific Variables
|
141
|
+
- Some blueprints and MCP tools may require additional env vars (e.g., Google API keys, Slack tokens, etc.).
|
142
|
+
- Refer to the blueprint's docstring or config for details.
|
143
|
+
|
144
|
+
#### Usage Example
|
145
|
+
```bash
|
146
|
+
export OPENAI_API_KEY="sk-..."
|
147
|
+
export SWARM_API_KEY="..."
|
148
|
+
export LITELLM_BASE_URL="https://open-litellm.fly.dev/v1"
|
149
|
+
# ... set other variables as needed
|
150
|
+
```
|
151
|
+
|
152
|
+
---
|
153
|
+
|
154
|
+
## Toolbox Functionality
|
155
|
+
|
156
|
+
Open Swarm ships with a growing toolbox of agent and blueprint utilities. All features listed below have robust, passing tests unless marked as **WIP** (Work In Progress).
|
157
|
+
|
158
|
+
### Task Scheduler Toolbox
|
159
|
+
- **Schedule jobs with `at`:**
|
160
|
+
- Schedule a shell script or command to run at a specific time (uses the system `at` command).
|
161
|
+
- **Test Status:** Passing
|
162
|
+
- **List scheduled `at` jobs:**
|
163
|
+
- List all jobs currently scheduled with `at`.
|
164
|
+
- **Test Status:** Passing
|
165
|
+
- **Remove `at` jobs:**
|
166
|
+
- Remove a scheduled job by its job ID.
|
167
|
+
- **Test Status:** Passing
|
168
|
+
- **Schedule jobs with `cron`:**
|
169
|
+
- Schedule recurring jobs using cron expressions (uses the system `crontab`).
|
170
|
+
- **Test Status:** Passing
|
171
|
+
- **List scheduled `cron` jobs:**
|
172
|
+
- List all jobs currently scheduled with `crontab`.
|
173
|
+
- **Test Status:** Passing
|
174
|
+
- **Remove `cron` jobs:**
|
175
|
+
- Remove a scheduled cron job by its job ID.
|
176
|
+
- **Test Status:** Passing
|
177
|
+
|
178
|
+
### Slash Command Framework
|
179
|
+
- **Global slash command registry:**
|
180
|
+
- Blueprints can register and use slash commands (e.g., `/help`, `/agent`, `/model`).
|
181
|
+
- Built-in demo commands: `/help`, `/agent`, `/model`.
|
182
|
+
- **Test Status:** Passing
|
183
|
+
- **Blueprint Integration:**
|
184
|
+
- Blueprints can access the global registry and add their own commands.
|
185
|
+
- **Test Status:** Passing
|
186
|
+
|
187
|
+
#### Usage Example (Slash Commands)
|
188
|
+
```python
|
189
|
+
from swarm.extensions.blueprint.slash_commands import slash_command_registry
|
190
|
+
|
191
|
+
@slash_command_registry.register('/hello')
|
192
|
+
def hello_command(args):
|
193
|
+
return f"Hello, {args}!"
|
194
|
+
```
|
195
|
+
|
196
|
+
#### Usage Example (Task Scheduler)
|
197
|
+
```python
|
198
|
+
from swarm.extensions.task_scheduler_toolbox import schedule_at_job, list_at_jobs, remove_at_job
|
199
|
+
|
200
|
+
job_id = schedule_at_job('/path/to/script.sh', run_time='now + 5 minutes')
|
201
|
+
jobs = list_at_jobs()
|
202
|
+
remove_at_job(job_id)
|
203
|
+
```
|
204
|
+
|
205
|
+
---
|
206
|
+
|
207
|
+
## Developer Notes
|
208
|
+
- System dependencies are mocked in tests for CI and portability.
|
209
|
+
- Any toolbox feature not listed as **Passing** above is considered **WIP** and may not be stable.
|
210
|
+
- Contributions and feedback are welcome!
|
211
|
+
|
212
|
+
---
|
213
|
+
|
114
214
|
## Quickstart 1: Using `swarm-cli` Locally (via PyPI)
|
115
215
|
|
116
216
|
This is the recommended way to use `swarm-cli` for managing and running blueprints on your local machine.
|
@@ -61,6 +61,7 @@ swarm/extensions/blueprint/django_utils.py,sha256=ObtkmF1JW4H2OEYa7vC6ussUsMBtDs
|
|
61
61
|
swarm/extensions/blueprint/interactive_mode.py,sha256=vGmMuAgC93TLjMi2RkXQ2FkWfIUblyOTFGHmVdGKLSQ,4572
|
62
62
|
swarm/extensions/blueprint/output_utils.py,sha256=HGpXIujoJNM5nCCzXH0Upog_ctw5BuftmMBiPujh-ZM,7139
|
63
63
|
swarm/extensions/blueprint/runnable_blueprint.py,sha256=1MywZ54vUysLVtYmwCbcDYQmQnoZffCHgsArbe-VKe8,1813
|
64
|
+
swarm/extensions/blueprint/slash_commands.py,sha256=5LEO_veo50_eRDmiGPNnFsI-I6-X-C9NvNNmu1187T0,498
|
64
65
|
swarm/extensions/blueprint/spinner.py,sha256=9lyjzLnQBdEBy_dXr6N6I7nxx6KfrNp7wf44sQN06GU,3756
|
65
66
|
swarm/extensions/blueprint/modes/rest_mode.py,sha256=KZuB_j2NfomER7CmlsLBqRipU3DymKY-9RpoGilMH0I,1357
|
66
67
|
swarm/extensions/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -252,8 +253,8 @@ swarm/views/message_views.py,sha256=sDUnXyqKXC8WwIIMAlWf00s2_a2T9c75Na5FvYMJwBM,
|
|
252
253
|
swarm/views/model_views.py,sha256=aAbU4AZmrOTaPeKMWtoKK7FPYHdaN3Zbx55JfKzYTRY,2937
|
253
254
|
swarm/views/utils.py,sha256=geX3Z5ZDKFYyXYBMilc-4qgOSjhujK3AfRtvbXgFpXk,3643
|
254
255
|
swarm/views/web_views.py,sha256=ExQQeJpZ8CkLZQC_pXKOOmdnEy2qR3wEBP4LLp27DPU,7404
|
255
|
-
open_swarm-0.1.
|
256
|
-
open_swarm-0.1.
|
257
|
-
open_swarm-0.1.
|
258
|
-
open_swarm-0.1.
|
259
|
-
open_swarm-0.1.
|
256
|
+
open_swarm-0.1.1744937124.dist-info/METADATA,sha256=zl7KtHJ1Afbld7hQnSF6pL9JeB3T862AbX-gHFBr3IA,18813
|
257
|
+
open_swarm-0.1.1744937124.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
258
|
+
open_swarm-0.1.1744937124.dist-info/entry_points.txt,sha256=fo28d0_zJrytRsh8QqkdlWQT_9lyAwYUx1WuSTDI3HM,177
|
259
|
+
open_swarm-0.1.1744937124.dist-info/licenses/LICENSE,sha256=BU9bwRlnOt_JDIb6OT55Q4leLZx9RArDLTFnlDIrBEI,1062
|
260
|
+
open_swarm-0.1.1744937124.dist-info/RECORD,,
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Minimal slash_commands.py to restore compatibility
|
2
|
+
|
3
|
+
class SlashCommandRegistry:
|
4
|
+
def __init__(self):
|
5
|
+
self.commands = {}
|
6
|
+
def register(self, command, func=None):
|
7
|
+
if func is None:
|
8
|
+
def decorator(f):
|
9
|
+
self.commands[command] = f
|
10
|
+
return f
|
11
|
+
return decorator
|
12
|
+
self.commands[command] = func
|
13
|
+
return func
|
14
|
+
def get(self, command):
|
15
|
+
return self.commands.get(command)
|
16
|
+
|
17
|
+
slash_registry = SlashCommandRegistry()
|
File without changes
|
{open_swarm-0.1.1744936333.dist-info → open_swarm-0.1.1744937124.dist-info}/entry_points.txt
RENAMED
File without changes
|
{open_swarm-0.1.1744936333.dist-info → open_swarm-0.1.1744937124.dist-info}/licenses/LICENSE
RENAMED
File without changes
|