Repository navigation
refactor(helpers): move has_user_content() to a backend-neutral module - #1758
Merged
AngeloDanducci merged 2 commits intoOct 23, 2026
Merged
AngeloDanducci merged 2 commits into
AngeloDanducci merged 2 commits into
Conversation
The HuggingFace path is now a non-OpenAI-compatible caller of has_user_content(), so a backend-neutral helpers module is a better home than openai_compatible_helpers.py. Behavior-neutral: all callers import via the mellea.helpers package. Also make the docstring timeless (drop issue-number narration, keep the behavioral spec) and add the name to the package __all__, since it now has four internal callers. Closes generative-computing#1756 Assisted-by: Claude Code Signed-off-by: Mark Sturdevant <[email protected]>
This code is already tested indirectly, but adding unit tests to enforce the contract of the method. Also this brings symmetry and goodness of at least having a test file to pair with the source file. Signed-off-by: Mark Sturdevant <[email protected]> Assisted-by: Claude Code
Merged
via the queue into
generative-computing:main
with commit Oct 23, 2026
1326efb
12 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.
Pull Request
Issue
Closes #1756
Description
has_user_content()was added in #1632 to guard the OpenAI, LiteLLM, and Ollama backends against empty user content, and lives inmellea/helpers/openai_compatible_helpers.py. The #1705 fix (PR #1757) makes the HuggingFace path the first non-OpenAI-compatible caller, so a backend-neutral helpers module is a better home.has_user_content()to the newmellea/helpers/chat_helpers.pymellea/helpers/__init__.py(the name moved between import blocks)has_user_contentto the package__all__— it now has four internal callersBehavior-neutral: all callers import via the
mellea.helperspackage, so no backend changes are needed and open PR #1757 is unaffected by the move.Testing
No new tests: the change is a behavior-neutral move. Verified locally:
ruff format/ruff checkandmypyclean onmellea/helpers/;pytest test/helpers/ test/backends/test_provider_fields.py(158 passed); docstring quality gate (audit_coverage.py --quality --fail-on-quality --threshold 100) passes.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.
🤖 Generated with Claude Code