@nomyx-ai/ai-node-debugger
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

ai-node-debugger

AI Node Debugger: An intelligent, AI-powered exception handler for Node.js that provides real-time, context-aware error analysis and debugging suggestions, enhancing developer productivity and code quality.

Features

  • AI-powered error analysis
  • Support for multiple AI providers (OpenAI and Azure OpenAI)
  • Rate limiting to prevent excessive API calls
  • Customizable output formats
  • Easy integration with existing Node.js applications

Installation

npm install @nomyx-ai/ai-node-debugger

Usage

Basic usage:

const { configure } = require('@nomyx-ai/ai-node-debugger');

configure({
  aiProvider: 'openai',
  apiKey: 'your-api-key-here'
});

// Your application code here

Advanced configuration:

const { configure } = require('@nomyx-ai/ai-node-debugger');

configure({
  aiProvider: 'azure',
  apiKey: 'your-azure-api-key-here',
  maxTokens: 2000,
  temperature: 0.7,
  outputFormat: 'json',
  rateLimitPerMinute: 5,
  callback: (result) => {
    // Custom handling of AI analysis result
    console.log(JSON.stringify(result, null, 2));
  }
});

// Your application code here

Configuration Options

Option Type Default Description
aiProvider string 'openai' AI provider to use ('openai' or 'azure')
apiKey string '' API key for the chosen AI provider
maxTokens number 1500 Maximum number of tokens to generate
temperature number 0.7 Sampling temperature for AI responses
outputFormat string 'console' Output format ('console', 'json', or 'callback')
rateLimitPerMinute number 10 Maximum number of API calls per minute
callback function undefined Custom callback function for handling AI analysis results

Error Analysis Output

The AI-powered error analysis provides the following information:

  • Error type
  • Initial thoughts on the error
  • Step-by-step analysis
  • Conclusion, including:
    • Explanation
    • Potential causes
    • Suggested fixes
    • Relevant code snippet
    • Debugging steps

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

Package Sidebar

Install

npm i @nomyx-ai/ai-node-debugger

Weekly Downloads

6

Version

0.0.3

License

MIT

Unpacked Size

51.5 kB

Total Files

38

Last publish

Collaborators

  • lonestar108