[EXAMPLES CLEANUP]

pull/594/merge
Your Name 3 months ago
parent d8d2c62567
commit ef41e7e98c

@ -47,6 +47,7 @@ Swarms is an enterprise grade and production ready multi-agent collaboration fra
- `$ pip install -U swarms` And, don't forget to install swarms! - `$ pip install -U swarms` And, don't forget to install swarms!
- `.env` file with API keys from your providers like `OPENAI_API_KEY`, `ANTHROPIC_API_KEY` - `.env` file with API keys from your providers like `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`
- Set an `.env` Variable with your desired workspace dir: `WORKSPACE_DIR="agent_workspace"` or do it in your terminal with `export WORKSPACE_DIR="agent_workspace"` - Set an `.env` Variable with your desired workspace dir: `WORKSPACE_DIR="agent_workspace"` or do it in your terminal with `export WORKSPACE_DIR="agent_workspace"`
- Finally, `swarms onboarding` to get you started.
## Onboarding ## Onboarding
Refer to our documentation for production grade implementation details. Refer to our documentation for production grade implementation details.

@ -79,8 +79,15 @@ class SwarmRouter:
**kwargs: Arbitrary keyword arguments. **kwargs: Arbitrary keyword arguments.
Raises: Raises:
ValueError: If an invalid swarm type is provided. ValueError: If an invalid swarm type is provided, or if there are no agents, or if swarm type is "none", or if max_loops is 0.
""" """
if not agents:
raise ValueError("No agents provided for the swarm.")
if swarm_type is None:
raise ValueError("Swarm type cannot be 'none'.")
if max_loops == 0:
raise ValueError("max_loops cannot be 0.")
self.name = name self.name = name
self.description = description self.description = description
self.max_loops = max_loops self.max_loops = max_loops

Loading…
Cancel
Save