v0.0.1
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, andtyping.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!