feat: Remove mellea as a dependency#25
Open
erichare wants to merge 1 commit intoAgentToolkit:mainfrom
Open
Conversation
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.
This pull request removes the dependency on the
mellealibrary throughout the codebase and replaces its usage with a new lightweight prompt-building utility. The changes simplify the code by eliminating custom backend shims, refactoring prompt generation to use a customrun_promptfunction, and updating all affected modules and tests to use the new approach.Dependency and Backend Removal:
melleafrom project dependencies inpyproject.tomland deleted all imports and usage ofmelleaand related backend shims, including theSimpleBackendclass and associated code (pyproject.toml,src/toolguard/buildtime/gen_py/gen_toolguards.py,src/toolguard/buildtime/gen_py/mellea_simple.py,tests/buildtime/gen_py/dependencies/test_appointment_dependencies.py,tests/buildtime/gen_py/dependencies/test_tau2_dependencies.py). [1] [2] [3] [4] [5]Prompt Generation Refactor:
prompt_runner.pyas a lightweight replacement for mellea's generative decorator, which builds prompts from function metadata and sends them to anI_TG_LLMbackend (src/toolguard/buildtime/gen_py/prompt_runner.py).prompts/gen_tests.py,prompts/improve_guard.py, andprompts/pseudo_code.pyto use the newrun_promptutility instead of mellea's generative decorator. This includes updating their signatures to require anI_TG_LLMinstance and moving template logic into private helper functions. [1] [2] [3] [4] [5] [6] [7]Core Build and Dependency Logic Update:
MelleaSessionand instead accept anI_TG_LLMbackend, propagating this change throughtool_guard_generator.py,tool_dependencies.py, and related call sites. [1] [2] [3] [4] [5] [6] [7] [8] [9]Test Updates:
melleaandSimpleBackend, updating fixtures and test code to use the new prompt pipeline andI_TG_LLMdirectly. [1] [2] [3] [4]Version Bump:
0.2.14inpyproject.toml.