tool-ahead-of-time

tool-ahead-of-time

This is a Python package to add tool calling capabilities to newly released LLMs on LangChain's ChatOpenAI library ahead of time before LangChain and LangGraph supports it!

Stars: 55

Visit
 screenshot

Tool-Ahead-of-Time (TAoT) is a Python package that enables tool calling for any model available through Langchain's ChatOpenAI library, even before official support is provided. It reformats model output into a JSON parser for tool calling. The package supports OpenAI and non-OpenAI models, following LangChain's syntax for tool calling. Users can start using the tool without waiting for official support, providing a more robust solution for tool calling.

README:

Tool-Ahead-of-Time (TAoT): Because Why Wait? πŸ•’

Ever found yourself staring at a shiny new LLM through LangChain's window, but can't use tool calling because it's "not supported yet"?

Sad agent noises 😒

Well, hold my JSON parser, because this repo says "NOT TODAY!" 🦾

What is this sorcery? πŸ§™β€β™‚οΈ

This is a Python package that enables tool calling for any model available through Langchain's ChatOpenAI library (and by extension, any model available through OpenAI's library), even before LangChain and LangGraph officially supports it!

Yes, you read that right. We're living in the age of AI and things move fast πŸŽοΈπŸ’¨

It essentially works by reformatting the output response of the model into a JSON parser and passing this on to the relevant tools.

This repo showcases an example with DeepSeek-R1 671B (hosted on the OpenRouter platform), which isn't currently supported with tool calling by LangChain and LangGraph (as of 16th Feb 2025).

Features 🌟

  • Tool calling support for OpenAI and non-OpenAI models available on Langchain's ChatOpenAI library (and by extension, OpenAI and non-OpenAI models available on the base OpenAI's library).
  • This package follows a similar method to LangChain's and LangGraph's create_react_agent method for tool calling, so makes it easy for you to read the syntax. 😊
  • Zero waiting for official support required.
  • More robust than a caffeinated developer at 3 AM. β˜•

Quick Start πŸš€

Follow the notebook tutorial in the "taot_tutorial.ipynb" file (under the "tutorial" folder) in this repo for a fast and practical guide.

Change Log πŸ“–

20th Feb 2025:

  • Package now available on PyPI! Just "pip install taot" and you're ready to go.
  • Completely redesigned to follow LangChain's and LangGraph's intuitive create_react_agent tool calling methods.
  • Produces natural language responses when tool calling is performed.

1st Mar 2025:

Contributions 🀝

Feel free to contribute! Whether it's adding features, fixing bugs, adding comments in the code or any suggestions to improve this repo, all are welcomed πŸ˜„

Disclaimer ⚠️

This package is like that friend who shows up to the party early - technically not invited yet, but hopes to bring such good vibes that everyone's glad they came.

License πŸ“œ

MIT License - Because sharing is caring, and we care about you having tool calling RIGHT NOW.


Made with ❀️ and a healthy dose of impatience.

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for tool-ahead-of-time

Similar Open Source Tools

For similar tasks

For similar jobs