
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@handit.ai/ai-wrapper
Advanced tools
π€ Intelligent AI execution system with built-in tracking, evaluation, and self-improvement capabilities. The complete AI intelligence platform for enterprise applications.
Intelligent AI Execution System with Built-in Tracking & Self-Improvement
This isn't just a wrapper - it's a complete AI intelligence platform that learns, improves, and provides valuable insights for enterprise applications.
π Documentation β’ π Quick Start β’ π§ Examples β’ π Issues β’ π¬ Discussions
npm install @handit.ai/ai-wrapper
# Install peer dependencies
npm install @handit.ai/node openai @google/generative-ai @anthropic-ai/sdk axios
const { AIWrapper } = require('@handit.ai/ai-wrapper');
// Initialize the intelligent AI system
const aiWrapper = new AIWrapper({
handitApiKey: 'your-handit-api-key',
openaiApiKey: 'your-openai-api-key',
googleApiKey: 'your-google-api-key',
anthropicApiKey: 'your-anthropic-api-key'
});
// Run a smart AI agent (with tracking, evaluation & self-improvement)
const result = await aiWrapper.runSmartAgent({
agentName: 'customer-support',
input: 'Hello, I need help with my order',
model: 'gpt-4'
});
console.log(result.output);
// The system automatically tracks this execution, learns from it,
// and uses the data to improve future interactions!
const aiWrapper = new AIWrapper({
handitApiKey: 'required-handit-api-key', // Required
openaiApiKey: 'your-openai-key', // Optional
googleApiKey: 'your-google-key', // Optional
anthropicApiKey: 'your-anthropic-key', // Optional
trackingUrl: 'custom-tracking-url', // Optional
performanceUrl: 'custom-performance-url', // Optional
ssoTrackingUrl: 'custom-sso-tracking-url' // Optional
});
// The flagship method - includes full intelligence, tracking & optimization
const result = await aiWrapper.runSmartAgent({
agentName: 'customer-support',
input: 'User question or input',
model: 'gpt-4',
additionalOptions: {
temperature: 0.7,
max_tokens: 1000
}
});
// β
Automatically fetches optimized prompts
// β
Tracks execution metrics
// β
Learns from the interaction
// β
Contributes to self-improvement
// Google AI with optimization focus
const result = await aiWrapper.runOptimizedAgent({
agentName: 'content-writer',
input: 'Write about AI trends',
model: 'gemini-pro',
additionalOptions: {
temperature: 0.8
}
});
// β
Optimizes for performance and quality
// β
Tracks optimization metrics
// Anthropic Claude with enhanced safety tracking
const result = await aiWrapper.runTrackedAgent({
agentName: 'code-reviewer',
input: 'Review this code for security issues',
model: 'claude-3-sonnet-20240229',
additionalOptions: {
max_tokens: 2000
}
});
// β
Enhanced tracking for sensitive operations
// β
Safety and compliance monitoring
// Direct provider execution with tracking
const result = await aiWrapper.runWithOpenAI({
agentName: 'data-analyst',
input: 'Analyze quarterly sales data',
model: 'gpt-3.5-turbo'
});
new AIWrapper(options)
- Initialize the wrapper with configurationexecuteAgent(options)
Generic method to execute an AI agent with any provider.
Parameters:
agentName
(string) - Name of the agent in handitinput
(string) - User input/questionprovider
(string) - AI provider ('openai', 'google', 'anthropic')model
(string, optional) - Specific model to usenodeName
(string, optional) - Name for tracking purposesadditionalOptions
(object, optional) - Provider-specific optionsReturns:
{
success: boolean,
output: string, // AI response
executionId: string, // Tracking ID
prompts: array // Prompts used
}
runSmartAgent(options)
Smart AI execution with full intelligence and optimization.
runOptimizedAgent(options)
Google AI execution with optimization focus.
runTrackedAgent(options)
Anthropic Claude execution with enhanced safety tracking.
runWithOpenAI(options)
, runWithGoogle(options)
, runWithAnthropic(options)
Provider-specific execution methods.
getPrompts({ agentName })
Fetch available prompts for an agent.
track(options)
Manually track a node execution.
Parameters:
input
- Input dataoutput
- Output datanodeName
- Node nameagentName
- Agent namenodeType
- Type of node ('llm', 'custom', etc.)executionId
- Execution IDThe wrapper automatically fetches prompts from handit based on the agent name. Prompts should be structured as:
{{input}}
or {{user_input}}
placeholders)Example prompt structure:
[
{
type: 'system',
content: 'You are a helpful customer support agent...'
},
{
type: 'user',
content: 'Customer question: {{input}}'
}
]
The wrapper includes comprehensive error handling:
const result = await aiWrapper.executeWithOpenAI({
agentName: 'test-agent',
input: 'test input'
});
if (!result.success) {
console.error('Execution failed:', result.error);
// Error is automatically tracked in handit
}
All executions are automatically tracked using handit's tracking system:
gpt-4
gpt-4-turbo
gpt-3.5-turbo
gemini-pro
gemini-pro-vision
claude-3-opus-20240229
claude-3-sonnet-20240229
claude-3-haiku-20240307
See example.js
for comprehensive usage examples including:
You can also configure API keys using environment variables:
HANDIT_API_KEY=your-handit-key
OPENAI_API_KEY=your-openai-key
GOOGLE_API_KEY=your-google-key
ANTHROPIC_API_KEY=your-anthropic-key
MIT
Perfect for getting started quickly with the most important methods and examples.
Comprehensive documentation including advanced features, best practices, and detailed examples.
The complete documentation covers:
For issues and questions:
This isn't just an AI wrapper - it's an intelligent AI system that:
Start simple with runSmartAgent()
, then explore the advanced features as your AI system evolves!
FAQs
π€ Intelligent AI execution system with built-in tracking, evaluation, and self-improvement capabilities. The complete AI intelligence platform for enterprise applications.
We found that @handit.ai/ai-wrapper 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
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socketβs AI scanner detected the supply chain attack and flagged the malware.
Security News
CISAβs 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.