Skip to content

docs: Fix tool calling examples README for Docusaurus compliance and API updates #1327

Closed

Description

@akihikokuroda

Summary

Updated docs/examples/tools/README.md to modernize code examples, fix API deprecations, and ensure Docusaurus compliance.

Changes

API Updates

  • Replaced deprecated code_interpreter() with python_tool(tier='docker_unsafe')
  • Updated all code snippets to use current Mellea tool calling API
  • Fixed incorrect MelleaTool.from_callable() usage for python_tool instances

Code Completeness

  • Added missing imports (start_session, ModelOption) to snippets that were incomplete
  • Enhanced all code examples with output printing and execution demonstrations
  • Fixed tool name references to use string identifiers (e.g., "python" instead of python_tool object)
  • Added tool_calls=True parameter where required for tool execution

Documentation

  • Added YAML frontmatter (title, description) for Docusaurus
  • Fixed cross-doc link path: docs/docs/tool_calling.md → docs/dev/tool_calling.md
  • Fixed tool requirement reference examples to match working patterns

Testing

All code snippets have been verified to run successfully:

  • ✅ Direct Tool Use - executes without errors
  • ✅ Tool with LLM - LLM generates and calls tools
  • ✅ Forcing Tool Use - demonstrates constraint enforcement with artifacts
  • ✅ Validating Tool Arguments - shows argument validation in action
  • ✅ Custom Tools - demonstrates custom tool creation and execution

Files Changed

  • docs/examples/tools/README.md - Complete update

Related Files (verified but not changed)

  • docs/examples/tools/interpreter_example.py - Still uses deprecated API (separate issue)
  • docs/examples/tools/smolagents_example.py - ✓ Current
  • docs/examples/tools/python_tool_example.py - ✓ Current
  • docs/examples/tools/tool_decorator_example.py - ✓ Current

This issue describes the scope of work, highlights the key improvements, and notes what was tested.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions