Table of Contents
|
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. |
- Install
pip install aitools-bridge- 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
"""
passif 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- 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\"}"
}
}]Make sure you have installed both Poetry and Ollama.
poetry -V
ollama list- Install dependencies
make sync- Run examples
make examplestool.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.
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 # linterThis project is licensed under the Apache License V2.0. See LICENSE for more information.
A special thanks to these outstanding open-source community.
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}
}If you have any questions, please contact us at more.aitools@gmail.com.