The goal of this project is to create a set of standard AI functions / tools which are optimized for both normal TS-usage as well as LLM-based apps an

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-06-08 19:00:06

The goal of this project is to create a set of standard AI functions / tools which are optimized for both normal TS-usage as well as LLM-based apps and that work with all of the major AI SDKs (LangChain, LlamaIndex, Vercel AI SDK, OpenAI SDK, etc).

Or you can use these clients as LLM-based tools where the LLM decides when and how to invoke the underlying functions for you.

You can use our standard library of thoroughly tested AI functions with your favorite AI SDK – without having to write any glue code!

Here's a slightly more complex example which uses multiple clients and selects a subset of their functions using the AIFunctionSet.pick method:

Here we've exposed 2 functions to the LLM, search_news_stories (which comes from the PerigonClient.searchStories method) and serper_google_search (which implicitly comes from the SerperClient.search method).

You can pass as many of these AIFunctionLike objects as you'd like and you can manipulate them as AIFunctionSet sets via .pick, .omit, .get, .map, etc.

Leave a Comment