├── .env.example ├── .gitignore ├── FunctionChain ├── .gitignore ├── README.md ├── entrypoint.js ├── index.js ├── openAIFunctions │ ├── codeInterpreter.js │ ├── finance │ │ ├── fetchCryptoPrice.js │ │ ├── getAlphaVantageCompanyOverview.js │ │ └── getAlphaVantageIntraday.js │ ├── huggingface │ │ └── huggingFaceImageClassification.js │ ├── pinecone │ │ ├── askPinecone.js │ │ ├── createPinecone.js │ │ └── updatePinecone.js │ ├── unix │ │ ├── openApp.js │ │ └── takeScreenshot.js │ ├── weather │ │ └── getVisualCrossingWeatherForecast.js │ └── wikipedia.js ├── package-lock.json └── package.json ├── README.md ├── examples ├── all-examples.js ├── alpha-vantage-examples.js ├── alpha-vantage-intraday.js ├── hugging-face-example.js ├── no-api-key-examples.js ├── nodejs-code-interpreter.js ├── pinecone-example.js ├── unix-example.js ├── weather-visual-crossing-example.js └── wikipedia-example.js ├── index.js ├── package-lock.json └── package.json /.env.example: -------------------------------------------------------------------------------- 1 | # --- OpenAI API --- 2 | # Required for all functions. 3 | # Obtain your API key at https://platform.openai.com/account/api-keys 4 | OPENAI_API_KEY= 5 | 6 | # --- Alpha Vantage API --- 7 | # Optional: Only required for specific functions. 8 | # Obtain your API key at https://www.alphavantage.co/support/#api-key 9 | # ALPHA_VANTAGE_API_KEY= 10 | 11 | # --- Pinecone API --- 12 | # Optional: Only required for specific functions. 13 | # Obtain your API key and other details at https://docs.pinecone.io/docs/node-client 14 | # PINECONE_API_KEY= 15 | # PINECONE_ENVIRONMENT= 16 | # PINECONE_INDEX= 17 | 18 | # --- Visual Crossing API --- 19 | # Optional: Only required for specific functions. 20 | # Obtain your API key at https://www.visualcrossing.com/weather-api 21 | # VISUAL_CROSSING_API_KEY= 22 | 23 | # --- Hugging Face API --- 24 | # Optional: Only required for specific functions. 25 | # Obtain your API key at https://huggingface.co/settings/tokens 26 | # HUGGING_FACE_API_KEY== -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | .DS_Store 4 | FunctionChain/.env 5 | package-lock.json 6 | offline-helpers -------------------------------------------------------------------------------- /FunctionChain/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | output 3 | .env 4 | package-lock.json -------------------------------------------------------------------------------- /FunctionChain/README.md: -------------------------------------------------------------------------------- 1 | 2 | [FunctionChain: OpenAI Function Calling Simplified in Node.js](https://youtu.be/jmrFG7n3Nt8) 3 | 4 | # Quickstart 5 | 6 | This guide will walk you through the basic steps required to get the `FunctionChain` library up and running. 7 | 8 | ## Installation 9 | 10 | 1. First of all, you need to clone the repository to your local machine: 11 | 12 | ```bash 13 | git clone https://github.com/developersdigest/FunctionChain 14 | ``` 15 | 16 | 2. Move to the directory where the repository has been cloned and install the necessary dependencies using npm: 17 | 18 | ```bash 19 | cd FunctionChain 20 | npm install 21 | ``` 22 | 23 | 3. Rename the `.env.example` to `.env` at the root of your project. Obtain your OpenAI API Key from [here](https://platform.openai.com/account/api-keys), and add it to the `.env` file: 24 | 25 | ```bash 26 | OPENAI_API_KEY=your_openai_api_key 27 | ``` 28 | 29 | 4. Now you can run with the example in `index.js` by using: 30 | 31 | ```bash 32 | node index.js 33 | or 34 | npm run dev 35 | ``` 36 | 37 | ## Setup 38 | 39 | To setup `FunctionChain`, follow the steps below: 40 | 41 | 1. Create an `index.js` file in the root of your project. 42 | 2. Import the `FunctionChain` class from `ai-function-chain` and instantiate it. 43 | 3. Call the `call` method with a message. Optionally, you can specify a set of functions to execute. 44 | 45 | ```javascript 46 | import { FunctionChain, fetchCryptoPrice, openApp } from "ai-function-chain"; 47 | 48 | const functionChain = new FunctionChain({ 49 | functions: [openApp, fetchCryptoPrice], 50 | }); 51 | 52 | const res1 = await functionChain.call("Open the calculator on my computer"); 53 | const res2 = await functionChain.call("Get me the latest price of Bitcoin"); 54 | const res3 = await functionChain.call("Get me the latest price of Ethereum"); 55 | 56 | console.log(`${res1} \n${res2} \n${res3}`); 57 | ``` 58 | 59 | ## API Keys 60 | 61 | To use `FunctionChain`, you must obtain and provide the appropriate API keys. 62 | 63 | REQUIRED: for all functions: 64 | 65 | ```bash 66 | OPENAI_API_KEY=your_openai_api_key 67 | ``` 68 | 69 | You need to obtain your OpenAI API Key [here](https://platform.openai.com/account/api-keys) and add it to the `.env` file. 70 | 71 | OPTIONAL: If you intend to use specific functions, you need to obtain the respective API keys: 72 | 73 | **For Alpha Vantage functions:** 74 | 75 | ```bash 76 | ALPHA_VANTAGE_API_KEY=your_alpha_vantage_api_key 77 | ``` 78 | 79 | Get your Alpha Vantage API key [here](https://www.alphavantage.co/support/#api-key) 80 | 81 | **For Pinecone functions:** 82 | 83 | ```bash 84 | PINECONE_API_KEY=your_pinecone_api_key 85 | PINECONE_ENVIRONMENT=your_pinecone_environment 86 | PINECONE_INDEX=your_pinecone_index 87 | ``` 88 | 89 | Get your Pinecone API key [here](https://docs.pinecone.io/docs/node-client) 90 | 91 | **For Visual Crossing API functions:** 92 | 93 | ```bash 94 | VISUAL_CROSSING_API_KEY=your_visual_crossing_api_key 95 | ``` 96 | 97 | Get your Visual Crossing API key [here](https://www.visualcrossing.com/weather-api) 98 | 99 | **For Huggingface API functions:** 100 | 101 | ```bash 102 | HUGGING_FACE_API_KEY=your_hugging_face_api_key 103 | ``` 104 | 105 | You can get your Huggingface API key [here](https://huggingface.co/settings/tokens) (A read only token) 106 | 107 | 108 | ## Examples 109 | 110 | Here are some examples of how you can use FunctionChain: 111 | 112 | **Example 1: Unix Example (No additional API Key Required)** 113 | 114 | ```javascript 115 | import { FunctionChain, openApp } from "ai-function-chain"; 116 | 117 | const functionChain = new FunctionChain({functions: [openApp]}); 118 | 119 | const res = await functionChain.call("Open the calculator on my computer"); 120 | 121 | console.log(res); 122 | ``` 123 | Alternatively, you can run the following: 124 | ```bash 125 | node examples/unix-example.js 126 | ``` 127 | 128 | **Example 2: Crypto Prices (No API Key Required)** 129 | 130 | ```javascript 131 | import { FunctionChain, fetchCryptoPrice } from "ai-function-chain"; 132 | 133 | const functionChain = new FunctionChain({functions: [fetchCryptoPrice]}); 134 | 135 | const res1 = await functionChain.call("Get me the latest price of Bitcoin"); 136 | 137 | const res2 = await functionChain.call("Get me the latest price of Ethereum"); 138 | 139 | console.log(`1. ${res1} \n2. ${res2}`); 140 | ``` 141 | Alternatively, you can run the following: 142 | ```bash 143 | node examples/no-api-key-example.js 144 | ``` 145 | 146 | **Example 3: Pinecone Example (Pinecone API Key Required)** 147 | 148 | You can get your Pinecone API Key [here](https://docs.pinecone.io/docs/node-client) 149 | 150 | ```javascript 151 | import { FunctionChain, createPinecone, updatePinecone, askPinecone } from "ai-function-chain"; 152 | 153 | const functionChain = new FunctionChain({functions: [createPinecone, updatePinecone, askPinecone]}); 154 | 155 | const create = await functionChain.call("Create a pinecone index called function-chain"); 156 | const update = await functionChain.call("Add 'John Smith, his phone number is 123-456-7890 and email johnsmith@example.com' under the namespace my-contacts"); 157 | const ask = await functionChain.call("What is John Smiths number? to-do's in my my-contacts pinecone namespace?"); 158 | 159 | console.log(`1. ${create} \n2. ${update} \n3. ${ask}`); 160 | ``` 161 | Alternatively, you can run the following: 162 | ```bash 163 | node examples/pinecone-example.js 164 | ``` 165 | 166 | **Example 4: Alpha Vantage API (Free API Key Required)** 167 | 168 | You can get your Alpha Vantage API key [here](https://www.alphavantage.co/support/#api-key) 169 | 170 | ```javascript 171 | import { FunctionChain, getAlphaVantageCompanyOverview } from "ai-function-chain"; 172 | 173 | const functionChain = new FunctionChain({functions: [getAlphaVantageCompanyOverview]}); 174 | 175 | const res1 = await functionChain.call("What is Apple's market capitalization"); 176 | const res2 = await functionChain.call("What is Microsoft's PE Ratio"); 177 | const res3 = await functionChain.call("What is Amazon's Revenue (TTM)"); 178 | const res4 = await functionChain.call("What is Alphabet's EBITDA"); 179 | 180 | console.log(`1. ${res1} \n2. ${res2} \n3. ${res3} \n4. ${res4}`); 181 | ``` 182 | Alternatively, you can run the following: 183 | ```bash 184 | node examples/alpha-vantage-examples.js 185 | ``` 186 | 187 | **Example 5: Huggingface Inference (Free API Key Required)** 188 | 189 | You can get your Huggingface API key [here](https://huggingface.co/settings/tokens) (A read only token) 190 | 191 | ```javascript 192 | import { FunctionChain, huggingFaceImageClassification } from "ai-function-chain"; 193 | 194 | const functionChain = new FunctionChain({functions: [huggingFaceImageClassification]}); 195 | 196 | const res = await functionChain.call("What is this image? https://www.shutterstock.com/image-photo/yellow-lovebird-sitting-alone-on-260nw-1894954309.jpg"); 197 | console.log(res); 198 | ``` 199 | Alternatively, you can run the following: 200 | ```bash 201 | node examples/hugging-face-example.js 202 | ``` 203 | 204 | **Example 6: Visual Crossing API (API Key Required)** 205 | 206 | You can get your Visual Crossing API key [here](https://www.visualcrossing.com/weather-api) 207 | 208 | ```javascript 209 | import { FunctionChain, getVisualCrossingWeatherForecast } from "ai-function-chain"; 210 | 211 | const functionChain = new FunctionChain({functions: [getVisualCrossingWeatherForecast]}); 212 | 213 | const res = await functionChain.call("What's the weather this week in Toronto"); 214 | console.log(res); 215 | ``` 216 | Alternatively, you can run the following: 217 | ```bash 218 | node examples/weather-visual-crossing-example.js 219 | ``` 220 | 221 | ### Example 7: Using the Wikipedia API (No API Key required) 222 | 223 | This example demonstrates how you can use the `wikipedia` function from the AI Function Chain to retrieve a summary of a Wikipedia page: 224 | 225 | ```javascript 226 | import { FunctionChain, wikipedia } from "ai-function-chain"; 227 | 228 | const functionChain = new FunctionChain({ 229 | functions: [wikipedia], 230 | skipFinalAPICall: true, 231 | }); 232 | 233 | const res = await functionChain.call("In one sentence, look up on wikipedia, what is Langchain?"); 234 | console.log(res); 235 | ``` 236 | 237 | You can also run this example directly from the command line: 238 | 239 | ``` 240 | node examples/wikipedia-example.js 241 | ``` 242 | 243 | **Note:** In this example, we're using the `skipFinalAPICall: true` option. This ensures that the result is obtained directly from the `wikipedia` function, without making a final API call to OpenAI. 244 | 245 | # Function Descriptions 246 | 247 | ## wikipedia 248 | - **Name**: wikipedia 249 | - **Description**: Search for "JavaScript" on Wikipedia. 250 | 251 | ## fetchCryptoPrice 252 | - **Name**: fetchCryptoPrice 253 | - **Description**: Fetches the price of a cryptocurrency from CoinGecko. 254 | 255 | ## getAlphaVantageCompanyOverview 256 | - **Name**: getAlphaVantageCompanyOverview 257 | - **Description**: Fetches company information, financial ratios, and other key metrics for the specified equity using the Alpha Vantage API. This includes the following information: Symbol, Asset Type, Name, Description, CIK, Exchange, Currency, Country, Sector, Industry, Address, Fiscal Year End, Latest Quarter, Market Capitalization, EBITDA, PE Ratio, PEG Ratio, Book Value, Dividend Per Share, Dividend Yield, EPS, Revenue Per Share (TTM), Profit Margin, Operating Margin (TTM), Return on Assets (TTM), Return on Equity (TTM), Revenue (TTM), Gross Profit (TTM), Diluted EPS (TTM), Quarterly Earnings Growth (YoY), Quarterly Revenue Growth (YoY), Analyst Target Price, Trailing PE, Forward PE, Price to Sales Ratio (TTM), Price to Book Ratio, EV to Revenue, EV to EBITDA, Beta, 52-Week High, 52-Week Low, 50-Day Moving Average, 200-Day Moving Average, Shares Outstanding, Dividend Date, Ex-Dividend Date. 258 | 259 | ## getAlphaVantageIntraday 260 | - **Name**: getAlphaVantageIntraday 261 | - **Description**: Fetches intraday data for a specified stock without extended hours. 262 | 263 | ## askPinecone 264 | - **Name**: askPinecone 265 | - **Description**: This function queries/asks a question to a Pinecone index and returns the top answer. The Pinecone client, index name, and API keys are specified in the .env file or function parameters. 266 | 267 | ## createPinecone 268 | - **Name**: createPinecone 269 | - **Description**: This function checks if a specified Pinecone index exists. If it does not exist, it will create a new one. Do not confuse this with updating an index. 270 | 271 | ## updatePinecone 272 | - **Name**: updatePinecone 273 | - **Description**: This function updates a Pinecone index with vector embeddings generated from a given text with an optional namespace if passed. The Pinecone client, index name, and API keys are specified in the .env file or function parameters. 274 | 275 | ## openApp 276 | - **Name**: openApp 277 | - **Description**: Opens a specified application on your computer 278 | 279 | ## takeScreenshot 280 | - **Name**: takeScreenshot 281 | - **Description**: Captures a screenshot from the terminal 282 | 283 | ## getVisualCrossingWeatherForecast 284 | - **Name**: getVisualCrossingWeatherForecast 285 | - **Description**: Fetches weather forecast for the specified location using the Visual Crossing API. This includes temperature, humidity, wind speed, and other important weather data. 286 | 287 | 288 | # Contribution 289 | 290 | Contributions to the `FunctionChain` library are more than welcome! If you have any helpful functions you'd like to contribute, or if there's a library you'd like to see integrated with `FunctionChain`, please feel free to reach out or submit a pull request. 291 | 292 | You can contribute in several ways: 293 | 294 | - **Submit a pull request**: If you've written any functions that you'd like to share with the community, you can submit a pull request on the GitHub repository. 295 | - **Open an issue**: If you've identified a bug or have a feature request, you can open an issue on the GitHub repository. 296 | - **Get in touch**: If you have ideas or questions, feel free to reach out directly. Your feedback and ideas are invaluable in continuing to improve `FunctionChain`. 297 | 298 | I am excited to see how you use `FunctionChain` and to hear your ideas for improvements! 299 | -------------------------------------------------------------------------------- /FunctionChain/entrypoint.js: -------------------------------------------------------------------------------- 1 | // UNIX Functions 2 | export * from './openAIFunctions/unix/openApp.js'; 3 | export * from './openAIFunctions/unix/takeScreenshot.js'; 4 | // Pinecone Functions 5 | export * from './openAIFunctions/pinecone/createPinecone.js'; 6 | export * from './openAIFunctions/pinecone/askPinecone.js'; 7 | export * from './openAIFunctions/pinecone/updatePinecone.js'; 8 | // Huggingface Functions 9 | export * from './openAIFunctions/huggingface/huggingFaceImageClassification.js'; 10 | // Finance Functions 11 | export * from './openAIFunctions/finance/fetchCryptoPrice.js'; 12 | export * from './openAIFunctions/finance/getAlphaVantageCompanyOverview.js'; 13 | export * from './openAIFunctions/finance/getAlphaVantageIntraday.js'; 14 | // Weather Functions 15 | export * from './openAIFunctions/weather/getVisualCrossingWeatherForecast.js'; 16 | // Wikipedia Functions 17 | export * from './openAIFunctions/wikipedia.js'; 18 | // Node.JS Code Interpreter 19 | export * from 'ai-function-chain/openAIFunctions/codeInterpreter.js'; -------------------------------------------------------------------------------- /FunctionChain/index.js: -------------------------------------------------------------------------------- 1 | import dotenv from "dotenv"; 2 | import fetch from "node-fetch"; 3 | import * as allFunctions from './entrypoint.js'; 4 | 5 | dotenv.config(); 6 | 7 | export class FunctionChain { 8 | constructor(initOptions = {}) { 9 | this.model = initOptions.openaiOptions?.model || "gpt-3.5-turbo"; 10 | this.baseURL = "https://api.openai.com/v1/chat/completions"; 11 | this.headers = { 12 | "Content-Type": "application/json", 13 | Authorization: "Bearer " + process.env.OPENAI_API_KEY, 14 | }; 15 | this.functions = initOptions.functions || []; 16 | this.skipFinalAPICall = initOptions.skipFinalAPICall || false; 17 | } 18 | 19 | async call(message, options = {}) { 20 | let functionMap; 21 | if (options.functions && options.functions.length > 0) { 22 | functionMap = options.functions.reduce((result, func) => { 23 | result[func.details.name] = func; 24 | return result; 25 | }, {}); 26 | } else if (this.functions.length > 0) { 27 | functionMap = this.functions.reduce((result, func) => { 28 | result[func.details.name] = func; 29 | return result; 30 | }, {}); 31 | } else { 32 | console.warn("No functions were provided. Defaulting to all available functions."); 33 | functionMap = Object.values(allFunctions).reduce((result, func) => { 34 | result[func.details.name] = func; 35 | return result; 36 | }, {}); 37 | } 38 | 39 | let data = { 40 | messages: [ 41 | { 42 | role: "user", 43 | content: message, 44 | }, 45 | ], 46 | model: this.model, 47 | functions: Object.values(functionMap).map(func => func.details), 48 | function_call: "auto", 49 | }; 50 | 51 | try { 52 | let response = await fetch(this.baseURL, { 53 | method: "POST", 54 | headers: this.headers, 55 | body: JSON.stringify(data), 56 | }); 57 | response = await response.json(); 58 | let executedFunctions = {}; 59 | while ( 60 | response.choices && 61 | response.choices[0].message.function_call && 62 | response.choices[0].finish_reason !== "stop" 63 | ) { 64 | let message = response.choices[0].message; 65 | const function_name = message.function_call.name; 66 | 67 | if (executedFunctions[function_name]) { 68 | break; 69 | } 70 | 71 | let function_response = ""; 72 | if (functionMap.hasOwnProperty(function_name)) { 73 | // remove template literals 74 | message.function_call.arguments = message.function_call.arguments.replace(/`/g, ''); 75 | const functionArgs = JSON.parse(message.function_call.arguments); 76 | console.log(`Executing function: "${function_name}" with args: ${JSON.stringify(functionArgs)}`); 77 | 78 | const functionToExecute = functionMap[function_name]; 79 | function_response = await functionToExecute.execute(functionArgs); 80 | } else { 81 | throw new Error(`Unsupported function: ${function_name}, ensure function name within description matches the javascript file name i.e. latestPrices.js should have a name: 'latestPrices' within the details object`); 82 | } 83 | 84 | executedFunctions[function_name] = true; 85 | data.messages.push({ 86 | role: "function", 87 | name: function_name, 88 | content: function_response, 89 | }); 90 | 91 | // If additional API calls are not to be skipped, make another API call to OpenAI, otherwise return the response 92 | if(!this.skipFinalAPICall) { 93 | response = await fetch(this.baseURL, { 94 | method: "POST", 95 | headers: this.headers, 96 | body: JSON.stringify(data), 97 | }); 98 | response = await response.json(); 99 | }else{ 100 | console.log("Skipping final API call to OpenAI, return function response") 101 | return JSON.stringify(function_response); 102 | } 103 | } 104 | 105 | if (response.error) { 106 | throw new Error(response.error.message); 107 | } else { 108 | return response.choices[0].message.content; 109 | } 110 | } catch (error) { 111 | console.error("Error:", error); 112 | } 113 | } 114 | } 115 | 116 | export * from './entrypoint.js'; 117 | -------------------------------------------------------------------------------- /FunctionChain/openAIFunctions/codeInterpreter.js: -------------------------------------------------------------------------------- 1 | import vm from "vm"; 2 | 3 | const execute = async (options) => { 4 | const { code } = options; 5 | let logBuffer = ''; 6 | const context = { 7 | console: { 8 | ...console, 9 | log: (...args) => { 10 | args.forEach(arg => logBuffer += arg + ' '); 11 | logBuffer += '\n'; 12 | } 13 | } 14 | }; 15 | const script = new vm.Script(code); 16 | await script.runInNewContext(context); 17 | console.log("Executed \"" + code + "\" in the Node.js V8 runtime"); 18 | const resultObject = { code, result: logBuffer }; 19 | return JSON.stringify(resultObject); 20 | }; 21 | 22 | const details = { 23 | name: "codeInterpreter", 24 | description: "Function can execute Node.js code directly code requested within a Node.js V8 runtime written in Javascript and returns the result. Doesn't support any new require or import statements yet.", 25 | parameters: { 26 | type: "object", 27 | properties: { 28 | code: { 29 | type: "string", 30 | description: "The JavaScript code to execute.", 31 | }, 32 | }, 33 | required: ['code'], 34 | }, 35 | example: "Console log hello world in the Node.js V8 runtime" 36 | }; 37 | 38 | export const codeInterpreter = { 39 | execute, 40 | details, 41 | }; 42 | -------------------------------------------------------------------------------- /FunctionChain/openAIFunctions/finance/fetchCryptoPrice.js: -------------------------------------------------------------------------------- 1 | // 1. Write Function Code Within Execute Function 2 | const execute = async (options) => { 3 | const { cryptoName, vsCurrency } = options; 4 | try { 5 | const url = `https://api.coingecko.com/api/v3/simple/price?ids=${cryptoName.toString()}&vs_currencies=${vsCurrency.toString()}`; 6 | const response = await fetch(url); 7 | const data = await response.json(); 8 | return { 9 | cryptoName: cryptoName.toLowerCase(), 10 | price: data[cryptoName.toLowerCase()][vsCurrency.toLowerCase()], 11 | }; 12 | } catch (error) { 13 | console.error(`Error fetching ${cryptoName} price:`, error); 14 | throw error; 15 | } 16 | }; 17 | // 2. Add Function Details for LLM to use 18 | const details = { 19 | name: 'fetchCryptoPrice', 20 | description: 'Fetches the price of a cryptocurrency from CoinGecko', 21 | parameters: { 22 | type: 'object', 23 | properties: { 24 | cryptoName: { 25 | type: 'string', 26 | description: 'The name of the cryptocurrency', 27 | }, 28 | vsCurrency: { 29 | type: 'string', 30 | description: 'The target currency to compare the cryptocurrency price against', 31 | }, 32 | }, 33 | required: ['cryptoName', 'vsCurrency'], 34 | }, 35 | example: 'Get the current price of Bitcoin in USD', 36 | }; 37 | export const fetchCryptoPrice = { 38 | execute, 39 | details, 40 | }; 41 | -------------------------------------------------------------------------------- /FunctionChain/openAIFunctions/finance/getAlphaVantageCompanyOverview.js: -------------------------------------------------------------------------------- 1 | // 1. Write Function Code Within Execute Function 2 | const execute = async (options) => { 3 | const { symbol } = options; 4 | const apiKey = process.env.ALPHA_VANTAGE_API_KEY; 5 | if (!apiKey) { 6 | return "API key not found in process environment variables. Please ensure to input your Alpha Vantage API key in the .env file for this function to work."; 7 | } 8 | const url = `https://www.alphavantage.co/query?function=OVERVIEW&symbol=${symbol}&apikey=${apiKey}`; 9 | try { 10 | const response = await fetch(url); 11 | const data = await response.json(); 12 | return JSON.stringify(data, null, 2); 13 | } catch (error) { 14 | console.error(`Error fetching company overview:`, error); 15 | throw error; 16 | } 17 | }; 18 | // 2. Add Function Details for LLM to use 19 | const details = { 20 | name: "getAlphaVantageCompanyOverview", 21 | description: 22 | "Fetches company information, financial ratios, and other key metrics for the specified equity using the Alpha Vantage API. This includes the following information: Symbol, Asset Type, Name, Description, CIK, Exchange, Currency, Country, Sector, Industry, Address, Fiscal Year End, Latest Quarter, Market Capitalization, EBITDA, PE Ratio, PEG Ratio, Book Value, Dividend Per Share, Dividend Yield, EPS, Revenue Per Share (TTM), Profit Margin, Operating Margin (TTM), Return on Assets (TTM), Return on Equity (TTM), Revenue (TTM), Gross Profit (TTM), Diluted EPS (TTM), Quarterly Earnings Growth (YoY), Quarterly Revenue Growth (YoY), Analyst Target Price, Trailing PE, Forward PE, Price to Sales Ratio (TTM), Price to Book Ratio, EV to Revenue, EV to EBITDA, Beta, 52-Week High, 52-Week Low, 50-Day Moving Average, 200-Day Moving Average, Shares Outstanding, Dividend Date, Ex-Dividend Date.", 23 | parameters: { 24 | type: "object", 25 | properties: { 26 | symbol: { 27 | type: "string", 28 | description: 29 | "The symbol of the ticker of your choice. For example: symbol=IBM.", 30 | }, 31 | }, 32 | }, 33 | example: "Get company overview for IBM", 34 | }; 35 | export const getAlphaVantageCompanyOverview = { 36 | execute, 37 | details, 38 | }; 39 | -------------------------------------------------------------------------------- /FunctionChain/openAIFunctions/finance/getAlphaVantageIntraday.js: -------------------------------------------------------------------------------- 1 | const execute = async (options) => { 2 | const { symbol } = options; 3 | const apiKey = process.env.ALPHA_VANTAGE_API_KEY; 4 | 5 | if (!apiKey) { 6 | return 'API key not found. Please input your Alpha Vantage API key.'; 7 | } 8 | 9 | let url = `https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=${symbol}&interval=1min&outputsize=compact&extended_hours=false&apikey=${apiKey}`; 10 | 11 | try { 12 | const response = await fetch(url); 13 | const data = await response.json(); 14 | 15 | if (data["Meta Data"]) { 16 | const latestTradingDay = data["Meta Data"]["3. Last Refreshed"]; 17 | const latestData = data["Time Series (1min)"][latestTradingDay]; 18 | const { "1. open": open, "2. high": high, "3. low": low, "4. close": close, "5. volume": volume } = latestData; 19 | 20 | return `Latest data for ${symbol} on ${latestTradingDay}: Open - ${open}, High - ${high}, Low - ${low}, Close - ${close}, Volume - ${volume}.`; 21 | } else { 22 | return 'No data available. Check the ticker or try again later.'; 23 | } 24 | 25 | } catch (error) { 26 | console.error(`Error fetching intraday data:`, error); 27 | throw error; 28 | } 29 | }; 30 | 31 | const details = { 32 | name: 'getAlphaVantageIntraday', 33 | description: 'Fetches intraday data for a specified stock without extended hours.', 34 | parameters: { 35 | type: 'object', 36 | properties: { 37 | symbol: { 38 | type: 'string', 39 | description: 'The stock symbol.', 40 | }, 41 | }, 42 | }, 43 | example: 'Get intraday data for IBM', 44 | }; 45 | 46 | export const getAlphaVantageIntraday = { 47 | execute, 48 | details, 49 | }; 50 | -------------------------------------------------------------------------------- /FunctionChain/openAIFunctions/huggingface/huggingFaceImageClassification.js: -------------------------------------------------------------------------------- 1 | import { HfInference } from '@huggingface/inference'; 2 | import fetch from 'node-fetch'; 3 | 4 | const execute = async (options) => { 5 | const { imageUrl } = options; 6 | const apiKey = process.env.HUGGING_FACE_API_KEY; 7 | 8 | if (!apiKey) { 9 | return 'API key not found in process environment variables. Please ensure to input your Hugging Face API access token in the .env file for this function to work.'; 10 | } 11 | 12 | const hf = new HfInference(apiKey); 13 | 14 | try { 15 | const imageResponse = await fetch(imageUrl); 16 | const imageData = await imageResponse.buffer(); 17 | 18 | const output = await hf.imageClassification({ 19 | data: imageData, 20 | model: 'google/vit-base-patch16-224', 21 | }); 22 | 23 | return JSON.stringify(output); 24 | } catch (error) { 25 | console.error('Error classifying image:', error); 26 | throw error; 27 | } 28 | }; 29 | 30 | const details = { 31 | name: 'huggingFaceImageClassification', 32 | description: 'Performs image classification using the Hugging Face Inference API.', 33 | parameters: { 34 | type: 'object', 35 | properties: { 36 | imageUrl: { 37 | type: 'string', 38 | description: 'The URL of the image to classify.', 39 | }, 40 | }, 41 | }, 42 | example: 'Classify an image using the Google VIT model', 43 | }; 44 | export const huggingFaceImageClassification = { 45 | execute, 46 | details, 47 | }; 48 | 49 | -------------------------------------------------------------------------------- /FunctionChain/openAIFunctions/pinecone/askPinecone.js: -------------------------------------------------------------------------------- 1 | import { PineconeClient } from "@pinecone-database/pinecone"; 2 | import { OpenAIEmbeddings } from "langchain/embeddings/openai"; 3 | 4 | const execute = async ({ indexName = process.env.PINECONE_INDEX, question, namespace }) => { 5 | // console.log(`Querying question to Pinecone index: ${question}`); 6 | const apiKey = process.env.PINECONE_API_KEY; 7 | const environment = process.env.PINECONE_ENVIRONMENT; 8 | 9 | if (!apiKey || !environment || !indexName) { 10 | console.warn('Warning: API key, environment, or Pinecone index name not found in process environment variables or function parameters. Please ensure to input your Pinecone API key, environment, and index name in the .env file or function parameters for this function to work.'); 11 | return; 12 | } 13 | 14 | const client = new PineconeClient(); 15 | await client.init({ 16 | apiKey, 17 | environment, 18 | }); 19 | 20 | const index = client.Index(indexName); 21 | const queryEmbedding = await new OpenAIEmbeddings().embedQuery(question); 22 | 23 | let queryResponse = await index.query({ 24 | queryRequest: { 25 | namespace: namespace || null, 26 | topK: 3, 27 | vector: queryEmbedding, 28 | includeMetadata: true, 29 | includeValues: true, 30 | }, 31 | }); 32 | 33 | let response = {}; 34 | 35 | if (queryResponse.matches.length) { 36 | const topResultsString = queryResponse.matches 37 | .map((match, index) => `${index + 1}. ${match.metadata.txtPath}`) 38 | .join(", "); 39 | 40 | response = `indexName: ${indexName}, question: ${question}, namespace: ${namespace}, answer: Query '${question}' to index '${indexName}' in namespace '${namespace}' yielded the following top results: ${topResultsString}`; 41 | } else { 42 | response = `indexName: ${indexName}, question: ${question}, namespace: ${namespace}, answer: There were no matches found for the question: ${question} in the Pinecone index: ${indexName}`; 43 | } 44 | return response; 45 | }; 46 | 47 | 48 | const details = { 49 | name: 'askPinecone', 50 | description: 'This function queries/asks a question to a Pinecone index and returns the top answer. The Pinecone client, index name, and API keys are specified in the .env file or function parameters.', 51 | parameters: { 52 | type: 'object', 53 | properties: { 54 | indexName: { 55 | type: 'string', 56 | description: 'The name of the Pinecone index to be queried. If not provided, it will default to the value specified in the .env file.', 57 | }, 58 | question: { 59 | type: 'string', 60 | description: 'The query for the Pinecone index.', 61 | }, 62 | namespace: { 63 | type: 'string', 64 | description: 'Optional namespace for Pinecone query.', 65 | }, 66 | }, 67 | required: ['question'], 68 | }, 69 | example: 'Query the Pinecone index with a question.', 70 | }; 71 | 72 | export const askPinecone = { 73 | execute, 74 | details, 75 | }; 76 | -------------------------------------------------------------------------------- /FunctionChain/openAIFunctions/pinecone/createPinecone.js: -------------------------------------------------------------------------------- 1 | // Import required packages 2 | import { PineconeClient } from "@pinecone-database/pinecone"; 3 | 4 | // 1. Write Function Code Within Execute Function 5 | const execute = async ({ indexName: paramIndexName }) => { 6 | const indexName = paramIndexName || process.env.PINECONE_INDEX; 7 | if (!indexName) { 8 | console.warn( 9 | "No indexName provided and no 'PINECONE_INDEX' environment variable found. Please specify an index name." 10 | ); 11 | return; 12 | } 13 | // console.log(`Checking if ${indexName} index exists in Pinecone...`); 14 | const apiKey = process.env.PINECONE_API_KEY; 15 | const environment = process.env.PINECONE_ENVIRONMENT; 16 | const vectorDimension = 1536; // Vector dimension is set to a constant value 17 | if (!apiKey || !environment) { 18 | return "API key or environment not found in process environment variables. Please ensure to input your Pinecone API key and environment in the .env file for this function to work."; 19 | } 20 | const client = new PineconeClient(); 21 | await client.init({ 22 | apiKey, 23 | environment, 24 | }); 25 | 26 | const existingIndexes = await client.listIndexes(); 27 | 28 | if (!existingIndexes.includes(indexName)) { 29 | console.log( 30 | `Creating index "${indexName}" this can take a couple minutes to initalize the index if creating for the first time` 31 | ); 32 | await client.createIndex({ 33 | createRequest: { 34 | name: indexName, 35 | dimension: vectorDimension, 36 | metric: "cosine", 37 | }, 38 | }); 39 | await new Promise((resolve) => setTimeout(resolve, 60000)); // Pause for 30 seconds while initalizing the firs time 40 | 41 | return `Created client with index "${indexName}"`; 42 | } else { 43 | return `"${indexName}" already exists.`; 44 | } 45 | }; 46 | 47 | // 2. Add Function Details for LLM to use 48 | const details = { 49 | name: "createPinecone", 50 | description: 51 | "This function checks if a specified Pinecone index exists. If it does not exist, it will create a new one. Do not confuse this with updating an index.", 52 | parameters: { 53 | type: "object", 54 | properties: { 55 | indexName: { 56 | type: "string", 57 | description: 58 | "The name of the index to be created or checked. If not provided, it will default to the value specified in the .env file.", 59 | }, 60 | }, 61 | }, 62 | example: 63 | 'Check if "your-pinecone-index-name" index exists, if not create it.', 64 | }; 65 | export const createPinecone = { 66 | execute, 67 | details, 68 | }; 69 | -------------------------------------------------------------------------------- /FunctionChain/openAIFunctions/pinecone/updatePinecone.js: -------------------------------------------------------------------------------- 1 | import { PineconeClient } from "@pinecone-database/pinecone"; 2 | import { OpenAIEmbeddings } from "langchain/embeddings/openai"; 3 | import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; 4 | 5 | const execute = async ({ 6 | text, 7 | indexName: paramIndexName, 8 | source, 9 | namespace, 10 | }) => { 11 | // console.log(`Updating Pinecone index with: ${text}..`); 12 | const apiKey = process.env.PINECONE_API_KEY; 13 | const environment = process.env.PINECONE_ENVIRONMENT; 14 | const indexName = paramIndexName || process.env.PINECONE_INDEX; 15 | 16 | if (!apiKey || !environment || !indexName) { 17 | throw new Error( 18 | "API key, environment, or Pinecone index name not found in process environment variables or function parameters. Please ensure to input your Pinecone API key, environment, and index name in the .env file or function parameters for this function to work." 19 | ); 20 | } 21 | 22 | const client = new PineconeClient(); 23 | await client.init({ 24 | apiKey, 25 | environment, 26 | }); 27 | 28 | const index = client.Index(indexName); 29 | const textSplitter = new RecursiveCharacterTextSplitter({ 30 | chunkSize: 1000, 31 | }); 32 | 33 | const chunks = await textSplitter.createDocuments([text]); 34 | const embeddingsArrays = await new OpenAIEmbeddings().embedDocuments( 35 | chunks.map((chunk) => chunk.pageContent.replace(/\n/g, " ")) 36 | ); 37 | 38 | const batchSize = 100; 39 | let batch = []; 40 | 41 | for (let idx = 0; idx < chunks.length; idx++) { 42 | const chunk = chunks[idx]; 43 | const vector = { 44 | id: `${text}_${idx}`, 45 | values: embeddingsArrays[idx], 46 | metadata: { 47 | ...chunk.metadata, 48 | source, 49 | loc: JSON.stringify(chunk.metadata.loc), 50 | txtPath: text, 51 | }, 52 | }; 53 | batch.push(vector); 54 | if (batch.length === batchSize || idx === chunks.length - 1) { 55 | await index.upsert({ 56 | upsertRequest: { 57 | vectors: batch, 58 | namespace: namespace, // Use the namespace parameter here 59 | }, 60 | }); 61 | 62 | batch = []; 63 | } 64 | } 65 | 66 | return `The Pinecone index "${indexName}" was updated with text: "${text}" in the namespace "${namespace}"`; 67 | }; 68 | 69 | const details = { 70 | name: "updatePinecone", 71 | description: 72 | "This function updates a Pinecone index with vector embeddings generated from a given text with an optional namespace if passed. The Pinecone client, index name, and API keys are specified in the .env file or function parameters.", 73 | parameters: { 74 | type: "object", 75 | properties: { 76 | text: { 77 | type: "string", 78 | description: 79 | "The text to be processed and added to the Pinecone index.", 80 | }, 81 | indexName: { 82 | type: "string", 83 | description: 84 | "Optional name of the Pinecone index to be updated. If not provided, it will default to the value specified in the .env file.", 85 | }, 86 | source: { 87 | type: "string", 88 | description: 89 | "Optional source of the text being processed. This is optional and will be included in the vector metadata if provided.", 90 | }, 91 | namespace: { 92 | type: "string", 93 | description: 94 | "Optional namespace to be used when updating the Pinecone index. This is optional and if not provided, no namespace will be used.", 95 | }, 96 | }, 97 | required: ["text"], 98 | }, 99 | 100 | example: 101 | "Update the Pinecone index with vector embeddings generated from a given text, with an optional Pinecone index name.", 102 | }; 103 | 104 | export const updatePinecone = { 105 | execute, 106 | details, 107 | }; 108 | -------------------------------------------------------------------------------- /FunctionChain/openAIFunctions/unix/openApp.js: -------------------------------------------------------------------------------- 1 | // openApp.js 2 | import { exec } from 'child_process'; 3 | 4 | const execute = (options) => { 5 | const { appName } = options; 6 | return new Promise((resolve, reject) => { 7 | exec(`open -a "${appName}"`, (error, stdout, stderr) => { 8 | if (error) { 9 | console.warn(error); 10 | reject(`Error opening ${appName}: ${error.message}`); 11 | } 12 | resolve(`${appName} opened successfully.`); 13 | }); 14 | }); 15 | } 16 | 17 | const details = { 18 | name: "openApp", 19 | description: "Opens a specified application on your computer", 20 | parameters: { 21 | type: "object", 22 | properties: { 23 | appName: { 24 | type: "string", 25 | description: "The name of the application to open" 26 | }, 27 | }, 28 | required: ["appName"], 29 | }, 30 | example: "Open the 'Calculator' application" 31 | }; 32 | 33 | export const openApp = { execute, details }; 34 | -------------------------------------------------------------------------------- /FunctionChain/openAIFunctions/unix/takeScreenshot.js: -------------------------------------------------------------------------------- 1 | // 1. Add Dependencies 2 | import { exec } from 'child_process'; 3 | 4 | // 2. Write Function Code Within Execute Function 5 | const execute = () => { 6 | return new Promise((resolve, reject) => { 7 | exec('screencapture screenshot.png', (error, stdout, stderr) => { 8 | if (error) { 9 | console.warn(error); 10 | reject(`Error taking screenshot: ${error.message}`); 11 | } 12 | resolve('Screenshot captured successfully.'); 13 | }); 14 | }); 15 | }; 16 | 17 | // 3. Add Function Details for LLM to use 18 | const details = { 19 | name: "takeScreenshot", 20 | description: "Captures a screenshot for mac from the terminal", 21 | parameters: { 22 | type: "object", 23 | properties: {}, 24 | required: [], 25 | }, 26 | example: "Capture a screenshot from the terminal" 27 | }; 28 | 29 | export const takeScreenshot = { 30 | execute, 31 | details, 32 | }; 33 | -------------------------------------------------------------------------------- /FunctionChain/openAIFunctions/weather/getVisualCrossingWeatherForecast.js: -------------------------------------------------------------------------------- 1 | const execute = async (options) => { 2 | const { location, startDate, endDate } = options; 3 | const apiKey = process.env.VISUAL_CROSSING_API_KEY; 4 | 5 | if (!apiKey) { 6 | return 'API key not found in process environment variables. Please ensure to input your Visual Crossing API key in the .env file for this function to work.'; 7 | } 8 | 9 | let url = `https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/${location}`; 10 | 11 | if(startDate) url += `/${startDate}`; 12 | if(endDate) url += `/${endDate}`; 13 | 14 | url += `?key=${apiKey}`; 15 | 16 | try { 17 | const response = await fetch(url); 18 | if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`); 19 | 20 | const data = await response.json(); 21 | 22 | let result = `Weather for ${data.resolvedAddress} - ${data.description}\n`; 23 | 24 | for(let day of data.days) { 25 | result += `On ${day.datetime}, max temp: ${day.tempmax}, min temp: ${day.tempmin}, condition: ${day.conditions}\n`; 26 | } 27 | 28 | return result; 29 | 30 | } catch (error) { 31 | console.error(`Error fetching weather data:`, error); 32 | throw error; 33 | } 34 | }; 35 | 36 | const details = { 37 | name: 'getVisualCrossingWeatherForecast', 38 | description: 'Fetches weather forecast for the specified location using the Visual Crossing API. This includes temperature, humidity, wind speed, and other important weather data.', 39 | parameters: { 40 | type: 'object', 41 | properties: { 42 | location: { 43 | type: 'string', 44 | description: 'The name of the location you want to get weather data for. For example: location="Toronto, Canada".', 45 | }, 46 | startDate: { 47 | type: 'string', 48 | description: 'The start date for the weather data in the format YYYY-MM-DD. If not provided, it defaults to the current date.', 49 | }, 50 | endDate: { 51 | type: 'string', 52 | description: 'The end date for the weather data in the format YYYY-MM-DD. If not provided, it defaults to 7 days from the current date.', 53 | }, 54 | }, 55 | }, 56 | example: 'Get weather data for the week in Toronto, Canada', 57 | }; 58 | 59 | export const getVisualCrossingWeatherForecast = { 60 | execute, 61 | details, 62 | }; -------------------------------------------------------------------------------- /FunctionChain/openAIFunctions/wikipedia.js: -------------------------------------------------------------------------------- 1 | const fetchSearchResults = async (query) => { 2 | const url = `https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=${query}&format=json`; 3 | const response = await fetch(url); 4 | if (!response.ok) throw new Error("Network response was not ok"); 5 | const data = await response.json(); 6 | return data.query.search.map(result => result.title); 7 | }; 8 | const fetchPageContent = async (page) => { 9 | const url = `https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exlimit=max&explaintext&titles=${page}&format=json`; 10 | const response = await fetch(url); 11 | if (!response.ok) throw new Error("Network response was not ok"); 12 | const data = await response.json(); 13 | const pages = data.query.pages; 14 | const pageId = Object.keys(pages)[0]; 15 | return pages[pageId].extract; 16 | }; 17 | 18 | const execute = async (options) => { 19 | const { query, top_k_results = 3, doc_content_chars_max = 4000 } = options; 20 | 21 | const titles = await fetchSearchResults(query); 22 | let content = ""; 23 | 24 | for (let i = 0; i < Math.min(top_k_results, titles.length); i++) { 25 | const pageContent = await fetchPageContent(titles[i]); 26 | content += `Page: ${titles[i]}\nSummary: ${pageContent.slice(0, doc_content_chars_max)}\n\n`; 27 | } 28 | 29 | return content || "No good Wikipedia Search Result was found"; 30 | }; 31 | 32 | const details = { 33 | name: 'wikipedia', 34 | description: 'Fetches top Wikipedia search results and their content for a given query', 35 | parameters: { 36 | type: 'object', 37 | properties: { 38 | query: { 39 | type: 'string', 40 | description: 'The search query', 41 | }, 42 | top_k_results: { 43 | type: 'number', 44 | description: 'The number of top results to fetch', 45 | }, 46 | doc_content_chars_max: { 47 | type: 'number', 48 | description: 'The maximum character limit for each search result content', 49 | }, 50 | }, 51 | required: ['query'], 52 | }, 53 | example: 'Search for "JavaScript" on Wikipedia', 54 | }; 55 | 56 | export const wikipedia = { 57 | execute, 58 | details, 59 | }; 60 | -------------------------------------------------------------------------------- /FunctionChain/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ai-function-chain", 3 | "version": "0.0.54", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "ai-function-chain", 9 | "version": "0.0.54", 10 | "license": "MIT", 11 | "dependencies": { 12 | "@huggingface/inference": "^1.8.0", 13 | "@pinecone-database/pinecone": "^0.1.6", 14 | "ai": "^2.1.15", 15 | "dotenv": "^16.3.1", 16 | "langchain": "^0.0.102" 17 | } 18 | }, 19 | "node_modules/@anthropic-ai/sdk": { 20 | "version": "0.4.4", 21 | "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.4.4.tgz", 22 | "integrity": "sha512-Z/39nQi1sSUCeLII3lsAbL1u+0JF6cR2XmUEX9sLH0VtxmIjY6cjOUYjCkYh4oapTxOkhAFnVSAFJ6cxml2qXg==", 23 | "dependencies": { 24 | "@fortaine/fetch-event-source": "^3.0.6", 25 | "cross-fetch": "^3.1.5" 26 | } 27 | }, 28 | "node_modules/@babel/parser": { 29 | "version": "7.22.7", 30 | "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.7.tgz", 31 | "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==", 32 | "peer": true, 33 | "bin": { 34 | "parser": "bin/babel-parser.js" 35 | }, 36 | "engines": { 37 | "node": ">=6.0.0" 38 | } 39 | }, 40 | "node_modules/@fortaine/fetch-event-source": { 41 | "version": "3.0.6", 42 | "resolved": "https://registry.npmjs.org/@fortaine/fetch-event-source/-/fetch-event-source-3.0.6.tgz", 43 | "integrity": "sha512-621GAuLMvKtyZQ3IA6nlDWhV1V/7PGOTNIGLUifxt0KzM+dZIweJ6F3XvQF3QnqeNfS1N7WQ0Kil1Di/lhChEw==", 44 | "engines": { 45 | "node": ">=16.15" 46 | } 47 | }, 48 | "node_modules/@huggingface/inference": { 49 | "version": "1.8.0", 50 | "resolved": "https://registry.npmjs.org/@huggingface/inference/-/inference-1.8.0.tgz", 51 | "integrity": "sha512-Dkh7PiyMf6TINRocQsdceiR5LcqJiUHgWjaBMRpCUOCbs+GZA122VH9q+wodoSptj6rIQf7wIwtDsof+/gd0WA==", 52 | "engines": { 53 | "node": ">=18" 54 | } 55 | }, 56 | "node_modules/@jridgewell/sourcemap-codec": { 57 | "version": "1.4.15", 58 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", 59 | "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", 60 | "peer": true 61 | }, 62 | "node_modules/@pinecone-database/pinecone": { 63 | "version": "0.1.6", 64 | "resolved": "https://registry.npmjs.org/@pinecone-database/pinecone/-/pinecone-0.1.6.tgz", 65 | "integrity": "sha512-tCnVc28udecthhgSBTdcMhYEW+xsR++AdZasp+ZE/AvUD1hOR2IR3edjk9m0sDxZyvXbno2KeqUbLIOZr7sCTw==", 66 | "dependencies": { 67 | "cross-fetch": "^3.1.5" 68 | }, 69 | "engines": { 70 | "node": ">=14.0.0" 71 | } 72 | }, 73 | "node_modules/@types/retry": { 74 | "version": "0.12.0", 75 | "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", 76 | "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" 77 | }, 78 | "node_modules/@types/uuid": { 79 | "version": "9.0.2", 80 | "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.2.tgz", 81 | "integrity": "sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ==" 82 | }, 83 | "node_modules/@vue/compiler-core": { 84 | "version": "3.3.4", 85 | "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", 86 | "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", 87 | "peer": true, 88 | "dependencies": { 89 | "@babel/parser": "^7.21.3", 90 | "@vue/shared": "3.3.4", 91 | "estree-walker": "^2.0.2", 92 | "source-map-js": "^1.0.2" 93 | } 94 | }, 95 | "node_modules/@vue/compiler-dom": { 96 | "version": "3.3.4", 97 | "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", 98 | "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", 99 | "peer": true, 100 | "dependencies": { 101 | "@vue/compiler-core": "3.3.4", 102 | "@vue/shared": "3.3.4" 103 | } 104 | }, 105 | "node_modules/@vue/compiler-sfc": { 106 | "version": "3.3.4", 107 | "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz", 108 | "integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==", 109 | "peer": true, 110 | "dependencies": { 111 | "@babel/parser": "^7.20.15", 112 | "@vue/compiler-core": "3.3.4", 113 | "@vue/compiler-dom": "3.3.4", 114 | "@vue/compiler-ssr": "3.3.4", 115 | "@vue/reactivity-transform": "3.3.4", 116 | "@vue/shared": "3.3.4", 117 | "estree-walker": "^2.0.2", 118 | "magic-string": "^0.30.0", 119 | "postcss": "^8.1.10", 120 | "source-map-js": "^1.0.2" 121 | } 122 | }, 123 | "node_modules/@vue/compiler-ssr": { 124 | "version": "3.3.4", 125 | "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz", 126 | "integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==", 127 | "peer": true, 128 | "dependencies": { 129 | "@vue/compiler-dom": "3.3.4", 130 | "@vue/shared": "3.3.4" 131 | } 132 | }, 133 | "node_modules/@vue/reactivity": { 134 | "version": "3.3.4", 135 | "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.4.tgz", 136 | "integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", 137 | "peer": true, 138 | "dependencies": { 139 | "@vue/shared": "3.3.4" 140 | } 141 | }, 142 | "node_modules/@vue/reactivity-transform": { 143 | "version": "3.3.4", 144 | "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz", 145 | "integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==", 146 | "peer": true, 147 | "dependencies": { 148 | "@babel/parser": "^7.20.15", 149 | "@vue/compiler-core": "3.3.4", 150 | "@vue/shared": "3.3.4", 151 | "estree-walker": "^2.0.2", 152 | "magic-string": "^0.30.0" 153 | } 154 | }, 155 | "node_modules/@vue/runtime-core": { 156 | "version": "3.3.4", 157 | "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.4.tgz", 158 | "integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==", 159 | "peer": true, 160 | "dependencies": { 161 | "@vue/reactivity": "3.3.4", 162 | "@vue/shared": "3.3.4" 163 | } 164 | }, 165 | "node_modules/@vue/runtime-dom": { 166 | "version": "3.3.4", 167 | "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz", 168 | "integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==", 169 | "peer": true, 170 | "dependencies": { 171 | "@vue/runtime-core": "3.3.4", 172 | "@vue/shared": "3.3.4", 173 | "csstype": "^3.1.1" 174 | } 175 | }, 176 | "node_modules/@vue/server-renderer": { 177 | "version": "3.3.4", 178 | "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.4.tgz", 179 | "integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==", 180 | "peer": true, 181 | "dependencies": { 182 | "@vue/compiler-ssr": "3.3.4", 183 | "@vue/shared": "3.3.4" 184 | }, 185 | "peerDependencies": { 186 | "vue": "3.3.4" 187 | } 188 | }, 189 | "node_modules/@vue/shared": { 190 | "version": "3.3.4", 191 | "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", 192 | "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==", 193 | "peer": true 194 | }, 195 | "node_modules/ai": { 196 | "version": "2.1.15", 197 | "resolved": "https://registry.npmjs.org/ai/-/ai-2.1.15.tgz", 198 | "integrity": "sha512-ePxoo9yEpHrC6n2O5b0Ko9C0dZEEXBY9FuhbrR1PVgdo4cSislTqg9TSPdVKT3mnw01A2pEg24cQ8ikRyH9m4Q==", 199 | "dependencies": { 200 | "eventsource-parser": "1.0.0", 201 | "nanoid": "^3.3.6", 202 | "sswr": "^1.10.0", 203 | "swr": "2.1.5", 204 | "swrv": "1.0.3" 205 | }, 206 | "engines": { 207 | "node": ">=14.6" 208 | }, 209 | "peerDependencies": { 210 | "react": "^18.2.0", 211 | "svelte": "^4.0.0", 212 | "vue": "^3.3.4" 213 | }, 214 | "peerDependenciesMeta": { 215 | "react": { 216 | "optional": true 217 | }, 218 | "svelte": { 219 | "optional": true 220 | }, 221 | "vue": { 222 | "optional": true 223 | } 224 | } 225 | }, 226 | "node_modules/ansi-styles": { 227 | "version": "5.2.0", 228 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", 229 | "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", 230 | "engines": { 231 | "node": ">=10" 232 | }, 233 | "funding": { 234 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 235 | } 236 | }, 237 | "node_modules/argparse": { 238 | "version": "2.0.1", 239 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", 240 | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" 241 | }, 242 | "node_modules/asynckit": { 243 | "version": "0.4.0", 244 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 245 | "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" 246 | }, 247 | "node_modules/axios": { 248 | "version": "0.26.1", 249 | "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", 250 | "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", 251 | "dependencies": { 252 | "follow-redirects": "^1.14.8" 253 | } 254 | }, 255 | "node_modules/base64-js": { 256 | "version": "1.5.1", 257 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", 258 | "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", 259 | "funding": [ 260 | { 261 | "type": "github", 262 | "url": "https://github.com/sponsors/feross" 263 | }, 264 | { 265 | "type": "patreon", 266 | "url": "https://www.patreon.com/feross" 267 | }, 268 | { 269 | "type": "consulting", 270 | "url": "https://feross.org/support" 271 | } 272 | ] 273 | }, 274 | "node_modules/binary-extensions": { 275 | "version": "2.2.0", 276 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", 277 | "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", 278 | "engines": { 279 | "node": ">=8" 280 | } 281 | }, 282 | "node_modules/binary-search": { 283 | "version": "1.3.6", 284 | "resolved": "https://registry.npmjs.org/binary-search/-/binary-search-1.3.6.tgz", 285 | "integrity": "sha512-nbE1WxOTTrUWIfsfZ4aHGYu5DOuNkbxGokjV6Z2kxfJK3uaAb8zNK1muzOeipoLHZjInT4Br88BHpzevc681xA==" 286 | }, 287 | "node_modules/camelcase": { 288 | "version": "6.3.0", 289 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", 290 | "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", 291 | "engines": { 292 | "node": ">=10" 293 | }, 294 | "funding": { 295 | "url": "https://github.com/sponsors/sindresorhus" 296 | } 297 | }, 298 | "node_modules/combined-stream": { 299 | "version": "1.0.8", 300 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 301 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 302 | "dependencies": { 303 | "delayed-stream": "~1.0.0" 304 | }, 305 | "engines": { 306 | "node": ">= 0.8" 307 | } 308 | }, 309 | "node_modules/commander": { 310 | "version": "10.0.1", 311 | "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", 312 | "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", 313 | "engines": { 314 | "node": ">=14" 315 | } 316 | }, 317 | "node_modules/cross-fetch": { 318 | "version": "3.1.8", 319 | "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", 320 | "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", 321 | "dependencies": { 322 | "node-fetch": "^2.6.12" 323 | } 324 | }, 325 | "node_modules/csstype": { 326 | "version": "3.1.2", 327 | "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", 328 | "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==", 329 | "peer": true 330 | }, 331 | "node_modules/decamelize": { 332 | "version": "1.2.0", 333 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", 334 | "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", 335 | "engines": { 336 | "node": ">=0.10.0" 337 | } 338 | }, 339 | "node_modules/delayed-stream": { 340 | "version": "1.0.0", 341 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 342 | "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", 343 | "engines": { 344 | "node": ">=0.4.0" 345 | } 346 | }, 347 | "node_modules/dotenv": { 348 | "version": "16.3.1", 349 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", 350 | "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", 351 | "engines": { 352 | "node": ">=12" 353 | }, 354 | "funding": { 355 | "url": "https://github.com/motdotla/dotenv?sponsor=1" 356 | } 357 | }, 358 | "node_modules/estree-walker": { 359 | "version": "2.0.2", 360 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", 361 | "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", 362 | "peer": true 363 | }, 364 | "node_modules/eventemitter3": { 365 | "version": "4.0.7", 366 | "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", 367 | "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" 368 | }, 369 | "node_modules/eventsource-parser": { 370 | "version": "1.0.0", 371 | "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-1.0.0.tgz", 372 | "integrity": "sha512-9jgfSCa3dmEme2ES3mPByGXfgZ87VbP97tng1G2nWwWx6bV2nYxm2AWCrbQjXToSe+yYlqaZNtxffR9IeQr95g==", 373 | "engines": { 374 | "node": ">=14.18" 375 | } 376 | }, 377 | "node_modules/expr-eval": { 378 | "version": "2.0.2", 379 | "resolved": "https://registry.npmjs.org/expr-eval/-/expr-eval-2.0.2.tgz", 380 | "integrity": "sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg==" 381 | }, 382 | "node_modules/flat": { 383 | "version": "5.0.2", 384 | "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", 385 | "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", 386 | "bin": { 387 | "flat": "cli.js" 388 | } 389 | }, 390 | "node_modules/follow-redirects": { 391 | "version": "1.15.2", 392 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", 393 | "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", 394 | "funding": [ 395 | { 396 | "type": "individual", 397 | "url": "https://github.com/sponsors/RubenVerborgh" 398 | } 399 | ], 400 | "engines": { 401 | "node": ">=4.0" 402 | }, 403 | "peerDependenciesMeta": { 404 | "debug": { 405 | "optional": true 406 | } 407 | } 408 | }, 409 | "node_modules/form-data": { 410 | "version": "4.0.0", 411 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", 412 | "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", 413 | "dependencies": { 414 | "asynckit": "^0.4.0", 415 | "combined-stream": "^1.0.8", 416 | "mime-types": "^2.1.12" 417 | }, 418 | "engines": { 419 | "node": ">= 6" 420 | } 421 | }, 422 | "node_modules/is-any-array": { 423 | "version": "2.0.1", 424 | "resolved": "https://registry.npmjs.org/is-any-array/-/is-any-array-2.0.1.tgz", 425 | "integrity": "sha512-UtilS7hLRu++wb/WBAw9bNuP1Eg04Ivn1vERJck8zJthEvXCBEBpGR/33u/xLKWEQf95803oalHrVDptcAvFdQ==" 426 | }, 427 | "node_modules/js-tiktoken": { 428 | "version": "1.0.7", 429 | "resolved": "https://registry.npmjs.org/js-tiktoken/-/js-tiktoken-1.0.7.tgz", 430 | "integrity": "sha512-biba8u/clw7iesNEWLOLwrNGoBP2lA+hTaBLs/D45pJdUPFXyxD6nhcDVtADChghv4GgyAiMKYMiRx7x6h7Biw==", 431 | "dependencies": { 432 | "base64-js": "^1.5.1" 433 | } 434 | }, 435 | "node_modules/js-tokens": { 436 | "version": "4.0.0", 437 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 438 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", 439 | "peer": true 440 | }, 441 | "node_modules/js-yaml": { 442 | "version": "4.1.0", 443 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", 444 | "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", 445 | "dependencies": { 446 | "argparse": "^2.0.1" 447 | }, 448 | "bin": { 449 | "js-yaml": "bin/js-yaml.js" 450 | } 451 | }, 452 | "node_modules/jsonpointer": { 453 | "version": "5.0.1", 454 | "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", 455 | "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", 456 | "engines": { 457 | "node": ">=0.10.0" 458 | } 459 | }, 460 | "node_modules/langchain": { 461 | "version": "0.0.102", 462 | "resolved": "https://registry.npmjs.org/langchain/-/langchain-0.0.102.tgz", 463 | "integrity": "sha512-fAZP9YI3qOruPKYa9QrRwGIg2xr9qCAIonYLh0WUb58lkEDQnY8XbSapgWy4a6er5OCfEh9z6x4EPri1+HpD0g==", 464 | "dependencies": { 465 | "@anthropic-ai/sdk": "^0.4.3", 466 | "ansi-styles": "^5.0.0", 467 | "binary-extensions": "^2.2.0", 468 | "camelcase": "6", 469 | "decamelize": "^1.2.0", 470 | "expr-eval": "^2.0.2", 471 | "flat": "^5.0.2", 472 | "js-tiktoken": "^1.0.7", 473 | "js-yaml": "^4.1.0", 474 | "jsonpointer": "^5.0.1", 475 | "langchainplus-sdk": "^0.0.15", 476 | "ml-distance": "^4.0.0", 477 | "object-hash": "^3.0.0", 478 | "openai": "^3.3.0", 479 | "openapi-types": "^12.1.3", 480 | "p-queue": "^6.6.2", 481 | "p-retry": "4", 482 | "uuid": "^9.0.0", 483 | "yaml": "^2.2.1", 484 | "zod": "^3.21.4", 485 | "zod-to-json-schema": "^3.20.4" 486 | }, 487 | "engines": { 488 | "node": ">=18" 489 | }, 490 | "peerDependencies": { 491 | "@aws-sdk/client-dynamodb": "^3.310.0", 492 | "@aws-sdk/client-lambda": "^3.310.0", 493 | "@aws-sdk/client-s3": "^3.310.0", 494 | "@aws-sdk/client-sagemaker-runtime": "^3.310.0", 495 | "@aws-sdk/client-sfn": "^3.310.0", 496 | "@clickhouse/client": "^0.0.14", 497 | "@elastic/elasticsearch": "^8.4.0", 498 | "@getmetal/metal-sdk": "*", 499 | "@getzep/zep-js": "^0.4.1", 500 | "@gomomento/sdk": "^1.23.0", 501 | "@google-cloud/storage": "^6.10.1", 502 | "@huggingface/inference": "^1.5.1", 503 | "@notionhq/client": "^2.2.5", 504 | "@opensearch-project/opensearch": "*", 505 | "@pinecone-database/pinecone": "*", 506 | "@qdrant/js-client-rest": "^1.2.0", 507 | "@supabase/postgrest-js": "^1.1.1", 508 | "@supabase/supabase-js": "^2.10.0", 509 | "@tensorflow-models/universal-sentence-encoder": "*", 510 | "@tensorflow/tfjs-converter": "*", 511 | "@tensorflow/tfjs-core": "*", 512 | "@tigrisdata/vector": "^1.1.0", 513 | "@upstash/redis": "^1.20.6", 514 | "@zilliz/milvus2-sdk-node": ">=2.2.7", 515 | "apify-client": "^2.7.1", 516 | "axios": "*", 517 | "cheerio": "^1.0.0-rc.12", 518 | "chromadb": "^1.5.2", 519 | "cohere-ai": "^5.0.2", 520 | "d3-dsv": "^2.0.0", 521 | "epub2": "^3.0.1", 522 | "faiss-node": "^0.2.1", 523 | "google-auth-library": "^8.8.0", 524 | "hnswlib-node": "^1.4.2", 525 | "html-to-text": "^9.0.5", 526 | "ignore": "^5.2.0", 527 | "mammoth": "*", 528 | "mongodb": "^5.2.0", 529 | "mysql2": "^3.3.3", 530 | "notion-to-md": "^3.1.0", 531 | "pdf-parse": "1.1.1", 532 | "peggy": "^3.0.2", 533 | "pg": "^8.11.0", 534 | "pickleparser": "^0.1.0", 535 | "playwright": "^1.32.1", 536 | "puppeteer": "^19.7.2", 537 | "redis": "^4.6.4", 538 | "replicate": "^0.9.0", 539 | "srt-parser-2": "^1.2.2", 540 | "typeorm": "^0.3.12", 541 | "typesense": "^1.5.3", 542 | "vectordb": "^0.1.4", 543 | "weaviate-ts-client": "^1.0.0" 544 | }, 545 | "peerDependenciesMeta": { 546 | "@aws-sdk/client-dynamodb": { 547 | "optional": true 548 | }, 549 | "@aws-sdk/client-lambda": { 550 | "optional": true 551 | }, 552 | "@aws-sdk/client-s3": { 553 | "optional": true 554 | }, 555 | "@aws-sdk/client-sagemaker-runtime": { 556 | "optional": true 557 | }, 558 | "@aws-sdk/client-sfn": { 559 | "optional": true 560 | }, 561 | "@clickhouse/client": { 562 | "optional": true 563 | }, 564 | "@elastic/elasticsearch": { 565 | "optional": true 566 | }, 567 | "@getmetal/metal-sdk": { 568 | "optional": true 569 | }, 570 | "@getzep/zep-js": { 571 | "optional": true 572 | }, 573 | "@gomomento/sdk": { 574 | "optional": true 575 | }, 576 | "@google-cloud/storage": { 577 | "optional": true 578 | }, 579 | "@huggingface/inference": { 580 | "optional": true 581 | }, 582 | "@notionhq/client": { 583 | "optional": true 584 | }, 585 | "@opensearch-project/opensearch": { 586 | "optional": true 587 | }, 588 | "@pinecone-database/pinecone": { 589 | "optional": true 590 | }, 591 | "@qdrant/js-client-rest": { 592 | "optional": true 593 | }, 594 | "@supabase/postgrest-js": { 595 | "optional": true 596 | }, 597 | "@supabase/supabase-js": { 598 | "optional": true 599 | }, 600 | "@tensorflow-models/universal-sentence-encoder": { 601 | "optional": true 602 | }, 603 | "@tensorflow/tfjs-converter": { 604 | "optional": true 605 | }, 606 | "@tensorflow/tfjs-core": { 607 | "optional": true 608 | }, 609 | "@tigrisdata/vector": { 610 | "optional": true 611 | }, 612 | "@upstash/redis": { 613 | "optional": true 614 | }, 615 | "@zilliz/milvus2-sdk-node": { 616 | "optional": true 617 | }, 618 | "apify-client": { 619 | "optional": true 620 | }, 621 | "axios": { 622 | "optional": true 623 | }, 624 | "cheerio": { 625 | "optional": true 626 | }, 627 | "chromadb": { 628 | "optional": true 629 | }, 630 | "cohere-ai": { 631 | "optional": true 632 | }, 633 | "d3-dsv": { 634 | "optional": true 635 | }, 636 | "epub2": { 637 | "optional": true 638 | }, 639 | "faiss-node": { 640 | "optional": true 641 | }, 642 | "google-auth-library": { 643 | "optional": true 644 | }, 645 | "hnswlib-node": { 646 | "optional": true 647 | }, 648 | "html-to-text": { 649 | "optional": true 650 | }, 651 | "ignore": { 652 | "optional": true 653 | }, 654 | "mammoth": { 655 | "optional": true 656 | }, 657 | "mongodb": { 658 | "optional": true 659 | }, 660 | "mysql2": { 661 | "optional": true 662 | }, 663 | "notion-to-md": { 664 | "optional": true 665 | }, 666 | "pdf-parse": { 667 | "optional": true 668 | }, 669 | "peggy": { 670 | "optional": true 671 | }, 672 | "pg": { 673 | "optional": true 674 | }, 675 | "pickleparser": { 676 | "optional": true 677 | }, 678 | "playwright": { 679 | "optional": true 680 | }, 681 | "puppeteer": { 682 | "optional": true 683 | }, 684 | "redis": { 685 | "optional": true 686 | }, 687 | "replicate": { 688 | "optional": true 689 | }, 690 | "srt-parser-2": { 691 | "optional": true 692 | }, 693 | "typeorm": { 694 | "optional": true 695 | }, 696 | "typesense": { 697 | "optional": true 698 | }, 699 | "vectordb": { 700 | "optional": true 701 | }, 702 | "weaviate-ts-client": { 703 | "optional": true 704 | } 705 | } 706 | }, 707 | "node_modules/langchainplus-sdk": { 708 | "version": "0.0.15", 709 | "resolved": "https://registry.npmjs.org/langchainplus-sdk/-/langchainplus-sdk-0.0.15.tgz", 710 | "integrity": "sha512-CWaTylvR2d17rErPqgLCBiAnY3UJMdV4c27itvL0CB0eurYnZspa75u3Xl4frmbMy0nhN2N94jWCnrAZX4YDjg==", 711 | "dependencies": { 712 | "@types/uuid": "^9.0.1", 713 | "commander": "^10.0.1", 714 | "p-queue": "^6.6.2", 715 | "p-retry": "4", 716 | "uuid": "^9.0.0" 717 | }, 718 | "bin": { 719 | "langchain": "dist/cli/main.cjs" 720 | } 721 | }, 722 | "node_modules/loose-envify": { 723 | "version": "1.4.0", 724 | "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", 725 | "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", 726 | "peer": true, 727 | "dependencies": { 728 | "js-tokens": "^3.0.0 || ^4.0.0" 729 | }, 730 | "bin": { 731 | "loose-envify": "cli.js" 732 | } 733 | }, 734 | "node_modules/magic-string": { 735 | "version": "0.30.1", 736 | "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.1.tgz", 737 | "integrity": "sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==", 738 | "peer": true, 739 | "dependencies": { 740 | "@jridgewell/sourcemap-codec": "^1.4.15" 741 | }, 742 | "engines": { 743 | "node": ">=12" 744 | } 745 | }, 746 | "node_modules/mime-db": { 747 | "version": "1.52.0", 748 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 749 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 750 | "engines": { 751 | "node": ">= 0.6" 752 | } 753 | }, 754 | "node_modules/mime-types": { 755 | "version": "2.1.35", 756 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 757 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 758 | "dependencies": { 759 | "mime-db": "1.52.0" 760 | }, 761 | "engines": { 762 | "node": ">= 0.6" 763 | } 764 | }, 765 | "node_modules/ml-array-mean": { 766 | "version": "1.1.6", 767 | "resolved": "https://registry.npmjs.org/ml-array-mean/-/ml-array-mean-1.1.6.tgz", 768 | "integrity": "sha512-MIdf7Zc8HznwIisyiJGRH9tRigg3Yf4FldW8DxKxpCCv/g5CafTw0RRu51nojVEOXuCQC7DRVVu5c7XXO/5joQ==", 769 | "dependencies": { 770 | "ml-array-sum": "^1.1.6" 771 | } 772 | }, 773 | "node_modules/ml-array-sum": { 774 | "version": "1.1.6", 775 | "resolved": "https://registry.npmjs.org/ml-array-sum/-/ml-array-sum-1.1.6.tgz", 776 | "integrity": "sha512-29mAh2GwH7ZmiRnup4UyibQZB9+ZLyMShvt4cH4eTK+cL2oEMIZFnSyB3SS8MlsTh6q/w/yh48KmqLxmovN4Dw==", 777 | "dependencies": { 778 | "is-any-array": "^2.0.0" 779 | } 780 | }, 781 | "node_modules/ml-distance": { 782 | "version": "4.0.1", 783 | "resolved": "https://registry.npmjs.org/ml-distance/-/ml-distance-4.0.1.tgz", 784 | "integrity": "sha512-feZ5ziXs01zhyFUUUeZV5hwc0f5JW0Sh0ckU1koZe/wdVkJdGxcP06KNQuF0WBTj8FttQUzcvQcpcrOp/XrlEw==", 785 | "dependencies": { 786 | "ml-array-mean": "^1.1.6", 787 | "ml-distance-euclidean": "^2.0.0", 788 | "ml-tree-similarity": "^1.0.0" 789 | } 790 | }, 791 | "node_modules/ml-distance-euclidean": { 792 | "version": "2.0.0", 793 | "resolved": "https://registry.npmjs.org/ml-distance-euclidean/-/ml-distance-euclidean-2.0.0.tgz", 794 | "integrity": "sha512-yC9/2o8QF0A3m/0IXqCTXCzz2pNEzvmcE/9HFKOZGnTjatvBbsn4lWYJkxENkA4Ug2fnYl7PXQxnPi21sgMy/Q==" 795 | }, 796 | "node_modules/ml-tree-similarity": { 797 | "version": "1.0.0", 798 | "resolved": "https://registry.npmjs.org/ml-tree-similarity/-/ml-tree-similarity-1.0.0.tgz", 799 | "integrity": "sha512-XJUyYqjSuUQkNQHMscr6tcjldsOoAekxADTplt40QKfwW6nd++1wHWV9AArl0Zvw/TIHgNaZZNvr8QGvE8wLRg==", 800 | "dependencies": { 801 | "binary-search": "^1.3.5", 802 | "num-sort": "^2.0.0" 803 | } 804 | }, 805 | "node_modules/nanoid": { 806 | "version": "3.3.6", 807 | "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", 808 | "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", 809 | "funding": [ 810 | { 811 | "type": "github", 812 | "url": "https://github.com/sponsors/ai" 813 | } 814 | ], 815 | "bin": { 816 | "nanoid": "bin/nanoid.cjs" 817 | }, 818 | "engines": { 819 | "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" 820 | } 821 | }, 822 | "node_modules/node-fetch": { 823 | "version": "2.6.12", 824 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", 825 | "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", 826 | "dependencies": { 827 | "whatwg-url": "^5.0.0" 828 | }, 829 | "engines": { 830 | "node": "4.x || >=6.0.0" 831 | }, 832 | "peerDependencies": { 833 | "encoding": "^0.1.0" 834 | }, 835 | "peerDependenciesMeta": { 836 | "encoding": { 837 | "optional": true 838 | } 839 | } 840 | }, 841 | "node_modules/num-sort": { 842 | "version": "2.1.0", 843 | "resolved": "https://registry.npmjs.org/num-sort/-/num-sort-2.1.0.tgz", 844 | "integrity": "sha512-1MQz1Ed8z2yckoBeSfkQHHO9K1yDRxxtotKSJ9yvcTUUxSvfvzEq5GwBrjjHEpMlq/k5gvXdmJ1SbYxWtpNoVg==", 845 | "engines": { 846 | "node": ">=8" 847 | }, 848 | "funding": { 849 | "url": "https://github.com/sponsors/sindresorhus" 850 | } 851 | }, 852 | "node_modules/object-hash": { 853 | "version": "3.0.0", 854 | "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", 855 | "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", 856 | "engines": { 857 | "node": ">= 6" 858 | } 859 | }, 860 | "node_modules/openai": { 861 | "version": "3.3.0", 862 | "resolved": "https://registry.npmjs.org/openai/-/openai-3.3.0.tgz", 863 | "integrity": "sha512-uqxI/Au+aPRnsaQRe8CojU0eCR7I0mBiKjD3sNMzY6DaC1ZVrc85u98mtJW6voDug8fgGN+DIZmTDxTthxb7dQ==", 864 | "dependencies": { 865 | "axios": "^0.26.0", 866 | "form-data": "^4.0.0" 867 | } 868 | }, 869 | "node_modules/openapi-types": { 870 | "version": "12.1.3", 871 | "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", 872 | "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==" 873 | }, 874 | "node_modules/p-finally": { 875 | "version": "1.0.0", 876 | "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", 877 | "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", 878 | "engines": { 879 | "node": ">=4" 880 | } 881 | }, 882 | "node_modules/p-queue": { 883 | "version": "6.6.2", 884 | "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz", 885 | "integrity": "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==", 886 | "dependencies": { 887 | "eventemitter3": "^4.0.4", 888 | "p-timeout": "^3.2.0" 889 | }, 890 | "engines": { 891 | "node": ">=8" 892 | }, 893 | "funding": { 894 | "url": "https://github.com/sponsors/sindresorhus" 895 | } 896 | }, 897 | "node_modules/p-retry": { 898 | "version": "4.6.2", 899 | "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", 900 | "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", 901 | "dependencies": { 902 | "@types/retry": "0.12.0", 903 | "retry": "^0.13.1" 904 | }, 905 | "engines": { 906 | "node": ">=8" 907 | } 908 | }, 909 | "node_modules/p-timeout": { 910 | "version": "3.2.0", 911 | "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", 912 | "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", 913 | "dependencies": { 914 | "p-finally": "^1.0.0" 915 | }, 916 | "engines": { 917 | "node": ">=8" 918 | } 919 | }, 920 | "node_modules/picocolors": { 921 | "version": "1.0.0", 922 | "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", 923 | "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", 924 | "peer": true 925 | }, 926 | "node_modules/postcss": { 927 | "version": "8.4.25", 928 | "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.25.tgz", 929 | "integrity": "sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==", 930 | "funding": [ 931 | { 932 | "type": "opencollective", 933 | "url": "https://opencollective.com/postcss/" 934 | }, 935 | { 936 | "type": "tidelift", 937 | "url": "https://tidelift.com/funding/github/npm/postcss" 938 | }, 939 | { 940 | "type": "github", 941 | "url": "https://github.com/sponsors/ai" 942 | } 943 | ], 944 | "peer": true, 945 | "dependencies": { 946 | "nanoid": "^3.3.6", 947 | "picocolors": "^1.0.0", 948 | "source-map-js": "^1.0.2" 949 | }, 950 | "engines": { 951 | "node": "^10 || ^12 || >=14" 952 | } 953 | }, 954 | "node_modules/react": { 955 | "version": "18.2.0", 956 | "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", 957 | "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", 958 | "peer": true, 959 | "dependencies": { 960 | "loose-envify": "^1.1.0" 961 | }, 962 | "engines": { 963 | "node": ">=0.10.0" 964 | } 965 | }, 966 | "node_modules/retry": { 967 | "version": "0.13.1", 968 | "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", 969 | "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", 970 | "engines": { 971 | "node": ">= 4" 972 | } 973 | }, 974 | "node_modules/source-map-js": { 975 | "version": "1.0.2", 976 | "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", 977 | "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", 978 | "peer": true, 979 | "engines": { 980 | "node": ">=0.10.0" 981 | } 982 | }, 983 | "node_modules/sswr": { 984 | "version": "1.10.0", 985 | "resolved": "https://registry.npmjs.org/sswr/-/sswr-1.10.0.tgz", 986 | "integrity": "sha512-nLWAJSQy3h8t7rrbTXanRyVHuQPj4PwKIVGe4IMlxJFdhyaxnN/JGACnvQKGDeWiTGYIZIx/jRuUsPEF0867Pg==", 987 | "dependencies": { 988 | "swrev": "^3.0.0" 989 | }, 990 | "peerDependencies": { 991 | "svelte": "^3.29.0" 992 | } 993 | }, 994 | "node_modules/svelte": { 995 | "version": "3.59.2", 996 | "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.59.2.tgz", 997 | "integrity": "sha512-vzSyuGr3eEoAtT/A6bmajosJZIUWySzY2CzB3w2pgPvnkUjGqlDnsNnA0PMO+mMAhuyMul6C2uuZzY6ELSkzyA==", 998 | "peer": true, 999 | "engines": { 1000 | "node": ">= 8" 1001 | } 1002 | }, 1003 | "node_modules/swr": { 1004 | "version": "2.1.5", 1005 | "resolved": "https://registry.npmjs.org/swr/-/swr-2.1.5.tgz", 1006 | "integrity": "sha512-/OhfZMcEpuz77KavXST5q6XE9nrOBOVcBLWjMT+oAE/kQHyE3PASrevXCtQDZ8aamntOfFkbVJp7Il9tNBQWrw==", 1007 | "dependencies": { 1008 | "use-sync-external-store": "^1.2.0" 1009 | }, 1010 | "peerDependencies": { 1011 | "react": "^16.11.0 || ^17.0.0 || ^18.0.0" 1012 | } 1013 | }, 1014 | "node_modules/swrev": { 1015 | "version": "3.0.0", 1016 | "resolved": "https://registry.npmjs.org/swrev/-/swrev-3.0.0.tgz", 1017 | "integrity": "sha512-QJuZiptdOmbDY45pECBRVEgnoBlOKjeT2MWVz04wKHpWX15hM3P7EjcIbHDg5yLoPCMQ7to3349MEE+l9QF5HA==" 1018 | }, 1019 | "node_modules/swrv": { 1020 | "version": "1.0.3", 1021 | "resolved": "https://registry.npmjs.org/swrv/-/swrv-1.0.3.tgz", 1022 | "integrity": "sha512-sl+eLEE+aPPjhP1E8gQ75q3RPRyw5Gd/kROnrTFo3+LkCeLskv7F+uAl5W97wgJkzitobL6FLsRPVm0DgIgN8A==", 1023 | "peerDependencies": { 1024 | "vue": ">=3.2.26 < 4" 1025 | } 1026 | }, 1027 | "node_modules/tr46": { 1028 | "version": "0.0.3", 1029 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", 1030 | "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" 1031 | }, 1032 | "node_modules/use-sync-external-store": { 1033 | "version": "1.2.0", 1034 | "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", 1035 | "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", 1036 | "peerDependencies": { 1037 | "react": "^16.8.0 || ^17.0.0 || ^18.0.0" 1038 | } 1039 | }, 1040 | "node_modules/uuid": { 1041 | "version": "9.0.0", 1042 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", 1043 | "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", 1044 | "bin": { 1045 | "uuid": "dist/bin/uuid" 1046 | } 1047 | }, 1048 | "node_modules/vue": { 1049 | "version": "3.3.4", 1050 | "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz", 1051 | "integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==", 1052 | "peer": true, 1053 | "dependencies": { 1054 | "@vue/compiler-dom": "3.3.4", 1055 | "@vue/compiler-sfc": "3.3.4", 1056 | "@vue/runtime-dom": "3.3.4", 1057 | "@vue/server-renderer": "3.3.4", 1058 | "@vue/shared": "3.3.4" 1059 | } 1060 | }, 1061 | "node_modules/webidl-conversions": { 1062 | "version": "3.0.1", 1063 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", 1064 | "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" 1065 | }, 1066 | "node_modules/whatwg-url": { 1067 | "version": "5.0.0", 1068 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", 1069 | "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", 1070 | "dependencies": { 1071 | "tr46": "~0.0.3", 1072 | "webidl-conversions": "^3.0.0" 1073 | } 1074 | }, 1075 | "node_modules/yaml": { 1076 | "version": "2.3.1", 1077 | "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", 1078 | "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", 1079 | "engines": { 1080 | "node": ">= 14" 1081 | } 1082 | }, 1083 | "node_modules/zod": { 1084 | "version": "3.21.4", 1085 | "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz", 1086 | "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==", 1087 | "funding": { 1088 | "url": "https://github.com/sponsors/colinhacks" 1089 | } 1090 | }, 1091 | "node_modules/zod-to-json-schema": { 1092 | "version": "3.21.3", 1093 | "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.21.3.tgz", 1094 | "integrity": "sha512-09W/9oyxeF1/wWnzCb6MursW+lOzgKi91QwE7eTBbC+t/qgfuLsUVDai3lHemSQnQu/UONAcT/fv3ZnDvbTeKg==", 1095 | "peerDependencies": { 1096 | "zod": "^3.21.4" 1097 | } 1098 | } 1099 | } 1100 | } 1101 | -------------------------------------------------------------------------------- /FunctionChain/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ai-function-chain", 3 | "version": "0.0.55", 4 | "description": "The FunctionChain is a tool that simplifies and organizes the process of invoking OpenAI functions in your Node.js applications. With this toolkit, you can easily scaffold out and isolate all the OpenAI function calls you need, making your code more modular, maintainable, and scalable.", 5 | "main": "index.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/developersdigest/FunctionChain" 9 | }, 10 | "keywords": [ 11 | "openai", 12 | "langchain", 13 | "functionChain", 14 | "AI", 15 | "function calling", 16 | "NLP", 17 | "natural language processing", 18 | "programming", 19 | "developer", 20 | "code execution", 21 | "automation", 22 | "artificial intelligence", 23 | "machine learning" 24 | ], 25 | "author": "Developers Digest", 26 | "license": "MIT", 27 | "type": "module", 28 | "readme": "README.md", 29 | "dependencies": { 30 | "@huggingface/inference": "^1.8.0", 31 | "@pinecone-database/pinecone": "^0.1.6", 32 | "dotenv": "^16.3.1", 33 | "langchain": "^0.0.102" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [FunctionChain: OpenAI Function Calling Simplified in Node.js](https://youtu.be/jmrFG7n3Nt8) 3 | 4 | # Quickstart 5 | 6 | This guide will walk you through the basic steps required to get the `FunctionChain` library up and running. 7 | 8 | ## Installation 9 | 10 | 1. First of all, you need to clone the repository to your local machine: 11 | 12 | ```bash 13 | git clone https://github.com/developersdigest/FunctionChain 14 | ``` 15 | 16 | 2. Move to the directory where the repository has been cloned and install the necessary dependencies using npm: 17 | 18 | ```bash 19 | cd FunctionChain 20 | npm install 21 | ``` 22 | 23 | 3. Rename the `.env.example` to `.env` at the root of your project. Obtain your OpenAI API Key from [here](https://platform.openai.com/account/api-keys), and add it to the `.env` file: 24 | 25 | ```bash 26 | OPENAI_API_KEY=your_openai_api_key 27 | ``` 28 | 29 | 4. Now you can run with the example in `index.js` by using: 30 | 31 | ```bash 32 | node index.js 33 | or 34 | npm run dev 35 | ``` 36 | 37 | ## Setup 38 | 39 | To setup `FunctionChain`, follow the steps below: 40 | 41 | 1. Create an `index.js` file in the root of your project. 42 | 2. Import the `FunctionChain` class from `ai-function-chain` and instantiate it. 43 | 3. Call the `call` method with a message. Optionally, you can specify a set of functions to execute. 44 | 45 | ```javascript 46 | import { FunctionChain, fetchCryptoPrice, openApp } from "ai-function-chain"; 47 | 48 | const functionChain = new FunctionChain({ 49 | functions: [openApp, fetchCryptoPrice], 50 | }); 51 | 52 | const res1 = await functionChain.call("Open the calculator on my computer"); 53 | const res2 = await functionChain.call("Get me the latest price of Bitcoin"); 54 | const res3 = await functionChain.call("Get me the latest price of Ethereum"); 55 | 56 | console.log(`${res1} \n${res2} \n${res3}`); 57 | ``` 58 | 59 | ## API Keys 60 | 61 | To use `FunctionChain`, you must obtain and provide the appropriate API keys. 62 | 63 | REQUIRED: for all functions: 64 | 65 | ```bash 66 | OPENAI_API_KEY=your_openai_api_key 67 | ``` 68 | 69 | You need to obtain your OpenAI API Key [here](https://platform.openai.com/account/api-keys) and add it to the `.env` file. 70 | 71 | OPTIONAL: If you intend to use specific functions, you need to obtain the respective API keys: 72 | 73 | **For Alpha Vantage functions:** 74 | 75 | ```bash 76 | ALPHA_VANTAGE_API_KEY=your_alpha_vantage_api_key 77 | ``` 78 | 79 | Get your Alpha Vantage API key [here](https://www.alphavantage.co/support/#api-key) 80 | 81 | **For Pinecone functions:** 82 | 83 | ```bash 84 | PINECONE_API_KEY=your_pinecone_api_key 85 | PINECONE_ENVIRONMENT=your_pinecone_environment 86 | PINECONE_INDEX=your_pinecone_index 87 | ``` 88 | 89 | Get your Pinecone API key [here](https://docs.pinecone.io/docs/node-client) 90 | 91 | **For Visual Crossing API functions:** 92 | 93 | ```bash 94 | VISUAL_CROSSING_API_KEY=your_visual_crossing_api_key 95 | ``` 96 | 97 | Get your Visual Crossing API key [here](https://www.visualcrossing.com/weather-api) 98 | 99 | **For Huggingface API functions:** 100 | 101 | ```bash 102 | HUGGING_FACE_API_KEY=your_hugging_face_api_key 103 | ``` 104 | 105 | You can get your Huggingface API key [here](https://huggingface.co/settings/tokens) (A read only token) 106 | 107 | 108 | ## Examples 109 | 110 | Here are some examples of how you can use FunctionChain: 111 | 112 | **Example 1: Unix Example (No additional API Key Required)** 113 | 114 | ```javascript 115 | import { FunctionChain, openApp } from "ai-function-chain"; 116 | 117 | const functionChain = new FunctionChain({functions: [openApp]}); 118 | 119 | const res = await functionChain.call("Open the calculator on my computer"); 120 | 121 | console.log(res); 122 | ``` 123 | Alternatively, you can run the following: 124 | ```bash 125 | node examples/unix-example.js 126 | ``` 127 | 128 | **Example 2: Crypto Prices (No API Key Required)** 129 | 130 | ```javascript 131 | import { FunctionChain, fetchCryptoPrice } from "ai-function-chain"; 132 | 133 | const functionChain = new FunctionChain({functions: [fetchCryptoPrice]}); 134 | 135 | const res1 = await functionChain.call("Get me the latest price of Bitcoin"); 136 | 137 | const res2 = await functionChain.call("Get me the latest price of Ethereum"); 138 | 139 | console.log(`1. ${res1} \n2. ${res2}`); 140 | ``` 141 | Alternatively, you can run the following: 142 | ```bash 143 | node examples/no-api-key-example.js 144 | ``` 145 | 146 | **Example 3: Pinecone Example (Pinecone API Key Required)** 147 | 148 | You can get your Pinecone API Key [here](https://docs.pinecone.io/docs/node-client) 149 | 150 | ```javascript 151 | import { FunctionChain, createPinecone, updatePinecone, askPinecone } from "ai-function-chain"; 152 | 153 | const functionChain = new FunctionChain({functions: [createPinecone, updatePinecone, askPinecone]}); 154 | 155 | const create = await functionChain.call("Create a pinecone index called function-chain"); 156 | const update = await functionChain.call("Add 'John Smith, his phone number is 123-456-7890 and email johnsmith@example.com' under the namespace my-contacts"); 157 | const ask = await functionChain.call("What is John Smiths number? to-do's in my my-contacts pinecone namespace?"); 158 | 159 | console.log(`1. ${create} \n2. ${update} \n3. ${ask}`); 160 | ``` 161 | Alternatively, you can run the following: 162 | ```bash 163 | node examples/pinecone-example.js 164 | ``` 165 | 166 | **Example 4: Alpha Vantage API (Free API Key Required)** 167 | 168 | You can get your Alpha Vantage API key [here](https://www.alphavantage.co/support/#api-key) 169 | 170 | ```javascript 171 | import { FunctionChain, getAlphaVantageCompanyOverview } from "ai-function-chain"; 172 | 173 | const functionChain = new FunctionChain({functions: [getAlphaVantageCompanyOverview]}); 174 | 175 | const res1 = await functionChain.call("What is Apple's market capitalization"); 176 | const res2 = await functionChain.call("What is Microsoft's PE Ratio"); 177 | const res3 = await functionChain.call("What is Amazon's Revenue (TTM)"); 178 | const res4 = await functionChain.call("What is Alphabet's EBITDA"); 179 | 180 | console.log(`1. ${res1} \n2. ${res2} \n3. ${res3} \n4. ${res4}`); 181 | ``` 182 | Alternatively, you can run the following: 183 | ```bash 184 | node examples/alpha-vantage-examples.js 185 | ``` 186 | 187 | **Example 5: Huggingface Inference (Free API Key Required)** 188 | 189 | You can get your Huggingface API key [here](https://huggingface.co/settings/tokens) (A read only token) 190 | 191 | ```javascript 192 | import { FunctionChain, huggingFaceImageClassification } from "ai-function-chain"; 193 | 194 | const functionChain = new FunctionChain({functions: [huggingFaceImageClassification]}); 195 | 196 | const res = await functionChain.call("What is this image? https://www.shutterstock.com/image-photo/yellow-lovebird-sitting-alone-on-260nw-1894954309.jpg"); 197 | console.log(res); 198 | ``` 199 | Alternatively, you can run the following: 200 | ```bash 201 | node examples/hugging-face-example.js 202 | ``` 203 | 204 | **Example 6: Visual Crossing API (API Key Required)** 205 | 206 | You can get your Visual Crossing API key [here](https://www.visualcrossing.com/weather-api) 207 | 208 | ```javascript 209 | import { FunctionChain, getVisualCrossingWeatherForecast } from "ai-function-chain"; 210 | 211 | const functionChain = new FunctionChain({functions: [getVisualCrossingWeatherForecast]}); 212 | 213 | const res = await functionChain.call("What's the weather this week in Toronto"); 214 | console.log(res); 215 | ``` 216 | Alternatively, you can run the following: 217 | ```bash 218 | node examples/weather-visual-crossing-example.js 219 | ``` 220 | 221 | ### Example 7: Using the Wikipedia API (No API Key required) 222 | 223 | This example demonstrates how you can use the `wikipedia` function from the AI Function Chain to retrieve a summary of a Wikipedia page: 224 | 225 | ```javascript 226 | import { FunctionChain, wikipedia } from "ai-function-chain"; 227 | 228 | const functionChain = new FunctionChain({ 229 | functions: [wikipedia], 230 | skipFinalAPICall: true, 231 | }); 232 | 233 | const res = await functionChain.call("In one sentence, look up on wikipedia, what is Langchain?"); 234 | console.log(res); 235 | ``` 236 | 237 | You can also run this example directly from the command line: 238 | 239 | ``` 240 | node examples/wikipedia-example.js 241 | ``` 242 | 243 | **Note:** In this example, we're using the `skipFinalAPICall: true` option. This ensures that the result is obtained directly from the `wikipedia` function, without making a final API call to OpenAI. 244 | 245 | ### Example 8: Using the Code Interpreter 246 | 247 | This example demonstrates how you can use the `codeInterpreter` function from the AI Function Chain to execute code snippets in Node.js: 248 | 249 | ```javascript 250 | import { FunctionChain, codeInterpreter } from "ai-function-chain"; 251 | 252 | const functionChain = new FunctionChain({ functions: [codeInterpreter] }); 253 | 254 | let res1 = await functionChain.call("Using node.js execute a function that will give me a random number"); 255 | console.log(res1); 256 | 257 | let res2 = await functionChain.call(` 258 | Execute this in Node.js: 259 | const fibonacci = (n) => { 260 | if (n <= 1) return n; 261 | return fibonacci(n - 1) + fibonacci(n - 2); 262 | }; 263 | fibonacci(10); 264 | `); 265 | console.log(res2); 266 | 267 | let res3 = await functionChain.call("Execute a twoSum function in node.js"); 268 | console.log(res3); 269 | ``` 270 | 271 | # Function Descriptions 272 | 273 | ## wikipedia 274 | - **Name**: wikipedia 275 | - **Description**: Search for "JavaScript" on Wikipedia. 276 | 277 | ## codeInterpreter 278 | - **Name**: codeInterpreter 279 | - **Description**: Function can execute Node.js code directly code requested within a Node.js V8 runtime written in Javascript and returns the result. Doesn't support any new require or import statements yet 280 | 281 | ## fetchCryptoPrice 282 | - **Name**: fetchCryptoPrice 283 | - **Description**: Fetches the price of a cryptocurrency from CoinGecko. 284 | 285 | ## getAlphaVantageCompanyOverview 286 | - **Name**: getAlphaVantageCompanyOverview 287 | - **Description**: Fetches company information, financial ratios, and other key metrics for the specified equity using the Alpha Vantage API. This includes the following information: Symbol, Asset Type, Name, Description, CIK, Exchange, Currency, Country, Sector, Industry, Address, Fiscal Year End, Latest Quarter, Market Capitalization, EBITDA, PE Ratio, PEG Ratio, Book Value, Dividend Per Share, Dividend Yield, EPS, Revenue Per Share (TTM), Profit Margin, Operating Margin (TTM), Return on Assets (TTM), Return on Equity (TTM), Revenue (TTM), Gross Profit (TTM), Diluted EPS (TTM), Quarterly Earnings Growth (YoY), Quarterly Revenue Growth (YoY), Analyst Target Price, Trailing PE, Forward PE, Price to Sales Ratio (TTM), Price to Book Ratio, EV to Revenue, EV to EBITDA, Beta, 52-Week High, 52-Week Low, 50-Day Moving Average, 200-Day Moving Average, Shares Outstanding, Dividend Date, Ex-Dividend Date. 288 | 289 | ## getAlphaVantageIntraday 290 | - **Name**: getAlphaVantageIntraday 291 | - **Description**: Fetches intraday data for a specified stock without extended hours. 292 | 293 | ## askPinecone 294 | - **Name**: askPinecone 295 | - **Description**: This function queries/asks a question to a Pinecone index and returns the top answer. The Pinecone client, index name, and API keys are specified in the .env file or function parameters. 296 | 297 | ## createPinecone 298 | - **Name**: createPinecone 299 | - **Description**: This function checks if a specified Pinecone index exists. If it does not exist, it will create a new one. Do not confuse this with updating an index. 300 | 301 | ## updatePinecone 302 | - **Name**: updatePinecone 303 | - **Description**: This function updates a Pinecone index with vector embeddings generated from a given text with an optional namespace if passed. The Pinecone client, index name, and API keys are specified in the .env file or function parameters. 304 | 305 | ## openApp 306 | - **Name**: openApp 307 | - **Description**: Opens a specified application on your computer 308 | 309 | ## takeScreenshot 310 | - **Name**: takeScreenshot 311 | - **Description**: Captures a screenshot from the terminal 312 | 313 | ## getVisualCrossingWeatherForecast 314 | - **Name**: getVisualCrossingWeatherForecast 315 | - **Description**: Fetches weather forecast for the specified location using the Visual Crossing API. This includes temperature, humidity, wind speed, and other important weather data. 316 | 317 | 318 | # Contribution 319 | 320 | Contributions to the `FunctionChain` library are more than welcome! If you have any helpful functions you'd like to contribute, or if there's a library you'd like to see integrated with `FunctionChain`, please feel free to reach out or submit a pull request. 321 | 322 | You can contribute in several ways: 323 | 324 | - **Submit a pull request**: If you've written any functions that you'd like to share with the community, you can submit a pull request on the GitHub repository. 325 | - **Open an issue**: If you've identified a bug or have a feature request, you can open an issue on the GitHub repository. 326 | - **Get in touch**: If you have ideas or questions, feel free to reach out directly. Your feedback and ideas are invaluable in continuing to improve `FunctionChain`. 327 | 328 | I am excited to see how you use `FunctionChain` and to hear your ideas for improvements! 329 | -------------------------------------------------------------------------------- /examples/all-examples.js: -------------------------------------------------------------------------------- 1 | // Remove the functions you don't want to use, this is a current list of all available functions (some require API keys): 2 | import { FunctionChain, createPinecone, updatePinecone, askPinecone, wikipedia, fetchCryptoPrice, getAlphaVantageCompanyOverview, getAlphaVantageIntraday, openApp, takeScreenshot, getVisualCrossingWeatherForecast, huggingFaceImageClassification } from "ai-function-chain"; 3 | const functionChain = new FunctionChain({ functions: [createPinecone, updatePinecone, askPinecone, wikipedia, fetchCryptoPrice, getAlphaVantageCompanyOverview, getAlphaVantageIntraday, openApp, takeScreenshot, getVisualCrossingWeatherForecast, huggingFaceImageClassification] }); 4 | const commands = [ 5 | "Check Wikipedia and tell me in a sentence about this new thing called Threads by Meta that everyone is talking about", 6 | "What is the latest price of Bitcoin?", 7 | "Get the current PE Ratio of Microsoft.", 8 | "What was Apple's last intraday stock price?", 9 | "Create a pinecone index called function-chain", 10 | "Update my pinecone index called function-chain in the namespace HelloWorld with: This is a demonstration of upserting to Pinecone with natural language", 11 | "What demonstrations are in my pinecone index called function-chain under the HelloWorld namespace?", 12 | "Open the Calculator App on my Computer", 13 | "Take a screenshot on my computer and save it locally", 14 | "Get the weather forecast for San Francisco Today", 15 | "Classify this image: https://shorturl.at/ciTU6", 16 | ]; 17 | 18 | for (const [commandIndex, command] of commands.entries()) { 19 | const logMessage = `${commandIndex + 1}. ${await functionChain.call(command)}`; 20 | console.log(logMessage); 21 | } -------------------------------------------------------------------------------- /examples/alpha-vantage-examples.js: -------------------------------------------------------------------------------- 1 | // Import the FunctionChain class and the functions you plan to use 2 | import { 3 | FunctionChain, 4 | getAlphaVantageCompanyOverview, 5 | getAlphaVantageIntraday, 6 | } from "ai-function-chain"; 7 | 8 | // Instantiate the FunctionChain with the functions you want to use 9 | const functionChain = new FunctionChain({ 10 | functions: [getAlphaVantageCompanyOverview, getAlphaVantageIntraday], 11 | }); 12 | 13 | // Use the FunctionChain to call your functions 14 | const res1 = await functionChain.call("What is Apple's market capitalization?"); 15 | console.log(res1); 16 | 17 | const res2 = await functionChain.call("What is Microsoft's PE Ratio?"); 18 | console.log(res2); 19 | 20 | const res3 = await functionChain.call("What is Amazon's Revenue?"); 21 | console.log(res3); 22 | 23 | const res4 = await functionChain.call("What is Google's stock price?"); 24 | console.log(res4); 25 | -------------------------------------------------------------------------------- /examples/alpha-vantage-intraday.js: -------------------------------------------------------------------------------- 1 | // Import the FunctionChain class and the function you plan to use 2 | import { FunctionChain, getAlphaVantageIntraday } from "ai-function-chain"; 3 | 4 | // Instantiate the FunctionChain with the function you want to use 5 | const functionChain = new FunctionChain({ 6 | functions: [getAlphaVantageIntraday], 7 | }); 8 | 9 | // Use the FunctionChain to call your function 10 | const res = await functionChain.call("What is Apple's stock price, tell me the date"); 11 | 12 | console.log(res); 13 | -------------------------------------------------------------------------------- /examples/hugging-face-example.js: -------------------------------------------------------------------------------- 1 | // Import the FunctionChain class and the function you plan to use 2 | import { FunctionChain, huggingFaceImageClassification } from "ai-function-chain"; 3 | 4 | // Instantiate the FunctionChain with the function you want to use 5 | const functionChain = new FunctionChain({ 6 | functions: [huggingFaceImageClassification], 7 | }); 8 | 9 | // Use the FunctionChain to call your function 10 | const res = await functionChain.call("What is this image? https://www.shutterstock.com/image-photo/yellow-lovebird-sitting-alone-on-260nw-1894954309.jpg"); 11 | 12 | console.log(res); 13 | -------------------------------------------------------------------------------- /examples/no-api-key-examples.js: -------------------------------------------------------------------------------- 1 | // Import the FunctionChain class and the function you plan to use 2 | import { FunctionChain, fetchCryptoPrice } from "ai-function-chain"; 3 | 4 | // Instantiate the FunctionChain with the function you want to use 5 | const functionChain = new FunctionChain({ 6 | functions: [fetchCryptoPrice], 7 | }); 8 | 9 | // Use the FunctionChain to call your function 10 | const res1 = await functionChain.call("Get me the latest price of Bitcoin"); 11 | const res2 = await functionChain.call("Get me the latest price of Ethereum"); 12 | 13 | console.log(`${res1} \n${res2}`); 14 | -------------------------------------------------------------------------------- /examples/nodejs-code-interpreter.js: -------------------------------------------------------------------------------- 1 | import { FunctionChain, codeInterpreter } from "ai-function-chain"; 2 | 3 | const functionChain = new FunctionChain({ functions: [codeInterpreter] }); 4 | 5 | let res1 = await functionChain.call("Using node.js execute a function that will give me a random number"); 6 | console.log(res1); 7 | 8 | let res2 = await functionChain.call(` 9 | Execute this in Node.js: 10 | const fibonacci = (n) => { 11 | if (n <= 1) return n; 12 | return fibonacci(n - 1) + fibonacci(n - 2); 13 | }; 14 | fibonacci(10); 15 | `); 16 | console.log(res2); 17 | 18 | let res3 = await functionChain.call("Execute a twoSum function in node.js"); 19 | console.log(res3); 20 | -------------------------------------------------------------------------------- /examples/pinecone-example.js: -------------------------------------------------------------------------------- 1 | // Import the FunctionChain class and the functions you plan to use 2 | import { FunctionChain, createPinecone, updatePinecone, askPinecone } from "ai-function-chain"; 3 | 4 | // Instantiate the FunctionChain with the functions you want to use 5 | const functionChain = new FunctionChain({ 6 | functions: [createPinecone, updatePinecone, askPinecone], 7 | }); 8 | 9 | // Use the FunctionChain to call your functions 10 | const create = await functionChain.call("Create a pinecone index called function-chain"); 11 | const update = await functionChain.call("In my pinecone index called function-chain, add the namespace bookshelf and add 1984 by George Orwell to it"); 12 | const ask = await functionChain.call("Check my pinecone index called function-chain in the bookshelf namespace and what books by George Orwell are in it?"); 13 | 14 | console.log(`1. ${create} \n2. ${update} \n3. ${ask}`); 15 | -------------------------------------------------------------------------------- /examples/unix-example.js: -------------------------------------------------------------------------------- 1 | // Import the FunctionChain class and the openApp function 2 | import { FunctionChain, openApp } from "ai-function-chain"; 3 | 4 | // Instantiate the FunctionChain with the openApp function 5 | const functionChain = new FunctionChain({ 6 | functions: [openApp], 7 | }); 8 | 9 | // Use the FunctionChain to call your function 10 | const res = await functionChain.call("Open the calculator on my computer"); 11 | 12 | console.log(res); 13 | -------------------------------------------------------------------------------- /examples/weather-visual-crossing-example.js: -------------------------------------------------------------------------------- 1 | // Import the FunctionChain class and the getVisualCrossingWeatherForecast function 2 | import { FunctionChain, getVisualCrossingWeatherForecast } from "ai-function-chain"; 3 | 4 | // Instantiate the FunctionChain with the getVisualCrossingWeatherForecast function 5 | const functionChain = new FunctionChain({ 6 | functions: [getVisualCrossingWeatherForecast], 7 | }); 8 | 9 | // Use the FunctionChain to call your function 10 | const res = await functionChain.call("What's the weather this week in Toronto"); 11 | 12 | console.log(res); 13 | -------------------------------------------------------------------------------- /examples/wikipedia-example.js: -------------------------------------------------------------------------------- 1 | import { FunctionChain, wikipedia } from "ai-function-chain"; 2 | 3 | const functionChain = new FunctionChain({ 4 | functions: [wikipedia], 5 | skipFinalAPICall: true, 6 | }); 7 | 8 | const res1 = await functionChain.call("In one sentence, look up on wikipedia, what is Langchain?"); 9 | console.log(res1); 10 | 11 | // console.log(`${res1} \n${res2} \n${res3}`); 12 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import { FunctionChain, fetchCryptoPrice, openApp } from "ai-function-chain"; 2 | 3 | const functionChain = new FunctionChain({ 4 | functions: [openApp, fetchCryptoPrice], 5 | }); 6 | 7 | const res1 = await functionChain.call("Open the calculator on my computer"); 8 | const res2 = await functionChain.call("Get me the latest price of Bitcoin"); 9 | const res3 = await functionChain.call("Get me the latest price of Ethereum"); 10 | 11 | console.log(`${res1} \n${res2} \n${res3}`); 12 | 13 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "functionchain", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "functionchain", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@huggingface/inference": "^1.8.0", 13 | "ai": "^2.1.15", 14 | "ai-function-chain": "^0.0.44", 15 | "dotenv": "^16.3.1" 16 | } 17 | }, 18 | "node_modules/@anthropic-ai/sdk": { 19 | "version": "0.4.4", 20 | "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.4.4.tgz", 21 | "integrity": "sha512-Z/39nQi1sSUCeLII3lsAbL1u+0JF6cR2XmUEX9sLH0VtxmIjY6cjOUYjCkYh4oapTxOkhAFnVSAFJ6cxml2qXg==", 22 | "dependencies": { 23 | "@fortaine/fetch-event-source": "^3.0.6", 24 | "cross-fetch": "^3.1.5" 25 | } 26 | }, 27 | "node_modules/@babel/parser": { 28 | "version": "7.22.7", 29 | "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.7.tgz", 30 | "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==", 31 | "peer": true, 32 | "bin": { 33 | "parser": "bin/babel-parser.js" 34 | }, 35 | "engines": { 36 | "node": ">=6.0.0" 37 | } 38 | }, 39 | "node_modules/@fortaine/fetch-event-source": { 40 | "version": "3.0.6", 41 | "resolved": "https://registry.npmjs.org/@fortaine/fetch-event-source/-/fetch-event-source-3.0.6.tgz", 42 | "integrity": "sha512-621GAuLMvKtyZQ3IA6nlDWhV1V/7PGOTNIGLUifxt0KzM+dZIweJ6F3XvQF3QnqeNfS1N7WQ0Kil1Di/lhChEw==", 43 | "engines": { 44 | "node": ">=16.15" 45 | } 46 | }, 47 | "node_modules/@huggingface/inference": { 48 | "version": "1.8.0", 49 | "resolved": "https://registry.npmjs.org/@huggingface/inference/-/inference-1.8.0.tgz", 50 | "integrity": "sha512-Dkh7PiyMf6TINRocQsdceiR5LcqJiUHgWjaBMRpCUOCbs+GZA122VH9q+wodoSptj6rIQf7wIwtDsof+/gd0WA==", 51 | "engines": { 52 | "node": ">=18" 53 | } 54 | }, 55 | "node_modules/@jridgewell/sourcemap-codec": { 56 | "version": "1.4.15", 57 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", 58 | "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", 59 | "peer": true 60 | }, 61 | "node_modules/@pinecone-database/pinecone": { 62 | "version": "0.1.6", 63 | "resolved": "https://registry.npmjs.org/@pinecone-database/pinecone/-/pinecone-0.1.6.tgz", 64 | "integrity": "sha512-tCnVc28udecthhgSBTdcMhYEW+xsR++AdZasp+ZE/AvUD1hOR2IR3edjk9m0sDxZyvXbno2KeqUbLIOZr7sCTw==", 65 | "dependencies": { 66 | "cross-fetch": "^3.1.5" 67 | }, 68 | "engines": { 69 | "node": ">=14.0.0" 70 | } 71 | }, 72 | "node_modules/@types/retry": { 73 | "version": "0.12.0", 74 | "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", 75 | "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" 76 | }, 77 | "node_modules/@types/uuid": { 78 | "version": "9.0.2", 79 | "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.2.tgz", 80 | "integrity": "sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ==" 81 | }, 82 | "node_modules/@vue/compiler-core": { 83 | "version": "3.3.4", 84 | "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", 85 | "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", 86 | "peer": true, 87 | "dependencies": { 88 | "@babel/parser": "^7.21.3", 89 | "@vue/shared": "3.3.4", 90 | "estree-walker": "^2.0.2", 91 | "source-map-js": "^1.0.2" 92 | } 93 | }, 94 | "node_modules/@vue/compiler-dom": { 95 | "version": "3.3.4", 96 | "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", 97 | "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", 98 | "peer": true, 99 | "dependencies": { 100 | "@vue/compiler-core": "3.3.4", 101 | "@vue/shared": "3.3.4" 102 | } 103 | }, 104 | "node_modules/@vue/compiler-sfc": { 105 | "version": "3.3.4", 106 | "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz", 107 | "integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==", 108 | "peer": true, 109 | "dependencies": { 110 | "@babel/parser": "^7.20.15", 111 | "@vue/compiler-core": "3.3.4", 112 | "@vue/compiler-dom": "3.3.4", 113 | "@vue/compiler-ssr": "3.3.4", 114 | "@vue/reactivity-transform": "3.3.4", 115 | "@vue/shared": "3.3.4", 116 | "estree-walker": "^2.0.2", 117 | "magic-string": "^0.30.0", 118 | "postcss": "^8.1.10", 119 | "source-map-js": "^1.0.2" 120 | } 121 | }, 122 | "node_modules/@vue/compiler-ssr": { 123 | "version": "3.3.4", 124 | "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz", 125 | "integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==", 126 | "peer": true, 127 | "dependencies": { 128 | "@vue/compiler-dom": "3.3.4", 129 | "@vue/shared": "3.3.4" 130 | } 131 | }, 132 | "node_modules/@vue/reactivity": { 133 | "version": "3.3.4", 134 | "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.4.tgz", 135 | "integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", 136 | "peer": true, 137 | "dependencies": { 138 | "@vue/shared": "3.3.4" 139 | } 140 | }, 141 | "node_modules/@vue/reactivity-transform": { 142 | "version": "3.3.4", 143 | "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz", 144 | "integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==", 145 | "peer": true, 146 | "dependencies": { 147 | "@babel/parser": "^7.20.15", 148 | "@vue/compiler-core": "3.3.4", 149 | "@vue/shared": "3.3.4", 150 | "estree-walker": "^2.0.2", 151 | "magic-string": "^0.30.0" 152 | } 153 | }, 154 | "node_modules/@vue/runtime-core": { 155 | "version": "3.3.4", 156 | "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.4.tgz", 157 | "integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==", 158 | "peer": true, 159 | "dependencies": { 160 | "@vue/reactivity": "3.3.4", 161 | "@vue/shared": "3.3.4" 162 | } 163 | }, 164 | "node_modules/@vue/runtime-dom": { 165 | "version": "3.3.4", 166 | "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz", 167 | "integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==", 168 | "peer": true, 169 | "dependencies": { 170 | "@vue/runtime-core": "3.3.4", 171 | "@vue/shared": "3.3.4", 172 | "csstype": "^3.1.1" 173 | } 174 | }, 175 | "node_modules/@vue/server-renderer": { 176 | "version": "3.3.4", 177 | "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.4.tgz", 178 | "integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==", 179 | "peer": true, 180 | "dependencies": { 181 | "@vue/compiler-ssr": "3.3.4", 182 | "@vue/shared": "3.3.4" 183 | }, 184 | "peerDependencies": { 185 | "vue": "3.3.4" 186 | } 187 | }, 188 | "node_modules/@vue/shared": { 189 | "version": "3.3.4", 190 | "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", 191 | "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==", 192 | "peer": true 193 | }, 194 | "node_modules/ai": { 195 | "version": "2.1.15", 196 | "resolved": "https://registry.npmjs.org/ai/-/ai-2.1.15.tgz", 197 | "integrity": "sha512-ePxoo9yEpHrC6n2O5b0Ko9C0dZEEXBY9FuhbrR1PVgdo4cSislTqg9TSPdVKT3mnw01A2pEg24cQ8ikRyH9m4Q==", 198 | "dependencies": { 199 | "eventsource-parser": "1.0.0", 200 | "nanoid": "^3.3.6", 201 | "sswr": "^1.10.0", 202 | "swr": "2.1.5", 203 | "swrv": "1.0.3" 204 | }, 205 | "engines": { 206 | "node": ">=14.6" 207 | }, 208 | "peerDependencies": { 209 | "react": "^18.2.0", 210 | "svelte": "^4.0.0", 211 | "vue": "^3.3.4" 212 | }, 213 | "peerDependenciesMeta": { 214 | "react": { 215 | "optional": true 216 | }, 217 | "svelte": { 218 | "optional": true 219 | }, 220 | "vue": { 221 | "optional": true 222 | } 223 | } 224 | }, 225 | "node_modules/ai-function-chain": { 226 | "version": "0.0.44", 227 | "resolved": "https://registry.npmjs.org/ai-function-chain/-/ai-function-chain-0.0.44.tgz", 228 | "integrity": "sha512-Qc+5sHvBXeVilOnqfocpZeN3H/k7dIodg5Gu/qq33nkCDYP8dFgIDzl+y8NF1LAikHMIKikX7nnfTIZbAI8E6g==", 229 | "dependencies": { 230 | "@huggingface/inference": "^1.8.0", 231 | "@pinecone-database/pinecone": "^0.1.6", 232 | "dotenv": "^16.3.1", 233 | "langchain": "^0.0.102" 234 | } 235 | }, 236 | "node_modules/ansi-styles": { 237 | "version": "5.2.0", 238 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", 239 | "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", 240 | "engines": { 241 | "node": ">=10" 242 | }, 243 | "funding": { 244 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 245 | } 246 | }, 247 | "node_modules/argparse": { 248 | "version": "2.0.1", 249 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", 250 | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" 251 | }, 252 | "node_modules/asynckit": { 253 | "version": "0.4.0", 254 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 255 | "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" 256 | }, 257 | "node_modules/axios": { 258 | "version": "0.26.1", 259 | "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", 260 | "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", 261 | "dependencies": { 262 | "follow-redirects": "^1.14.8" 263 | } 264 | }, 265 | "node_modules/base64-js": { 266 | "version": "1.5.1", 267 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", 268 | "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", 269 | "funding": [ 270 | { 271 | "type": "github", 272 | "url": "https://github.com/sponsors/feross" 273 | }, 274 | { 275 | "type": "patreon", 276 | "url": "https://www.patreon.com/feross" 277 | }, 278 | { 279 | "type": "consulting", 280 | "url": "https://feross.org/support" 281 | } 282 | ] 283 | }, 284 | "node_modules/binary-extensions": { 285 | "version": "2.2.0", 286 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", 287 | "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", 288 | "engines": { 289 | "node": ">=8" 290 | } 291 | }, 292 | "node_modules/binary-search": { 293 | "version": "1.3.6", 294 | "resolved": "https://registry.npmjs.org/binary-search/-/binary-search-1.3.6.tgz", 295 | "integrity": "sha512-nbE1WxOTTrUWIfsfZ4aHGYu5DOuNkbxGokjV6Z2kxfJK3uaAb8zNK1muzOeipoLHZjInT4Br88BHpzevc681xA==" 296 | }, 297 | "node_modules/camelcase": { 298 | "version": "6.3.0", 299 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", 300 | "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", 301 | "engines": { 302 | "node": ">=10" 303 | }, 304 | "funding": { 305 | "url": "https://github.com/sponsors/sindresorhus" 306 | } 307 | }, 308 | "node_modules/combined-stream": { 309 | "version": "1.0.8", 310 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 311 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 312 | "dependencies": { 313 | "delayed-stream": "~1.0.0" 314 | }, 315 | "engines": { 316 | "node": ">= 0.8" 317 | } 318 | }, 319 | "node_modules/commander": { 320 | "version": "10.0.1", 321 | "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", 322 | "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", 323 | "engines": { 324 | "node": ">=14" 325 | } 326 | }, 327 | "node_modules/cross-fetch": { 328 | "version": "3.1.8", 329 | "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", 330 | "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", 331 | "dependencies": { 332 | "node-fetch": "^2.6.12" 333 | } 334 | }, 335 | "node_modules/csstype": { 336 | "version": "3.1.2", 337 | "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", 338 | "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==", 339 | "peer": true 340 | }, 341 | "node_modules/decamelize": { 342 | "version": "1.2.0", 343 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", 344 | "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", 345 | "engines": { 346 | "node": ">=0.10.0" 347 | } 348 | }, 349 | "node_modules/delayed-stream": { 350 | "version": "1.0.0", 351 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 352 | "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", 353 | "engines": { 354 | "node": ">=0.4.0" 355 | } 356 | }, 357 | "node_modules/dotenv": { 358 | "version": "16.3.1", 359 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", 360 | "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", 361 | "engines": { 362 | "node": ">=12" 363 | }, 364 | "funding": { 365 | "url": "https://github.com/motdotla/dotenv?sponsor=1" 366 | } 367 | }, 368 | "node_modules/estree-walker": { 369 | "version": "2.0.2", 370 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", 371 | "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", 372 | "peer": true 373 | }, 374 | "node_modules/eventemitter3": { 375 | "version": "4.0.7", 376 | "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", 377 | "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" 378 | }, 379 | "node_modules/eventsource-parser": { 380 | "version": "1.0.0", 381 | "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-1.0.0.tgz", 382 | "integrity": "sha512-9jgfSCa3dmEme2ES3mPByGXfgZ87VbP97tng1G2nWwWx6bV2nYxm2AWCrbQjXToSe+yYlqaZNtxffR9IeQr95g==", 383 | "engines": { 384 | "node": ">=14.18" 385 | } 386 | }, 387 | "node_modules/expr-eval": { 388 | "version": "2.0.2", 389 | "resolved": "https://registry.npmjs.org/expr-eval/-/expr-eval-2.0.2.tgz", 390 | "integrity": "sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg==" 391 | }, 392 | "node_modules/flat": { 393 | "version": "5.0.2", 394 | "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", 395 | "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", 396 | "bin": { 397 | "flat": "cli.js" 398 | } 399 | }, 400 | "node_modules/follow-redirects": { 401 | "version": "1.15.2", 402 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", 403 | "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", 404 | "funding": [ 405 | { 406 | "type": "individual", 407 | "url": "https://github.com/sponsors/RubenVerborgh" 408 | } 409 | ], 410 | "engines": { 411 | "node": ">=4.0" 412 | }, 413 | "peerDependenciesMeta": { 414 | "debug": { 415 | "optional": true 416 | } 417 | } 418 | }, 419 | "node_modules/form-data": { 420 | "version": "4.0.0", 421 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", 422 | "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", 423 | "dependencies": { 424 | "asynckit": "^0.4.0", 425 | "combined-stream": "^1.0.8", 426 | "mime-types": "^2.1.12" 427 | }, 428 | "engines": { 429 | "node": ">= 6" 430 | } 431 | }, 432 | "node_modules/is-any-array": { 433 | "version": "2.0.1", 434 | "resolved": "https://registry.npmjs.org/is-any-array/-/is-any-array-2.0.1.tgz", 435 | "integrity": "sha512-UtilS7hLRu++wb/WBAw9bNuP1Eg04Ivn1vERJck8zJthEvXCBEBpGR/33u/xLKWEQf95803oalHrVDptcAvFdQ==" 436 | }, 437 | "node_modules/js-tiktoken": { 438 | "version": "1.0.7", 439 | "resolved": "https://registry.npmjs.org/js-tiktoken/-/js-tiktoken-1.0.7.tgz", 440 | "integrity": "sha512-biba8u/clw7iesNEWLOLwrNGoBP2lA+hTaBLs/D45pJdUPFXyxD6nhcDVtADChghv4GgyAiMKYMiRx7x6h7Biw==", 441 | "dependencies": { 442 | "base64-js": "^1.5.1" 443 | } 444 | }, 445 | "node_modules/js-tokens": { 446 | "version": "4.0.0", 447 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 448 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", 449 | "peer": true 450 | }, 451 | "node_modules/js-yaml": { 452 | "version": "4.1.0", 453 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", 454 | "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", 455 | "dependencies": { 456 | "argparse": "^2.0.1" 457 | }, 458 | "bin": { 459 | "js-yaml": "bin/js-yaml.js" 460 | } 461 | }, 462 | "node_modules/jsonpointer": { 463 | "version": "5.0.1", 464 | "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", 465 | "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", 466 | "engines": { 467 | "node": ">=0.10.0" 468 | } 469 | }, 470 | "node_modules/langchain": { 471 | "version": "0.0.102", 472 | "resolved": "https://registry.npmjs.org/langchain/-/langchain-0.0.102.tgz", 473 | "integrity": "sha512-fAZP9YI3qOruPKYa9QrRwGIg2xr9qCAIonYLh0WUb58lkEDQnY8XbSapgWy4a6er5OCfEh9z6x4EPri1+HpD0g==", 474 | "dependencies": { 475 | "@anthropic-ai/sdk": "^0.4.3", 476 | "ansi-styles": "^5.0.0", 477 | "binary-extensions": "^2.2.0", 478 | "camelcase": "6", 479 | "decamelize": "^1.2.0", 480 | "expr-eval": "^2.0.2", 481 | "flat": "^5.0.2", 482 | "js-tiktoken": "^1.0.7", 483 | "js-yaml": "^4.1.0", 484 | "jsonpointer": "^5.0.1", 485 | "langchainplus-sdk": "^0.0.15", 486 | "ml-distance": "^4.0.0", 487 | "object-hash": "^3.0.0", 488 | "openai": "^3.3.0", 489 | "openapi-types": "^12.1.3", 490 | "p-queue": "^6.6.2", 491 | "p-retry": "4", 492 | "uuid": "^9.0.0", 493 | "yaml": "^2.2.1", 494 | "zod": "^3.21.4", 495 | "zod-to-json-schema": "^3.20.4" 496 | }, 497 | "engines": { 498 | "node": ">=18" 499 | }, 500 | "peerDependencies": { 501 | "@aws-sdk/client-dynamodb": "^3.310.0", 502 | "@aws-sdk/client-lambda": "^3.310.0", 503 | "@aws-sdk/client-s3": "^3.310.0", 504 | "@aws-sdk/client-sagemaker-runtime": "^3.310.0", 505 | "@aws-sdk/client-sfn": "^3.310.0", 506 | "@clickhouse/client": "^0.0.14", 507 | "@elastic/elasticsearch": "^8.4.0", 508 | "@getmetal/metal-sdk": "*", 509 | "@getzep/zep-js": "^0.4.1", 510 | "@gomomento/sdk": "^1.23.0", 511 | "@google-cloud/storage": "^6.10.1", 512 | "@huggingface/inference": "^1.5.1", 513 | "@notionhq/client": "^2.2.5", 514 | "@opensearch-project/opensearch": "*", 515 | "@pinecone-database/pinecone": "*", 516 | "@qdrant/js-client-rest": "^1.2.0", 517 | "@supabase/postgrest-js": "^1.1.1", 518 | "@supabase/supabase-js": "^2.10.0", 519 | "@tensorflow-models/universal-sentence-encoder": "*", 520 | "@tensorflow/tfjs-converter": "*", 521 | "@tensorflow/tfjs-core": "*", 522 | "@tigrisdata/vector": "^1.1.0", 523 | "@upstash/redis": "^1.20.6", 524 | "@zilliz/milvus2-sdk-node": ">=2.2.7", 525 | "apify-client": "^2.7.1", 526 | "axios": "*", 527 | "cheerio": "^1.0.0-rc.12", 528 | "chromadb": "^1.5.2", 529 | "cohere-ai": "^5.0.2", 530 | "d3-dsv": "^2.0.0", 531 | "epub2": "^3.0.1", 532 | "faiss-node": "^0.2.1", 533 | "google-auth-library": "^8.8.0", 534 | "hnswlib-node": "^1.4.2", 535 | "html-to-text": "^9.0.5", 536 | "ignore": "^5.2.0", 537 | "mammoth": "*", 538 | "mongodb": "^5.2.0", 539 | "mysql2": "^3.3.3", 540 | "notion-to-md": "^3.1.0", 541 | "pdf-parse": "1.1.1", 542 | "peggy": "^3.0.2", 543 | "pg": "^8.11.0", 544 | "pickleparser": "^0.1.0", 545 | "playwright": "^1.32.1", 546 | "puppeteer": "^19.7.2", 547 | "redis": "^4.6.4", 548 | "replicate": "^0.9.0", 549 | "srt-parser-2": "^1.2.2", 550 | "typeorm": "^0.3.12", 551 | "typesense": "^1.5.3", 552 | "vectordb": "^0.1.4", 553 | "weaviate-ts-client": "^1.0.0" 554 | }, 555 | "peerDependenciesMeta": { 556 | "@aws-sdk/client-dynamodb": { 557 | "optional": true 558 | }, 559 | "@aws-sdk/client-lambda": { 560 | "optional": true 561 | }, 562 | "@aws-sdk/client-s3": { 563 | "optional": true 564 | }, 565 | "@aws-sdk/client-sagemaker-runtime": { 566 | "optional": true 567 | }, 568 | "@aws-sdk/client-sfn": { 569 | "optional": true 570 | }, 571 | "@clickhouse/client": { 572 | "optional": true 573 | }, 574 | "@elastic/elasticsearch": { 575 | "optional": true 576 | }, 577 | "@getmetal/metal-sdk": { 578 | "optional": true 579 | }, 580 | "@getzep/zep-js": { 581 | "optional": true 582 | }, 583 | "@gomomento/sdk": { 584 | "optional": true 585 | }, 586 | "@google-cloud/storage": { 587 | "optional": true 588 | }, 589 | "@huggingface/inference": { 590 | "optional": true 591 | }, 592 | "@notionhq/client": { 593 | "optional": true 594 | }, 595 | "@opensearch-project/opensearch": { 596 | "optional": true 597 | }, 598 | "@pinecone-database/pinecone": { 599 | "optional": true 600 | }, 601 | "@qdrant/js-client-rest": { 602 | "optional": true 603 | }, 604 | "@supabase/postgrest-js": { 605 | "optional": true 606 | }, 607 | "@supabase/supabase-js": { 608 | "optional": true 609 | }, 610 | "@tensorflow-models/universal-sentence-encoder": { 611 | "optional": true 612 | }, 613 | "@tensorflow/tfjs-converter": { 614 | "optional": true 615 | }, 616 | "@tensorflow/tfjs-core": { 617 | "optional": true 618 | }, 619 | "@tigrisdata/vector": { 620 | "optional": true 621 | }, 622 | "@upstash/redis": { 623 | "optional": true 624 | }, 625 | "@zilliz/milvus2-sdk-node": { 626 | "optional": true 627 | }, 628 | "apify-client": { 629 | "optional": true 630 | }, 631 | "axios": { 632 | "optional": true 633 | }, 634 | "cheerio": { 635 | "optional": true 636 | }, 637 | "chromadb": { 638 | "optional": true 639 | }, 640 | "cohere-ai": { 641 | "optional": true 642 | }, 643 | "d3-dsv": { 644 | "optional": true 645 | }, 646 | "epub2": { 647 | "optional": true 648 | }, 649 | "faiss-node": { 650 | "optional": true 651 | }, 652 | "google-auth-library": { 653 | "optional": true 654 | }, 655 | "hnswlib-node": { 656 | "optional": true 657 | }, 658 | "html-to-text": { 659 | "optional": true 660 | }, 661 | "ignore": { 662 | "optional": true 663 | }, 664 | "mammoth": { 665 | "optional": true 666 | }, 667 | "mongodb": { 668 | "optional": true 669 | }, 670 | "mysql2": { 671 | "optional": true 672 | }, 673 | "notion-to-md": { 674 | "optional": true 675 | }, 676 | "pdf-parse": { 677 | "optional": true 678 | }, 679 | "peggy": { 680 | "optional": true 681 | }, 682 | "pg": { 683 | "optional": true 684 | }, 685 | "pickleparser": { 686 | "optional": true 687 | }, 688 | "playwright": { 689 | "optional": true 690 | }, 691 | "puppeteer": { 692 | "optional": true 693 | }, 694 | "redis": { 695 | "optional": true 696 | }, 697 | "replicate": { 698 | "optional": true 699 | }, 700 | "srt-parser-2": { 701 | "optional": true 702 | }, 703 | "typeorm": { 704 | "optional": true 705 | }, 706 | "typesense": { 707 | "optional": true 708 | }, 709 | "vectordb": { 710 | "optional": true 711 | }, 712 | "weaviate-ts-client": { 713 | "optional": true 714 | } 715 | } 716 | }, 717 | "node_modules/langchainplus-sdk": { 718 | "version": "0.0.15", 719 | "resolved": "https://registry.npmjs.org/langchainplus-sdk/-/langchainplus-sdk-0.0.15.tgz", 720 | "integrity": "sha512-CWaTylvR2d17rErPqgLCBiAnY3UJMdV4c27itvL0CB0eurYnZspa75u3Xl4frmbMy0nhN2N94jWCnrAZX4YDjg==", 721 | "dependencies": { 722 | "@types/uuid": "^9.0.1", 723 | "commander": "^10.0.1", 724 | "p-queue": "^6.6.2", 725 | "p-retry": "4", 726 | "uuid": "^9.0.0" 727 | }, 728 | "bin": { 729 | "langchain": "dist/cli/main.cjs" 730 | } 731 | }, 732 | "node_modules/loose-envify": { 733 | "version": "1.4.0", 734 | "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", 735 | "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", 736 | "peer": true, 737 | "dependencies": { 738 | "js-tokens": "^3.0.0 || ^4.0.0" 739 | }, 740 | "bin": { 741 | "loose-envify": "cli.js" 742 | } 743 | }, 744 | "node_modules/magic-string": { 745 | "version": "0.30.1", 746 | "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.1.tgz", 747 | "integrity": "sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==", 748 | "peer": true, 749 | "dependencies": { 750 | "@jridgewell/sourcemap-codec": "^1.4.15" 751 | }, 752 | "engines": { 753 | "node": ">=12" 754 | } 755 | }, 756 | "node_modules/mime-db": { 757 | "version": "1.52.0", 758 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 759 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 760 | "engines": { 761 | "node": ">= 0.6" 762 | } 763 | }, 764 | "node_modules/mime-types": { 765 | "version": "2.1.35", 766 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 767 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 768 | "dependencies": { 769 | "mime-db": "1.52.0" 770 | }, 771 | "engines": { 772 | "node": ">= 0.6" 773 | } 774 | }, 775 | "node_modules/ml-array-mean": { 776 | "version": "1.1.6", 777 | "resolved": "https://registry.npmjs.org/ml-array-mean/-/ml-array-mean-1.1.6.tgz", 778 | "integrity": "sha512-MIdf7Zc8HznwIisyiJGRH9tRigg3Yf4FldW8DxKxpCCv/g5CafTw0RRu51nojVEOXuCQC7DRVVu5c7XXO/5joQ==", 779 | "dependencies": { 780 | "ml-array-sum": "^1.1.6" 781 | } 782 | }, 783 | "node_modules/ml-array-sum": { 784 | "version": "1.1.6", 785 | "resolved": "https://registry.npmjs.org/ml-array-sum/-/ml-array-sum-1.1.6.tgz", 786 | "integrity": "sha512-29mAh2GwH7ZmiRnup4UyibQZB9+ZLyMShvt4cH4eTK+cL2oEMIZFnSyB3SS8MlsTh6q/w/yh48KmqLxmovN4Dw==", 787 | "dependencies": { 788 | "is-any-array": "^2.0.0" 789 | } 790 | }, 791 | "node_modules/ml-distance": { 792 | "version": "4.0.1", 793 | "resolved": "https://registry.npmjs.org/ml-distance/-/ml-distance-4.0.1.tgz", 794 | "integrity": "sha512-feZ5ziXs01zhyFUUUeZV5hwc0f5JW0Sh0ckU1koZe/wdVkJdGxcP06KNQuF0WBTj8FttQUzcvQcpcrOp/XrlEw==", 795 | "dependencies": { 796 | "ml-array-mean": "^1.1.6", 797 | "ml-distance-euclidean": "^2.0.0", 798 | "ml-tree-similarity": "^1.0.0" 799 | } 800 | }, 801 | "node_modules/ml-distance-euclidean": { 802 | "version": "2.0.0", 803 | "resolved": "https://registry.npmjs.org/ml-distance-euclidean/-/ml-distance-euclidean-2.0.0.tgz", 804 | "integrity": "sha512-yC9/2o8QF0A3m/0IXqCTXCzz2pNEzvmcE/9HFKOZGnTjatvBbsn4lWYJkxENkA4Ug2fnYl7PXQxnPi21sgMy/Q==" 805 | }, 806 | "node_modules/ml-tree-similarity": { 807 | "version": "1.0.0", 808 | "resolved": "https://registry.npmjs.org/ml-tree-similarity/-/ml-tree-similarity-1.0.0.tgz", 809 | "integrity": "sha512-XJUyYqjSuUQkNQHMscr6tcjldsOoAekxADTplt40QKfwW6nd++1wHWV9AArl0Zvw/TIHgNaZZNvr8QGvE8wLRg==", 810 | "dependencies": { 811 | "binary-search": "^1.3.5", 812 | "num-sort": "^2.0.0" 813 | } 814 | }, 815 | "node_modules/nanoid": { 816 | "version": "3.3.6", 817 | "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", 818 | "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", 819 | "funding": [ 820 | { 821 | "type": "github", 822 | "url": "https://github.com/sponsors/ai" 823 | } 824 | ], 825 | "bin": { 826 | "nanoid": "bin/nanoid.cjs" 827 | }, 828 | "engines": { 829 | "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" 830 | } 831 | }, 832 | "node_modules/node-fetch": { 833 | "version": "2.6.12", 834 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", 835 | "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", 836 | "dependencies": { 837 | "whatwg-url": "^5.0.0" 838 | }, 839 | "engines": { 840 | "node": "4.x || >=6.0.0" 841 | }, 842 | "peerDependencies": { 843 | "encoding": "^0.1.0" 844 | }, 845 | "peerDependenciesMeta": { 846 | "encoding": { 847 | "optional": true 848 | } 849 | } 850 | }, 851 | "node_modules/num-sort": { 852 | "version": "2.1.0", 853 | "resolved": "https://registry.npmjs.org/num-sort/-/num-sort-2.1.0.tgz", 854 | "integrity": "sha512-1MQz1Ed8z2yckoBeSfkQHHO9K1yDRxxtotKSJ9yvcTUUxSvfvzEq5GwBrjjHEpMlq/k5gvXdmJ1SbYxWtpNoVg==", 855 | "engines": { 856 | "node": ">=8" 857 | }, 858 | "funding": { 859 | "url": "https://github.com/sponsors/sindresorhus" 860 | } 861 | }, 862 | "node_modules/object-hash": { 863 | "version": "3.0.0", 864 | "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", 865 | "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", 866 | "engines": { 867 | "node": ">= 6" 868 | } 869 | }, 870 | "node_modules/openai": { 871 | "version": "3.3.0", 872 | "resolved": "https://registry.npmjs.org/openai/-/openai-3.3.0.tgz", 873 | "integrity": "sha512-uqxI/Au+aPRnsaQRe8CojU0eCR7I0mBiKjD3sNMzY6DaC1ZVrc85u98mtJW6voDug8fgGN+DIZmTDxTthxb7dQ==", 874 | "dependencies": { 875 | "axios": "^0.26.0", 876 | "form-data": "^4.0.0" 877 | } 878 | }, 879 | "node_modules/openapi-types": { 880 | "version": "12.1.3", 881 | "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", 882 | "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==" 883 | }, 884 | "node_modules/p-finally": { 885 | "version": "1.0.0", 886 | "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", 887 | "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", 888 | "engines": { 889 | "node": ">=4" 890 | } 891 | }, 892 | "node_modules/p-queue": { 893 | "version": "6.6.2", 894 | "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz", 895 | "integrity": "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==", 896 | "dependencies": { 897 | "eventemitter3": "^4.0.4", 898 | "p-timeout": "^3.2.0" 899 | }, 900 | "engines": { 901 | "node": ">=8" 902 | }, 903 | "funding": { 904 | "url": "https://github.com/sponsors/sindresorhus" 905 | } 906 | }, 907 | "node_modules/p-retry": { 908 | "version": "4.6.2", 909 | "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", 910 | "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", 911 | "dependencies": { 912 | "@types/retry": "0.12.0", 913 | "retry": "^0.13.1" 914 | }, 915 | "engines": { 916 | "node": ">=8" 917 | } 918 | }, 919 | "node_modules/p-timeout": { 920 | "version": "3.2.0", 921 | "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", 922 | "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", 923 | "dependencies": { 924 | "p-finally": "^1.0.0" 925 | }, 926 | "engines": { 927 | "node": ">=8" 928 | } 929 | }, 930 | "node_modules/picocolors": { 931 | "version": "1.0.0", 932 | "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", 933 | "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", 934 | "peer": true 935 | }, 936 | "node_modules/postcss": { 937 | "version": "8.4.25", 938 | "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.25.tgz", 939 | "integrity": "sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==", 940 | "funding": [ 941 | { 942 | "type": "opencollective", 943 | "url": "https://opencollective.com/postcss/" 944 | }, 945 | { 946 | "type": "tidelift", 947 | "url": "https://tidelift.com/funding/github/npm/postcss" 948 | }, 949 | { 950 | "type": "github", 951 | "url": "https://github.com/sponsors/ai" 952 | } 953 | ], 954 | "peer": true, 955 | "dependencies": { 956 | "nanoid": "^3.3.6", 957 | "picocolors": "^1.0.0", 958 | "source-map-js": "^1.0.2" 959 | }, 960 | "engines": { 961 | "node": "^10 || ^12 || >=14" 962 | } 963 | }, 964 | "node_modules/react": { 965 | "version": "18.2.0", 966 | "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", 967 | "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", 968 | "peer": true, 969 | "dependencies": { 970 | "loose-envify": "^1.1.0" 971 | }, 972 | "engines": { 973 | "node": ">=0.10.0" 974 | } 975 | }, 976 | "node_modules/retry": { 977 | "version": "0.13.1", 978 | "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", 979 | "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", 980 | "engines": { 981 | "node": ">= 4" 982 | } 983 | }, 984 | "node_modules/source-map-js": { 985 | "version": "1.0.2", 986 | "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", 987 | "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", 988 | "peer": true, 989 | "engines": { 990 | "node": ">=0.10.0" 991 | } 992 | }, 993 | "node_modules/sswr": { 994 | "version": "1.10.0", 995 | "resolved": "https://registry.npmjs.org/sswr/-/sswr-1.10.0.tgz", 996 | "integrity": "sha512-nLWAJSQy3h8t7rrbTXanRyVHuQPj4PwKIVGe4IMlxJFdhyaxnN/JGACnvQKGDeWiTGYIZIx/jRuUsPEF0867Pg==", 997 | "dependencies": { 998 | "swrev": "^3.0.0" 999 | }, 1000 | "peerDependencies": { 1001 | "svelte": "^3.29.0" 1002 | } 1003 | }, 1004 | "node_modules/svelte": { 1005 | "version": "3.59.2", 1006 | "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.59.2.tgz", 1007 | "integrity": "sha512-vzSyuGr3eEoAtT/A6bmajosJZIUWySzY2CzB3w2pgPvnkUjGqlDnsNnA0PMO+mMAhuyMul6C2uuZzY6ELSkzyA==", 1008 | "peer": true, 1009 | "engines": { 1010 | "node": ">= 8" 1011 | } 1012 | }, 1013 | "node_modules/swr": { 1014 | "version": "2.1.5", 1015 | "resolved": "https://registry.npmjs.org/swr/-/swr-2.1.5.tgz", 1016 | "integrity": "sha512-/OhfZMcEpuz77KavXST5q6XE9nrOBOVcBLWjMT+oAE/kQHyE3PASrevXCtQDZ8aamntOfFkbVJp7Il9tNBQWrw==", 1017 | "dependencies": { 1018 | "use-sync-external-store": "^1.2.0" 1019 | }, 1020 | "peerDependencies": { 1021 | "react": "^16.11.0 || ^17.0.0 || ^18.0.0" 1022 | } 1023 | }, 1024 | "node_modules/swrev": { 1025 | "version": "3.0.0", 1026 | "resolved": "https://registry.npmjs.org/swrev/-/swrev-3.0.0.tgz", 1027 | "integrity": "sha512-QJuZiptdOmbDY45pECBRVEgnoBlOKjeT2MWVz04wKHpWX15hM3P7EjcIbHDg5yLoPCMQ7to3349MEE+l9QF5HA==" 1028 | }, 1029 | "node_modules/swrv": { 1030 | "version": "1.0.3", 1031 | "resolved": "https://registry.npmjs.org/swrv/-/swrv-1.0.3.tgz", 1032 | "integrity": "sha512-sl+eLEE+aPPjhP1E8gQ75q3RPRyw5Gd/kROnrTFo3+LkCeLskv7F+uAl5W97wgJkzitobL6FLsRPVm0DgIgN8A==", 1033 | "peerDependencies": { 1034 | "vue": ">=3.2.26 < 4" 1035 | } 1036 | }, 1037 | "node_modules/tr46": { 1038 | "version": "0.0.3", 1039 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", 1040 | "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" 1041 | }, 1042 | "node_modules/use-sync-external-store": { 1043 | "version": "1.2.0", 1044 | "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", 1045 | "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", 1046 | "peerDependencies": { 1047 | "react": "^16.8.0 || ^17.0.0 || ^18.0.0" 1048 | } 1049 | }, 1050 | "node_modules/uuid": { 1051 | "version": "9.0.0", 1052 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", 1053 | "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", 1054 | "bin": { 1055 | "uuid": "dist/bin/uuid" 1056 | } 1057 | }, 1058 | "node_modules/vue": { 1059 | "version": "3.3.4", 1060 | "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz", 1061 | "integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==", 1062 | "peer": true, 1063 | "dependencies": { 1064 | "@vue/compiler-dom": "3.3.4", 1065 | "@vue/compiler-sfc": "3.3.4", 1066 | "@vue/runtime-dom": "3.3.4", 1067 | "@vue/server-renderer": "3.3.4", 1068 | "@vue/shared": "3.3.4" 1069 | } 1070 | }, 1071 | "node_modules/webidl-conversions": { 1072 | "version": "3.0.1", 1073 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", 1074 | "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" 1075 | }, 1076 | "node_modules/whatwg-url": { 1077 | "version": "5.0.0", 1078 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", 1079 | "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", 1080 | "dependencies": { 1081 | "tr46": "~0.0.3", 1082 | "webidl-conversions": "^3.0.0" 1083 | } 1084 | }, 1085 | "node_modules/yaml": { 1086 | "version": "2.3.1", 1087 | "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", 1088 | "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", 1089 | "engines": { 1090 | "node": ">= 14" 1091 | } 1092 | }, 1093 | "node_modules/zod": { 1094 | "version": "3.21.4", 1095 | "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz", 1096 | "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==", 1097 | "funding": { 1098 | "url": "https://github.com/sponsors/colinhacks" 1099 | } 1100 | }, 1101 | "node_modules/zod-to-json-schema": { 1102 | "version": "3.21.3", 1103 | "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.21.3.tgz", 1104 | "integrity": "sha512-09W/9oyxeF1/wWnzCb6MursW+lOzgKi91QwE7eTBbC+t/qgfuLsUVDai3lHemSQnQu/UONAcT/fv3ZnDvbTeKg==", 1105 | "peerDependencies": { 1106 | "zod": "^3.21.4" 1107 | } 1108 | } 1109 | } 1110 | } 1111 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "functionchain", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "dev": "node index" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@huggingface/inference": "^1.8.0", 14 | "ai": "^2.1.15", 15 | "ai-function-chain": "^0.0.44", 16 | "dotenv": "^16.3.1" 17 | }, 18 | "type": "module" 19 | } 20 | --------------------------------------------------------------------------------