Skip to main content

api2ai

Documentation / agents/api2ai

Generate​

convertOpenAPIToAgentTools()​

function convertOpenAPIToAgentTools(fileContents: string): any[];

Defined in: agents/api2ai.js:21

API2AI​

Translates any website's OpenAPI.yml file to LLM agent tool LangChain.js function format

List of public apis publicapis

Parameters​

ParameterTypeDescription

fileContents

string

OpenAPI YAML file contents

Returns​

any[]

Array of tool use function objects

Example​

const fileContents = fs.readFileSync(yamlPath, 'utf8');
const tools = convertOpenAPIToAgentTools(fileContents);