tool-parse

Making LLM Tool-Calling Simpler.

MIT License

Downloads
953
Stars
23
Committers
2

Bot releases are hidden (Show)

tool-parse - 0.2.2 Latest Release

Published by synacktraa about 1 month ago

What's fixed?

  • compile method fixed for both tool and ToolRegistry
  • Updated marshal_annotation and compile_value to support set type parameter
  • Added more tests
tool-parse - 0.2.1

Published by synacktraa about 1 month ago

What's new?

  • Minimum python version updated to 3.10 (I'm still new at this CI/CD stuff + testing on python 3.8 & 3.9 is difficult for now as it would need rewrite/major update to support them. Sorry for messing up.)
  • Added CI/CD pipeline, ruff formatting, linting and code coverage
  • Resolved minor bugs

Full Changelog: https://github.com/synacktraa/tool-parse/compare/v0.2.0...0.2.1

tool-parse - v0.2.0

Published by synacktraa about 2 months ago

What's New?

  • Added support for optional parameters: typing.Optional[<type>]/t.Union[<type>, None]/<type> | None
  • Added support for compiling call expression in Independent tools
  • Resolve minor bugs

PyPI URL: https://pypi.org/project/tool-parse/0.2.0/

tool-parse - v0.0.1

Published by synacktraa 3 months ago

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!