Skip to content

m0reA1/aitools-bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


license PRs welcome made with hearth by

Table of Contents

About

aitools-bridge is a minimalist framework (or a decorator) designed to seamlessly integrate existing tools with the advanced AI ecosystem. The goal is to make it easier for users to wrap AI-compatible functions. As an adaptive bridge, it brings current tools into the AI era while expanding the capabilities of AI.

preview

Getting Started

Usage

  1. Install
pip install aitools-bridge
  1. Find any function you want to integrate with AI and make a small change

if your function has a complete docstring, following Google, NumPy, or Sphinx style.

from bridge import ToolsBridge

@ToolsBridge.register()
def get_weather(location: str):
    """Get current temperature for a given location.

    Args:
        location: City and country e.g. Bogotá, Colombia
    """
    pass

if not, please use args: description & param_descriptions.

from bridge import ToolsBridge

@ToolsBridge.register(
  description="Get current temperature for a given location",
  param_descriptions={
    "location": "City and country e.g. Bogotá, Colombia"
  }
)
def get_weather(location: str):
    pass
  1. Export the tools to AI API and enjoy the experience!
completion = openai.OpenAI().chat.completions.create(
  ...
  tools=ToolsBridge.get_tools(),
)

print(completion.choices[0].message.tool_calls)

output

[{
    "id": "call_*",
    "type": "function",
    "function": {
        "name": "get_weather",
        "arguments": "{\"location\":\"Paris, France\"}"
    }
}]

Example

Prerequisites

Make sure you have installed both Poetry and Ollama.

poetry -V

ollama list
  1. Install dependencies
make sync
  1. Run examples
make examples

examples

tool.py is just an ordinary Python function. However, after adding ToolsBridge.register, this function evolves into an AI tool (ai_tool.py) that can be passed to an LLM for collaborative processing, allowing it to demonstrate its capabilities (or intelligence) in the right context. This transforms it from a pure code-level function call into an interactive conversation between humans and AI. Instead of merely returning a function output, the user receives meaningful answers.

Development

This project welcomes contributions and suggestions. Before making any changes, please follow the steps below

make sync

make tests  # tests
make format # formatter
make lint   # linter

License

This project is licensed under the Apache License V2.0. See LICENSE for more information.

Acknowledgements

​A special thanks to these outstanding open-source community.

Citation

If you use aitools-bridge in your project, please cite:

@software{aitools-bridge2025,
  author = {m0reA1},
  title = {aitools-bridge: a minimalist framework designed to seamlessly integrate existing tools with the advanced AI ecosystem},
  year = {2025},
  publisher = {GitHub},
  url = {https://github.com/m0reA1/aitools-bridge}
}

Contacts

If you have any questions, please contact us at more.aitools@gmail.com.

About

a minimalist framework designed to seamlessly integrate existing tools with the advanced AI ecosystem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published