latest/: Current course code and the WildChat case study (latest/case_study/{core,pipelines}).cohort_1/,cohort_2/: Earlier cohort materials kept for reference.docs/: MkDocs book sources; site config inmkdocs.yml.docs/workshops/: Chapter contentchapterN.mdand subpartschapterN-M.md; entrypoint isdocs/workshops/index.md.docs/slides/: Slide deckschapterN-slides.mdfor workshop chapters.md/: Markdown exports of notebooks; images inimages/.scripts/,build_book.sh: Utilities for diagrams and building the PDF/ebook.
- Install deps:
uv install(recommended) orpip install -e .. - Lint/fix:
uv run ruff check --fix --unsafe-fixes .. - Format:
uv run ruff format .. - Tests:
uv run pytest -q(supportspytest-asyncio). - Docs (local):
mkdocs serve• Docs (build):mkdocs build. - Book (optional):
bash build_book.sh(requirespandoc; optionaltectonic+@mermaid-js/mermaid-cli).
- Front matter: include
title,description, optionalauthors,date,tags(seedocs/workshops/chapter0.md). - Naming:
chapter4-2.mdpattern for multi-part chapters; keep headings starting with a single#. - Admonitions: use MkDocs blocks like
!!! infoand!!! success; keep copy concise and actionable. - Diagrams: use fenced
mermaidblocks; book build renders via Mermaid CLI when available. - Linking: link chapters relatively as in
docs/workshops/index.md; avoid hard-coded site URLs. - Section order: place
### Key Insightbefore## Learning Objectives. To fix inconsistencies, runpython scripts/normalize_workshops.py.
- Python 3.11 required (
requires-python >=3.11,<3.12). Use type hints throughout. - Indentation: 4 spaces; max line length per Ruff formatter.
- Naming:
snake_casefunctions/modules,PascalCaseclasses,UPPER_SNAKE_CASEconstants. - Imports: standard → third‑party → local; prefer explicit exports.
- Notebooks: keep outputs minimal; prefer moving reusable logic into importable modules under
latest/case_study/.
- Framework:
pytestwithpytest-asynciofor async code. - Location: create
tests/at repo root; name filestest_*.py. - Conventions: one behavior per test; use fixtures for external services; mock APIs.
- Examples:
uv run pytest -q, with coverageuv run pytest --cov latest/case_study.
- Commits: imperative, present tense, concise (e.g.,
fix: handle empty queries). - PRs: include problem statement, summary of changes, and before/after screenshots for docs/UI.
- Link issues when applicable; note follow‑ups and known limitations.
- Checklist before opening PR: run Ruff (check + format), run tests, verify
mkdocs buildpasses.
- Do not commit secrets. Store API keys in
.envand load viapython-dotenv. - Common vars:
OPENAI_API_KEY,ANTHROPIC_API_KEY,COHERE_API_KEY,LOGFIRE_*. - Prefer configuration via environment variables over hard‑coding.