-
Notifications
You must be signed in to change notification settings - Fork 1
Improve env variable section in quickstart #8
Improve env variable section in quickstart #8
Conversation
|
|
WalkthroughA new section was added to the quickstart documentation, guiding users on how to configure environment variables. This includes instructions for creating a Changes
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/swarms/install/quickstart.md (1)
31-36: Demonstrate retrieving loaded variables
You load the.env, but readers won’t know how to access the values. Extend the snippet to includeos.getenvcalls:from dotenv import load_dotenv load_dotenv() +import os +# Fetch your environment variables +api_key = os.getenv("OPENAI_API_KEY") +workspace_dir = os.getenv("WORKSPACE_DIR")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/swarms/install/quickstart.md(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: build (3.12)
- GitHub Check: build (3.11)
- GitHub Check: build
- GitHub Check: build (3.10)
- GitHub Check: pyre
- GitHub Check: test
- GitHub Check: run-examples
| ### Configure Environment Variables | ||
|
|
||
| Create a `.env` file in your project root and add your provider keys along with | ||
| the workspace directory: | ||
|
|
||
| ```bash | ||
| OPENAI_API_KEY="your-openai-key" | ||
| WORKSPACE_DIR="agent_workspace" | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Include dotenv dependency installation and align provider keys
The guide references dotenv but doesn’t tell users how to install it. Add a step in Installation (or under Requirements) such as:
pip install python-dotenvAlso, the Requirements section calls out ANTHROPIC_API_KEY but the .env example only shows OPENAI_API_KEY. Either include all providers in the snippet or add a note that users should add their own keys (e.g., ANTHROPIC_API_KEY) as needed.
🤖 Prompt for AI Agents
In docs/swarms/install/quickstart.md around lines 21 to 29, add instructions to
install the dotenv dependency by including a command like "pip install
python-dotenv" in the Installation or Requirements section. Also, update the
.env example to either include all relevant provider keys such as
ANTHROPIC_API_KEY alongside OPENAI_API_KEY or add a note explaining that users
should add their own provider keys as needed to keep the documentation
consistent and clear.
Summary
.envin quickstart docsTesting
pytest -q(fails: ModuleNotFoundError: No module named 'dotenv')https://chatgpt.com/codex/tasks/task_e_6843134c03a48329adccb934b18e506c
📚 Documentation preview 📚: https://swarms--8.org.readthedocs.build/en/8/
Summary by CodeRabbit
.envfile and loading it using Python. This clarifies setup steps required before running an agent.