chore(examples): scrub, standardize, reframe 04#50
Merged
Conversation
Examples scrub-and-reframe phase, first wave. - Delete examples/01-linear-pipeline/ (covered by 00-hello-world). - Renumber 02-05 down by one to fill the gap. - Standardize 01-03 (LLM-using) on openarmature.llm.OpenAIProvider + SystemMessage + UserMessage, lifting hardcoded vLLM endpoints to LLM_BASE_URL / LLM_MODEL / LLM_API_KEY env vars (same shape as 00-hello-world). - Reframe 03-observer-hooks to register OTelObserver alongside the plain console_tracer, showing observability backends as pluggable behind one uniform hook. - Reframe 04-nested-subgraphs around a real use case (question answering against a tiny baked-in document corpus: outer coordinator, doc-QA subgraph, section-extract subgraph). LLM-using throughout; the depth-aware observer is a side observation rather than the headline. - Strip spec/proposal references from comments and docstrings across examples/ and examples/README.md. Internal src/ scope is unchanged. - Update tests/test_examples_smoke.py parametrize list to the five surviving demos.
There was a problem hiding this comment.
Pull request overview
This PR performs the first “examples scrub” pass: removing redundant demos, renumbering the remaining set, standardizing examples on openarmature.llm.OpenAIProvider, and reframing demos as use-case recipes (including adding an OpenTelemetry observer demo).
Changes:
- Delete
01-linear-pipeline/and renumber the remaining demos (02–05 → 01–04), updating the smoke test list accordingly. - Standardize examples on
OpenAIProvider+SystemMessage/UserMessageand shared env var configuration (LLM_BASE_URL,LLM_MODEL,LLM_API_KEY). - Rework
03-observer-hooksto demonstrate pluggable observability backends viaOTelObserver, and reframe nested subgraphs as a doc-QA use case.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_examples_smoke.py | Updates the demo list to the renamed/renumbered examples. |
| examples/README.md | Renumbers demos, adds unified configuration section, updates run instructions and OTel note. |
| examples/01-routing-and-subgraphs/main.py | Migrates to OpenAIProvider, updates docs/config, adds cleanup (drain() / provider close). |
| examples/02-explicit-subgraph-mapping/main.py | Migrates to OpenAIProvider, updates docs/config, adds cleanup (drain() / provider close). |
| examples/03-observer-hooks/main.py | Migrates to OpenAIProvider, adds OTelObserver example, updates docs/config, adds provider cleanup. |
| examples/04-nested-subgraphs/main.py | New doc-QA nested subgraphs demo using OpenAIProvider and a depth-aware observer. |
| examples/01-linear-pipeline/main.py | Deleted (superseded by 00-hello-world). |
| examples/05-nested-subgraphs/main.py | Deleted (replaced by reframed 04-nested-subgraphs). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR-review cleanups for #50: - Top-level docstring no longer says the outer "takes the user's question and the corpus". The corpus is module-level CORPUS, not threaded through state; rewording matches the implementation and the DocQAState docstring that already calls it out. - pick_doc() relaxes its title match to case-insensitive containment in either direction and raises on no match instead of silently falling back to CORPUS[0]. The previous fallback could yield confidently wrong answers (espresso question routed to Apollo 11) on minor paraphrasing. The error message points readers at response_schema (00-hello-world) as the production-grade fix.
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.
Summary
First wave of the Examples Review phase. Cleans the existing example set so all surviving demos use the recommended provider API and read as use-case driven recipes rather than tech demos. Sets the stage for the new examples (fan-out, parallel-branches, multimodal-prompt, checkpointing-and-migration) that follow in subsequent PRs.
What's in the wave
Test plan
What's next in the phase
This PR is the scrub. Subsequent PRs add the new examples one at a time:
After 08 merges, every major v0.6.0 surface has a home in `examples/`.