Skip to content

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

Closed

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

Activity

  1. planetf1 commented on Jan 30, 2026

    @planetf1
    ContributorAuthor

    @HendrikStrobelt I noticed this when rebasing #372 - some examples/docs to update? happy to fix up if it helps.

  2. added
    bug
    on May 12, 2026
  3. added
    area/tools
    on May 20, 2026
  4. added
    p2
    on Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area/toolsbugp2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions