RagLeap
PyPI package

ragleap-tools

version — loading live from PyPI…

Standalone, dependency-light tool implementations exposing OpenAI/Gemini-style function-calling schemas — no execution loop, wire into your own agent code.

pypi license
pip install ragleap-tools

Highlights

  • 12 stateless tools: calculator, datetime, unit conversion, JSON/CSV, text utilities
  • Since 0.5.0: @tool turns a type-annotated function into a tool, Toolkit collects tools and builds OpenAI, Gemini and Anthropic schemas, and default_toolkit() returns the 12 stateless tools. Arguments are validated before a function runs, and Toolkit.call returns every failure as a failed result instead of raising.
  • Sandboxed file ops — path traversal and symlink escapes rejected, verified by real tests
  • search_documents tool wraps ragleap-rag's retrieve()

Tech stack

Core dependencies: (zero required dependencies)

Optional extras:

  • ingest (adds search_documents via ragleap-rag)

Testing

256 test functions across 19 test files, verified directly from the repo.

Quickstart

from ragleap_tools import STATELESS_TOOLS, CALCULATOR_TOOL

openai_tools = [t.to_openai_schema() for t in STATELESS_TOOLS]
gemini_tools = [t.to_gemini_schema() for t in STATELESS_TOOLS]

result = CALCULATOR_TOOL.call(expression="2 + 2 * sqrt(16)")
print(result.success, result.result)  # True 10.0
Full documentation PyPI page Source