Top AI Repos โ open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
๐ openai function calling tools for JS/TS
| Date | Stars |
|---|---|
| 2026-07-31 | 310 |
| 2026-08-02 | 310 |
| 2026-08-06 | 310 |
Today
โ stars today
This week
โ stars this week
This month
โ stars this month
Momentum
0.0
growth rate 0.00%/day
<img height="129" align="left" src="assets/logo.png" alt="Logo">
# OpenAI Function calling tools
<a href="https://www.npmjs.com/package/openai-function-calling-tools"><img src="https://img.shields.io/npm/v/openai-function-calling-tools" alt="Current version"></a>
[](https://github.com/JohannLai/openai-function-calling-tools/blob/main/LICENSE)
[](https://codecov.io/github/JohannLai/openai-function-calling-tools)
<img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg" alt="semantic-release">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome">
---
OpenAI Function calling tools
OpenAI Function calling tools is a repository that offers a set of tools to help you easy to build a function calling model with OpenAI API.
[More information about function calling](https://platform.openai.com/docs/guides/gpt/function-calling)
Sample: https://chatFn.io
<img width="1387" alt="image" src="https://github.com/JohannLai/openai-function-calling-tools/assets/10769405/cc0f8565-d556-4325-afb6-bfefe912cc87">
## ๐ช Tools
The repo provides the following tools you can use out of the box:
- ๐บ๏ธ ShowPoisOnMap: A tool that can show points of interest on a map.
- ๐ ReverseGeocode: A tool that can convert coordinates into a human-readable address.
- โฐ Clock: A clock that can tell you the time.
- ๐งฎ Calculator: A simple calculator that can do basic arithmetic. Input should be a math expression.
- ๐ GoogleCustomSearch: A wrapper around the Google Custom Search API. Useful for when you need to answer questions about current events. Input should be a search query.
- ๐ BingCustomSearch: A wrapper around the Bing Custom Search API. Useful for when you need to answer questions about current events. Input should be a search query.
- ๐ SerperCustomSearch: A wrapper around the SerpAPI. Useful for when you need to answer questions about current events. Input should be a search query.
- ๐๏ธ SerperImagesSearch: Use SerpAPI to search images. Input should be a search query.
- ๐ fs: WriteFileTool abd ReadFileTool access to the file system. Input should be a file path and text written to the file.
- ๐ชฉ webbrowser: A web browser that can open a website. Input should be a URL.
- ๐ง sql: Input to this tool is a detailed and correct SQL query, output is a result from the database.
- ๐ง JavaScriptInterpreter: A JavaScript interpreter. Input should be a JavaScript program string.
> You can use `{ Tool }` factory function to create a tool instance. See `/tools` for more examples.
## ๐ฆ Quick Install
```bash
npm install openai-function-calling-tools
```
## ๐ Usage
### Example 1: Function Calls
use JavaScriptInterpreter to calculate 0.1 + 0.2
```js
import { Configuration, OpenAIApi } from "openai";
import { createCalculator } from "openai-function-calling-tools"
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const QUESTION = "What is 100*2?";
const messages = [
{
role: "user",
content: QUESTION,
},
];
# โจ STEP 1: new the tools you want to use
const [calculator, calculatorSchema] = createCalculator();
# โจ STEP 2: add the tools to the functions object
const functions = {
calculator,
};
const getCompletion = async (messages) => {
const response = await openai.createChatCompletion({
model: "gpt-3.5-turbo-0613",
messages,
# โจ STEP 3: add the tools to the schema
functions: [calculatorSchema],
temperature: 0,
});
return response;
};
console.log("Question: " + QUESTION);
let response = await getCompletion(messages);
if (response.data.choices[0].finish_reason === "function_call") {
const fnName = response.data.choices[0].message.function_calExcerpt of 10,382 characters
Read on GitHubWould you bet a product on this? Bounded 0โ100 and slow moving.
matched fp:7170de5522449b81, topic:function-calling
matched fp:7170de5522449b81, name:function calling, desc:function calling