ErrorAnalyzer 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ErrorAnalyzer --version 1.0.0
                    
NuGet\Install-Package ErrorAnalyzer -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ErrorAnalyzer" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ErrorAnalyzer" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ErrorAnalyzer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ErrorAnalyzer --version 1.0.0
                    
#r "nuget: ErrorAnalyzer, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ErrorAnalyzer@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ErrorAnalyzer&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ErrorAnalyzer&version=1.0.0
                    
Install as a Cake Tool

ErrorAnalyzerNuGet

Overview

ErrorAnalyzerNuGet is a C# NuGet package that uses an AI model (Code LLaMA) to analyze error messages and stack traces. It returns structured error codes, messages, and suggestions to help developers diagnose and fix issues efficiently.

Features

  • AI-Powered Error Analysis: Uses Code LLaMA to process and interpret errors.
  • Structured Output: Returns error codes, descriptions, and suggested fixes.
  • Exception Handling: Accepts raw error messages, stack traces, or structured logs.
  • Local AI Processing: Runs Code LLaMA locally for fast and secure analysis.

Installation

Install via NuGet

Run the following command in your .NET project:

 dotnet add package ErrorAnalyzer

Install from Local Package

If using a local .nupkg file:

 dotnet add package ErrorAnalyzer --source "C:\path\to\package"

Usage

Basic Example

using System;
using ErrorAnalyzer;

class Program
{
    static void Main()
    {
        var analyzer = new ErrorAnalyzer.ErrorAnalyzer();

        try
        {
            int result = 10 / int.Parse("0");
        }
        catch (Exception ex)
        {
            var analysisResult = analyzer.AnalyzeError(ex.ToString());

            Console.WriteLine($"Error Code: {analysisResult.ErrorCode}");
            Console.WriteLine($"Message: {analysisResult.Message}");
            Console.WriteLine("Suggestions:");
            foreach (var suggestion in analysisResult.Suggestions)
            {
                Console.WriteLine($"- {suggestion}");
            }
        }
    }
}

Output Example

Error Code: AI_GENERATED_CODE
Message: The error is a DivideByZeroException, which occurs when attempting to divide by zero.
Suggestions:
- Ensure denominator is not zero before division.
- Use try-catch to handle unexpected zero values.

API Reference

ErrorAnalyzer

AnalyzeError(string stackTrace)
  • Input: A stack trace or error message string.
  • Output: Returns an ErrorAnalysisResult object containing:
    • ErrorCode (string)
    • Message (string)
    • Suggestions (string array)

Requirements

  • .NET 6.0 or later
  • Python 3.8+
  • Dependencies:
    • transformers
    • torch

Contributing

Feel free to contribute to this project by submitting pull requests or opening issues.

License

MIT License

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 219 2/22/2025
1.0.0 193 2/20/2025