Skip to main content

A library for managing tool registries

Project description

ToolRegistry

A Python library for managing and executing tools in a structured way.

Features

  • Tool registration and management
  • JSON Schema generation for tool parameters
  • Tool execution and result handling
  • Support for both synchronous and asynchronous tools

Installation

pip install toolregistry

Usage

Examples

OpenAI Implementation

The openai_tool_usage_example.py shows how to integrate ToolRegistry with OpenAI's API.

Cicada Implementation

The cicada_tool_usage_example.py demonstrates how to use ToolRegistry with the Cicada MultiModalModel.

OpenAI Integration

The ToolRegistry integrates seamlessly with OpenAI's API. Here are some common usage patterns:

Getting Tools JSON for OpenAI

tools_json = registry.get_tools_json()
# Use this with OpenAI's API to provide available tools

Executing Tool Calls

# Assuming tool_calls is received from OpenAI's API
tool_responses = registry.execute_tool_calls(tool_calls)

Recovering Assistant Messages

# After executing tool calls
messages = registry.recover_tool_call_assistant_message(tool_calls, tool_responses)
# Use these messages to continue the conversation

Manual Tool Execution

# Get a callable function
add_fn = registry.get_callable("add")
result = add_fn(a=1, b=2)  # Output: 3

Documentation

Full documentation is available at https://github.com/Oaklight/ToolRegistry

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toolregistry-0.2.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toolregistry-0.2.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file toolregistry-0.2.0.tar.gz.

File metadata

  • Download URL: toolregistry-0.2.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for toolregistry-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c5ab09d63b660e49dedaf9dca363556acc6fd3d29dcbe1ba1febe7f28c598cf6
MD5 3b3e708806c20749081a0193138a1c2d
BLAKE2b-256 6043c8f6fbffb66f467687598fcd646b3cd830a30796e57a2bfb047c5f112628

See more details on using hashes here.

File details

Details for the file toolregistry-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: toolregistry-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for toolregistry-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15a711bc754391d7b4948f8766b66b3c04985582786d8790cea933ac6ec5939b
MD5 62d676c64c21990556868c9d9ef70ca2
BLAKE2b-256 0a1244f9cfab5a1497d159ce13de7a58c410539fc229178b8828276fe35d8f02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page