Skip to content

v0.0.1

Choose a tag to compare

@synacktraa synacktraa released this 29 Jul 16:56
· 35 commits to master since this release

Excited to announce the initial release of tool-parse, a Python library designed to simplify LLM tool-calling!

πŸš€ What's New

  • Replaces hypertion package which only supported regular functions
  • Supports function registration (both synchronous and asynchronous)
  • Compatible with pydantic.BaseModel, typing.TypedDict, and typing.NamedTuple
  • Multiple ways to register tools: decorators, direct passing, and key-value pairs
  • Schema generation in 'base' and 'claude' formats
  • Tool invocation from call expressions or metadata
  • Registry combination functionality

πŸ”§ Installation

pip install tool-parse

🌟 Key Features

  • Easy tool registration with optional docstring support
  • Flexible schema generation for different LLM providers
  • Simple tool invocation
  • Support for various parameter types
  • Registry combination for organizing tools

πŸ“š Quick Start

from tool_parse import ToolRegistry

tr = ToolRegistry()

@tr.register
def search_function(query: str, max_results: int = 10):
    """
    Search the web for given query
    :param query: The search query string
    :param max_results: Maximum number of results to return
    """
    ...

# Generate schema
tools = tr.marshal('base')

# Invoke tool
result = tr.compile('search_function("Python programming", max_results=5)')

For more detailed usage examples and documentation, please refer to our README.

🀝 Contributing

contributions, issues, and feature requests are welcome! Feel free to check our issues page.


Thank you for your interest in tool-parse. Looking forward to seeing how you'll use it in your projects!