Skip to content

feat: Remove mellea as a dependency#25

Open
erichare wants to merge 1 commit intoAgentToolkit:mainfrom
erichare:feat-remove-mellea-dep
Open

feat: Remove mellea as a dependency#25
erichare wants to merge 1 commit intoAgentToolkit:mainfrom
erichare:feat-remove-mellea-dep

Conversation

@erichare
Copy link
Copy Markdown

@erichare erichare commented Apr 7, 2026

This pull request removes the dependency on the mellea library 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 custom run_prompt function, and updating all affected modules and tests to use the new approach.

Dependency and Backend Removal:

  • Removed mellea from project dependencies in pyproject.toml and deleted all imports and usage of mellea and related backend shims, including the SimpleBackend class 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:

  • Introduced prompt_runner.py as a lightweight replacement for mellea's generative decorator, which builds prompts from function metadata and sends them to an I_TG_LLM backend (src/toolguard/buildtime/gen_py/prompt_runner.py).
  • Refactored all prompt-generating functions in prompts/gen_tests.py, prompts/improve_guard.py, and prompts/pseudo_code.py to use the new run_prompt utility instead of mellea's generative decorator. This includes updating their signatures to require an I_TG_LLM instance and moving template logic into private helper functions. [1] [2] [3] [4] [5] [6] [7]

Core Build and Dependency Logic Update:

  • Updated the tool guard and dependency generation logic to remove all references to MelleaSession and instead accept an I_TG_LLM backend, propagating this change through tool_guard_generator.py, tool_dependencies.py, and related call sites. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Test Updates:

  • Refactored tests to remove all usage of mellea and SimpleBackend, updating fixtures and test code to use the new prompt pipeline and I_TG_LLM directly. [1] [2] [3] [4]

Version Bump:

  • Bumped the project version to 0.2.14 in pyproject.toml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant