toolsmith
Toolsmith turns your Python functions into structured, AI-callable tools, using type hints and docstrings. Integrates with any LLM provider that is compatible with the OpenAI API.
- Very easy to use: Just write normal Python functions with typehints.
- Pydantic support: Pydantic types get automatically serialized and deserialized.
- Unopinionated: Toolsmith gets out of the way in terms of how you want to wire up the LLM loop.
- Fast: Highly performant based on Pydantic's speed.
- Async support: Built-in support for async functions with parallel execution of multiple tool calls.
Installation
$ pip install toolsmith
Usage
Simply define any functions you may have normally:
def create_user(name: str, age: int) -> str:
"""Saves a user to the DB"""
return f"Created user {name}, age {age}"
def search_users(query: str, regex: bool) -> str:
return "Found some users"
Put it all together and call the OpenAI API:
import openai
from toolsmith import AsyncToolbox
toolbox = AsyncToolbox.create([create_user, search_users])
client = openai.AsyncOpenAI()
response = await client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Make a 33 year old user called Alice"}]
tools=toolbox.get_schema(), # toolsmith handles the schema
)
# toolsmith will automatically call your functions here
results = await toolbox.execute_tool_calls(response.choices[0].message.tool_calls)
Learn more
Metadata
Release files for toolsmith 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| toolsmith-0.2.1.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| toolsmith-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / toolsmith-0.2.1.tar.gz
| Download URL | toolsmith-0.2.1.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dff59ebea096c0d97dbff30125b674989beb72d0f2395bef01cdbc6acff3080c
|
|
BLAKE2b-256 checksum How to use checksums |
aeb6e9dd36335bbb21e33429877612bfec299876fdf9c4443bbfd26793911f3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.14.2 Darwin/24.6.0
|
Release files / toolsmith-0.2.1-py3-none-any.whl
| Download URL | toolsmith-0.2.1-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
494eb86c2bfe481c09108a3bf320d489af8a95f1857e550eea7c518efe4b01c5
|
|
BLAKE2b-256 checksum How to use checksums |
9e29fcd7788217df99669f14fd757b09c65711c9b53693d228a1cde3509cbc91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.14.2 Darwin/24.6.0
|