Skip to content

docs(examples): standardize plugin, MCP, library_interop, requirements examples - #1766

Merged
rafvasq merged 10 commits into
generative-computing:mainfrom
rafvasq:docs/tools-plugins-interop-standardize
Oct 30, 2026
Merged

rafvasq merged 10 commits into
generative-computing:mainfrom
rafvasq:docs/tools-plugins-interop-standardize

Conversation

@rafvasq

@rafvasq rafvasq commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Issue

Towards #1746

Description

Docstrings

  • Converted to module docstrings and added prerequisites/usage blocks. Most original text was left unchanged aside from some instances to include relevant info from the README. Added descriptions to scripts that had none.
  • 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

  • Each directory README is now a short description plus an ## Examples table. Rows use the original file descriptions where they were still accurate.
    • Checked to ensure any content removed from the READMEs covered in 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

  • smolagents install hint corrected from mellea[smolagents] to mellea[tools], in smolagents_example.py and integrations/smolagents.md.
  • Prerequisites use granite4.2:3b, the start_session() default, replacing the old README's granite4.1:3b. github_activity_summary.py lists granite4.1:8b, which it pins.
  • mcp_example.py: removed a comment pointing at the wrong path (docs/examples/tutorial/mcp_example.py).
  • MCP README: fixed an extensionless link to the Tools and Agents how-to.
  • library_interop/README.md: fixed a stale mellea/stdlib/context.py path (now mellea/stdlib/context/).

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code was added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

Attribution

  • AI coding assistants used

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.

  • Component
  • Requirement
  • Sampling Strategy
  • Tool

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.

Assisted-by: IBM Bob
Signed-off-by: Rafael Vasquez <[email protected]>
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 27, 2026
@rafvasq rafvasq changed the title docs: standardize example docstrings and READMEs docs(examples): standardize plugin, MCP, library_interop, requirements examples Oct 27, 2026
@rafvasq
rafvasq marked this pull request as ready for review October 27, 2026 19:11
@rafvasq
rafvasq requested a review from a team as a code owner October 27, 2026 19:11
@nrfulton

nrfulton commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

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.

@planetf1

Copy link
Copy Markdown
Contributor

Following on from above :

  • there’s also a mcp path fix which should be kept
  • there’s some consolidation in tools-and-agents.md that consolidates information about tiers - I think this is helpful to simplify
  • the prerequisites/usage add some helpful consistency

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]>
@rafvasq

rafvasq commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

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 \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 planetf1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:3b is the start_session() default, mcp_example.py really uses smollm2:1.7b, github_activity_summary.py pins granite4.1:8b. I ran smolagents_example.py, langchain_messages.py and testing_plugins.py against local Ollama with the documented extras; all pass.
  • The new Execution tiers and Capability policy sections in tools-and-agents.md match the source exactly (ENFORCED_* attributes, the implicit-tier UserWarning, PythonExecutionReq defaulting 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.

@rafvasq
rafvasq added this pull request to the merge queue Oct 30, 2026
Merged via the queue into generative-computing:main with commit 0dc42e8 Oct 30, 2026
14 checks passed
@rafvasq
rafvasq deleted the docs/tools-plugins-interop-standardize branch October 30, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants