Skip to content

docs: replace deprecated code_interpreter/local_code_interpreter with python_tool() #1298

Description

@AngeloDanducci

code_interpreter() and local_code_interpreter() were deprecated in favour of python_tool(). Several examples and docs pages still reference the old functions, producing DeprecationWarning at runtime.

Deprecation mapping

Old New
code_interpreter(code) python_tool(tier='docker_unsafe').run(code=code)
local_code_interpreter(code) python_tool(tier='local_unsafe').run(code=code)
MelleaTool.from_callable(local_code_inter…) python_tool(tier='local_unsafe')
uses_tool(local_code_interpreter) uses_tool(python_tool(tier='local_unsafe'))
result.tool_calls["local_code_interpreter"] result.tool_calls["python_tool"]

Note: python_tool() returns a MelleaTool directly, so MelleaTool.from_callable() wrapping is no longer needed.

Files to update

  • docs/examples/tools/interpreter_example.py — lines 7, 12, 23, 35, 37, 45, 49, 62, 65, 74, 82, 86
  • docs/examples/tools/README.md — lines 11, 53, 56, 65, 70, 78, 82–83, 88, 92, 99, 104, 107, 112, 120–121, 161
  • docs/docs/how-to/tools-and-agents.md — lines 114, 119–120, 129–130, 146, 152, 155, 162, 264, 266, 270, 274

Additional context

  • Deprecation warning observed while running the README snippet smoke tests in Bug: Tool examples broken after PR #380 - need MelleaTool wrapper #383
  • python_tool() requires an explicit tier argument; omitting it raises a warning. Use tier='local_unsafe' for local execution (replaces local_code_interpreter) and tier='docker_unsafe' for sandboxed execution (replaces code_interpreter)
  • The tool name exposed to the LLM changes from "local_code_interpreter" / "code_interpreter" to "python_tool" — .tool_calls key lookups in examples need updating accordingly

Metadata

Metadata

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions