ToolFront helps you retrieve information from large databases, APIs, and documents with AI.
Project description
Documentation: docs.toolfront.ai
Installation
Install with pip
or your favorite PyPI package manager.
pip install toolfront
Example 1: Text2SQL with ChatGPT
from toolfront import Database
db = Database("postgres://user:pass@localhost:5432/mydb", model="openai:gpt-4o")
context = "We're an e-commerce company. Sales data is in the `cust_orders` table."
# Returns a string
answer = db.ask("What's our best-selling product?", context=context)
# >>> "Wireless Headphones Pro"
Note: For databases, install with PyPI extras, e.g.:
pip install "toolfront[postgres]"
. See the documentation for the complete list of 10+ databases.
Example 2: API retrieval with Claude
from toolfront import API
api = API("http://localhost:8000/openapi.json", model="anthropic:claude-3-5-sonnet")
# Returns a list of integers
answer: list[int] = api.ask("Get the last 5 order IDs for user_id=42")
# >>> [1001, 998, 987, 976, 965]
Note: ToolFront supports any API with an OpenAPI (formerly Swagger) specification. Most common APIs like Slack, Discord, and GitHub have OpenAPI specs. See the documentation for more details.
Example 3: Document information extraction with Gemini
from toolfront import Document
from pydantic import BaseModel, Field
class CompanyReport(BaseModel):
company_name: str = Field(..., description="Name of the company")
revenue: int | float = Field(..., description="Annual revenue in USD")
is_profitable: bool = Field(..., description="Whether the company is profitable")
doc = Document("/path/annual_report.pdf", model="google:gemini-pro")
# Returns a structured Pydantic object
answer: CompanyReport = doc.ask("Extract the key company information from this report")
# >>> CompanyReport(company_name="TechCorp Inc.", revenue=2500000, is_profitable=True)
Note: ToolFront supports OpenAI, Anthropic, Google, xAI, and 14+ AI model providers. See the documentation for the complete list.
Example 4: Snowflake MCP Server
{
"mcpServers": {
"toolfront": {
"command": "uvx",
"args": [
"toolfront[snowflake]",
"snowflake://user:pass@account/warehouse/database"
]
}
}
}
Community & Contributing
- Discord: Join our community server for real-time help and discussions
- X: Follow us @toolfront for updates and news
- Issues: Report bugs or request features on GitHub Issues
License
This project is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file toolfront-0.2.10.tar.gz
.
File metadata
- Download URL: toolfront-0.2.10.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.21
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5f46d7c566280e894c3e7c724f4e0ee63a9b75f9f254971a0cf34b3344d5c831
|
|
MD5 |
988c0bf3f15f3cef4cdc0124b1aa2aea
|
|
BLAKE2b-256 |
95eff933050da39002da8adadf18eef832f35b69e2d680e4f021c1c4e4bfda3f
|
File details
Details for the file toolfront-0.2.10-py3-none-any.whl
.
File metadata
- Download URL: toolfront-0.2.10-py3-none-any.whl
- Upload date:
- Size: 24.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.21
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
53fdeb7d58ce983c3fc0ed2c5fe8c54ea7a37280e0f78c001e8e822fa0194303
|
|
MD5 |
a21dc59c889c604153893f0f59fc2d70
|
|
BLAKE2b-256 |
5e3f63705b5ad0e7c01ec87b2d0739c9af48b9c9f94b0990247c7701d71fcfaa
|