This is the TypeScript implementation of Acorn Agent which provides the libraries you need to implement an AI agent.
Install package
npm i @datasqrl/acorn-node
You can use both require
and import
syntax
const { createToolsFromApiUri } = require("@datasqrl/acorn-node");
// or
import { createToolsFromApiUri } from "@datasqrl/acorn-node";
To create a converter follow the example below
import { convertSchema } from "@datasqrl/acorn-node";
// load your graphQL schema from somewhere
const graphQlSchemaString = "...";
// You need to implement `APIQueryExecutor` interface to query and validate APIQuery
// Or use existing `FetchApiQueryExecutor` provided by package
const apiExecutor = new MyApiQueryExecutor();
// your functions are here
const functions = convertSchema(graphQlSchemaString, apiExecutor);