ai

package
v0.1.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ai provides AI-powered enhancements for Nexlayer configurations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnhancementIssue

type EnhancementIssue struct {
	Type        string   // Type of issue: "error", "warning", "suggestion"
	Field       string   // The field with the issue
	Message     string   // Description of the issue
	Suggestions []string // Suggestions to fix the issue
}

EnhancementIssue represents a single issue detected during enhancement

type EnhancementResult

type EnhancementResult struct {
	Issues          []EnhancementIssue         // Issues detected in the configuration
	Suggestions     []string                   // General suggestions for improvement
	ImprovedConfig  *yaml.NexlayerYAML         // Enhanced configuration (if any)
	Comments        map[string]string          // Comments for specific fields
	DetectionResult *detection.DetectionResult // Detection results used for enhancement
	EnhancementTime time.Duration              // How long enhancement took
}

EnhancementResult contains the results of an enhancement operation

type Enhancer

type Enhancer struct {
	// contains filtered or unexported fields
}

Enhancer provides AI-powered enhancements for Nexlayer configurations

func NewEnhancer

func NewEnhancer(llmEnricher *knowledge.LLMEnricher, detectionMgr *detection.DetectionManager) *Enhancer

NewEnhancer creates a new AI Enhancer with the provided LLM enricher

func (*Enhancer) Enhance

func (e *Enhancer) Enhance(ctx context.Context, config *yaml.NexlayerYAML, detectionDir string) (*EnhancementResult, error)

Enhance enhances a configuration

func (*Enhancer) EnhanceAsync

func (e *Enhancer) EnhanceAsync(ctx context.Context, config *yaml.NexlayerYAML, detectionDir string) (<-chan *EnhancementResult, <-chan error)

EnhanceAsync enhances a configuration asynchronously

func (*Enhancer) Shutdown

func (e *Enhancer) Shutdown(ctx context.Context)

Shutdown gracefully shuts down the enhancer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL