![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
function-agents
Advanced tools
A collection of Function Agents with specific purposes, utilizing the OpenAI API.
function-agents
is a collection of Function Agents with specific purposes, designed to simplify various tasks. To use these agents, you'll need to pass an OpenAI API Key upon construction. This package allows you to interact with different OpenAI agents, transforming unstructured text into a structured JSON response.
To install the package, run the following command:
npm install function-agents
Import the package and initialize it as follows:
import { OpenAIDataTransformationAgent } from 'function-agents';
This agent is responsible for transforming unstructured text into a structured JSON response using OpenAI's API.
import OpenAIApi from 'openai';
import { OpenAIDataTransformationAgent } from 'function-agents';
// Your function definition and system message here.
const functionDefinition = {
// ...
};
const systemMessage = 'Your system message here';
const agent = new OpenAIDataTransformationAgent(
'your-openai-api-key',
'model-name',
functionDefinition,
systemMessage
);
const response = await agent.transformer('your unstructured text');
openai_api_key
: Your OpenAI API Key.model
: The name of the OpenAI model.functionDefinition
: The function definition in JSON format.systemMessage
: The system message in string format.The transformer
function for OpenAIDataTransformationAgent returns a Promise of type FunctionAgentResponse
.
type FunctionAgentResponse = {
response: any;
success: boolean;
error?: unknown;
};
We welcome contributions! Please feel free to submit a pull request.
This package is under the MIT License. See LICENSE
file for more details.
FAQs
A collection of Function Agents with specific purposes, utilizing the OpenAI API.
The npm package function-agents receives a total of 2 weekly downloads. As such, function-agents popularity was classified as not popular.
We found that function-agents demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.