
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
@workflowai/workflowai
Advanced tools
WorkflowAI is a low-code tool for product managers and software engineers that makes it easier to ship features powered by AI.
// Initialize WorkflowAI Client
import { WorkflowAI } from '@workflowai/workflowai';
const workflowAI = new WorkflowAI({
// optional, defaults to process.env.WORKFLOWAI_API_KEY
// key: // Add your API key here
});
// Initialize Your AI agent
export interface GetCapitalInfoInput {
city: string;
}
export interface GetCapitalInfoOutput {
country: string;
capital: string;
fun_fact: string;
}
const getCapitalInfo = workflowAI.agent<
GetCapitalInfoInput,
GetCapitalInfoOutput
>({
id: 'get-capital-info',
schemaId: 1,
version: '1.4',
// Cache options:
// - "auto" (default): if a previous run exists with the same version and input, and if
// the temperature is 0, the cached output is returned
// - "always": the cached output is returned when available, regardless
// of the temperature value
// - "never": the cache is never used
useCache: 'auto',
});
// Run Your AI agent
async function getCapitalInfoRun() {
const input: GetCapitalInfoInput = {
city: 'Wellington',
};
try {
const {
output,
data: { duration_seconds, cost_usd, version },
} = await getCapitalInfo(input);
console.log(output);
console.log('\nModel: ', version?.properties?.model);
console.log('Cost: $', cost_usd);
console.log('Latency: ', duration_seconds?.toFixed(2), 's');
} catch (error) {
console.error('Failed to run :', error);
}
}
FAQs
WorkflowAI JS SDK
The npm package @workflowai/workflowai receives a total of 1,103 weekly downloads. As such, @workflowai/workflowai popularity was classified as popular.
We found that @workflowai/workflowai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.