Repository navigation
docs(examples): standardize plugin, MCP, library_interop, requirements examples - #1766
Conversation
Assisted-by: IBM Bob Signed-off-by: Rafael Vasquez <[email protected]>
|
The "Other fixes" should be incorporated. Most of the "rewrite" is replacing reasonable human-written text with LLM rewording. There are many cases where this obfuscates rather than clarifies (e.g., dropping the word "example" from examples) or "reads in" design intent that didn't exist in the minds of the original designers. I think when in doubt we should strongly favor the descriptions provided by authors over stylistic uniformity, except perhaps in cases where semantic equivalence is preserved. |
|
Following on from above :
If we could keep these alongside something based on the original wording it would probably be a good combination - ie using the edits to add some consistency/structure but also the more natural variance of originally authored content (I think if we were filling in gaps and didn’t have content in the first place this stuff would be super?) |
Signed-off-by: Rafael Vasquez <[email protected]>
Signed-off-by: Rafael Vasquez <[email protected]>
Signed-off-by: Rafael Vasquez <[email protected]>
Signed-off-by: Rafael Vasquez <[email protected]>
Signed-off-by: Rafael Vasquez <[email protected]>
Signed-off-by: Rafael Vasquez <[email protected]>
Signed-off-by: Rafael Vasquez <[email protected]>
Signed-off-by: Rafael Vasquez <[email protected]>
…in docs Signed-off-by: Rafael Vasquez <[email protected]>
|
Thanks both @nrfulton @planetf1, I appreciate the feedback. I've revisited all of the changes (and updated the PR description to reflect the current state). I mostly focused on dropping superfluous rewording and adding structure. Will do this with the rest of the example standardizing going forward. |
| uv run python docs/examples/requirements/code_generation_and_execution_bash.py | ||
|
|
||
| # Use a custom workspace directory | ||
| uv run python docs/examples/requirements/code_generation_and_execution_bash.py \ |
There was a problem hiding this comment.
One small thing in this docstring: the Usage block uses \ line continuations, but the docstring isn't raw, so Python consumes each \<newline> at compile time. Read through help() or an IDE hover, both commands collapse onto one line:
uv run python docs/examples/requirements/code_generation_and_execution_bash.py --workspace /path/to/workspace
The sibling code_generation_and_execution.py handles the same situation with r""", so the one-character fix here would match it.
Entirely optional in this PR: I've filed #1780 to track this pattern across the repo (it also appears in four pre-existing files, and ruff doesn't flag it because the escape is technically valid). Fix it here if convenient, otherwise the tracking issue covers it.
planetf1
left a comment
There was a problem hiding this comment.
Approving. Docs-only diff, and I verified that rather than assuming it: an AST comparison of base against head shows exactly one executable change in the examples, the mellea[smolagents] → mellea[tools] install hint, which is correct since smolagents ships in the tools extra and no smolagents extra exists.
Everything else I checked holds up:
- Prerequisites match reality:
granite4.2:3bis thestart_session()default,mcp_example.pyreally usessmollm2:1.7b,github_activity_summary.pypinsgranite4.1:8b. I ransmolagents_example.py,langchain_messages.pyandtesting_plugins.pyagainst local Ollama with the documented extras; all pass. - The new Execution tiers and Capability policy sections in
tools-and-agents.mdmatch the source exactly (ENFORCED_* attributes, the implicit-tierUserWarning,PythonExecutionReqdefaulting to"static"). - All relative links and anchors in the rewritten READMEs resolve,
# pytest:markers are untouched, and markdownlint is clean under the project config. - The README content cut here is covered elsewhere: tier guidance moved into the how-to, the plotting requirement classes are in the auto-generated API reference, and the per-example details survive in docstrings and the example code itself.
The one inline comment (non-raw docstring in code_generation_and_execution_bash.py) is optional to fix here; #1780 tracks the same pattern across five files, four of which pre-date this PR.
0dc42e8
Pull Request
Issue
Towards #1746
Description
Docstrings
code_generation_and_execution.py: removed the tier list and "when to use each tier" bullets, and moved the information into the how-to docs, and linked to it.READMEs
## Examplestable. Rows use the original file descriptions where they were still accurate.docs/docs/or within the examples themselves.Docs pages
how-to/tools-and-agents.md: new Execution tiers section that consolidates the tier guidance previously spread across the requirements README and example docstrings.Other fixes
mellea[smolagents]tomellea[tools], insmolagents_example.pyandintegrations/smolagents.md.granite4.2:3b, thestart_session()default, replacing the old README'sgranite4.1:3b.github_activity_summary.pylistsgranite4.1:8b, which it pins.mcp_example.py: removed a comment pointing at the wrong path (docs/examples/tutorial/mcp_example.py).library_interop/README.md: fixed a stalemellea/stdlib/context.pypath (nowmellea/stdlib/context/).Testing
Attribution
Adding a new component, requirement, sampling strategy, or tool?
If your PR adds or modifies one of the types below, check the matching box. A checklist of type-specific review items will be posted as a comment.
NOTE: Please ensure you have an issue that has been acknowledged by a core contributor and routed you to open a pull request against this repository. Otherwise, please open an issue before continuing with this pull request.