Modernize, refine, and standardize the notebook collection#219
Open
sis0k0 wants to merge 16 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR is a broad maintenance and quality pass over the notebook collection, focused on
notebooks/agents/. It normalizes install commands, cleans up cell outputs, adds "Open in Colab" buttons, standardizes environment-variable handling, migrates notebooks to the current Atlas vector index syntax, fixes dead links, and substantively refines several individual agent notebooks. 35 files changed.Deeply refined notebooks
Substantive content and narrative rewrites, not just mechanical edits:
Standardized environment-variable handling
The five modernized notebooks now load secrets consistently:
python-dotenvto the install cell and callload_dotenv()so variables defined in a local.envfile are read automatically.get_or_prompt_env(var_name, prompt_text)helper that returns the value from the environment (.envor already-set) when present, and otherwise falls back to agetpassprompt, raising a clearEnvironmentErrorif left empty.OPENAI_API_KEY,FIREWORKS_API_KEY, andMONGODB_URIare resolved through this helper instead of being hardcoded or prompted ad hoc, so the notebooks run non-interactively when a.envfile is present and prompt gracefully when it is not.Other standardized conventions
Applied consistently across the agent notebooks:
!pipwith%pip, then normalized all installs to%pip install -U -qfor quiet, up-to-date installs.agents/,rag/,evals/, andpartners/.Modernization
Housekeeping
.envfiles out of version control).