api2ai
ai-research-agent / agents/api2ai
Generate
convertOpenAPIToAgentTools()
function convertOpenAPIToAgentTools(fileContents): any[]
API2AI
Translates any website's OpenAPI.yml file to LLM agent tool LangChain.js function format
List of public apis publicapis
Parameters
Parameter | Type | Description |
---|---|---|
|
| OpenAPI YAML file contents |
Returns
any
[]
Array of tool use function objects
Example
const fileContents = fs.readFileSync(yamlPath, 'utf8');
const tools = convertOpenAPIToAgentTools(fileContents);