Skip to content

Bug: Tool examples broken after PR #380 - need MelleaTool wrapper #383

Description

@planetf1

Bug: Tool examples broken after PR #380 - need MelleaTool wrapper

Description

PR #380 introduced a breaking change requiring MelleaTool instances instead of raw callables for ModelOption.TOOLS. Several examples and documentation were not updated and now fail.

Failing Tests

  • docs/examples/tools/interpreter_example.py ✗ (test fails)

Affected Documentation (not tested but incorrect)

  • docs/examples/tools/README.md (lines 45, 56, 83, 103)
  • docs/tutorial.md (line 1359)

Error

AssertionError: If ModelOption.TOOLS is a list, it must be a list of Tool; found <class 'function'>

Root Cause

The tool system now requires wrapping callables with MelleaTool.from_callable():

Before (broken):

from mellea.stdlib.tools import local_code_interpreter

m.instruct(
    description="...",
    model_options={ModelOption.TOOLS: [local_code_interpreter]},
)

After (fixed):

from mellea.stdlib.tools import local_code_interpreter
from mellea.backends.tools import MelleaTool

m.instruct(
    description="...",
    model_options={ModelOption.TOOLS: [MelleaTool.from_callable(local_code_interpreter)]},
)

Files to Update

Examples (tested):

  • docs/examples/tools/interpreter_example.py (lines 21, 33, 63)

Documentation (not tested but needs update):

  • docs/examples/tools/README.md (lines 45, 56, 83, 103)
  • docs/tutorial.md (line 1359 - web_search function)

Note: All tests in test/backends/ already use MelleaTool.from_callable() correctly.

Additional Context

Metadata

Metadata

Labels

area/toolsTool framework, Bash/Python tools, tool call lifecyclebugSomething isn't workingp2Medium/low: minor bugs, niche features, polish, docs, tests, cleanup. Scoped, lower urgency.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions