docs: clarify MelleaSession vs functional.act() layering; add start_session() pin example#1283
Merged
Merged
Conversation
…ession() pin example
- Update functional.py module docstring to label it as low-level
primitives and direct general users to MelleaSession / start_session()
- Add explicit start_session("ollama", IBM_GRANITE_4_1_3B) example to
quickstart immediately after the no-args form, showing the import path
and pinning pattern
Closes generative-computing#1276
Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
The "Three lines: …" sentence described the original 3-line example; after inserting the pinned snippet above it, the sentence incorrectly appeared to describe the new 5-line block. Reorder so the "Three lines:" paragraph and the Full example link come first, then the explicit/pinned form follows. Assisted-by: Claude Code Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
- Align new quickstart snippet to page's existing import style (import mellea / mellea.start_session) rather than the from-import form - Add sentence after the pinned example noting the with block closes the session automatically - Simplify Sphinx :class:/:func: cross-refs in functional.py module docstring to plain backticks (site is Docusaurus, not Sphinx) Assisted-by: Claude Code Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
- Replace "reproducible behaviour across environments" with "ensuring the same model runs across all environments" — model pinning does not make LLM output deterministic - Use mellea.model_ids.IBM_GRANITE_4_1_3B (public re-export) instead of the deep mellea.backends.model_ids path; removes the second import line - Replace "avoid resource leaks" with an accurate description: the with block flushes telemetry and deregisters scoped plugins (no HTTP sockets are involved) Assisted-by: Claude Code Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
cleanup() ends the OTel span but does not force-flush the exporter queue; "flushing telemetry" overstated what happens on context manager exit. Assisted-by: Claude Code Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
psschwei
approved these changes
Jun 17, 2026
Merged
via the queue into
generative-computing:main
with commit Jun 19, 2026
894a445
9 checks passed
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.
Doc-only. Two gaps that required source-diving to resolve.
functional.pymodule docstring — the old one-liner gave no guidance on when to reach forfunctional.act()vssession.act(). The new docstring calls it a low-level primitive and points toMelleaSession/start_session()for the common case.Quickstart pinning example —
start_session()with no args appears in several places but the explicitmellea.start_session("ollama", IBM_GRANITE_4_1_3B)form didn't appear anywhere users land first. Added one snippet to the quickstart showing the import path, the pinning pattern, and a note that thewithform closes the session automatically.Compatibility: no concerns.
MelleaSession.__enter__/__exit__are implemented (session.py:276, 305), so the context manager form in the snippet is already supported. The argument order (backend_namethenmodel_id) matches the signature.IBM_GRANITE_4_1_3Bis also the defaultmodel_id, so the pinned example produces the same result as the no-args call.Fixes #1276.