ai

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AIResponse

type AIResponse struct {
	Answer        string   `json:"answer"`
	Confidence    float64  `json:"confidence"`
	RelevantFiles []string `json:"relevant_files"`
}

type AIService

type AIService interface {
	CodeAnalyzer
	LabelAnalyzer
}

AIService combines all analysis capabilities

func NewAIService

func NewAIService(aiType AIType, apiKey string) AIService

type AIType

type AIType string
const (
	AITypeOpenAI AIType = "openai"
	AITypeClaude AIType = "claude"
)

func ToAIType

func ToAIType(s string) AIType

type Claude

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

func (*Claude) AnalyzeCode

func (c *Claude) AnalyzeCode(ctx context.Context, question string, files []github.GitHubFile) (answer string, confidence float64, err error)

func (*Claude) AnalyzeLabels

func (c *Claude) AnalyzeLabels(ctx context.Context, title, body string, availableLabels string) (github.LabelAnalysis, error)

type CodeAnalyzer

type CodeAnalyzer interface {
	AnalyzeCode(ctx context.Context, question string, files []github.GitHubFile) (answer string, confidence float64, err error)
}

CodeAnalyzer analyzes code and provides detailed explanations

type LabelAnalyzer

type LabelAnalyzer interface {
	AnalyzeLabels(ctx context.Context, title, body string, availableLabels string) (labelAnalysis github.LabelAnalysis, err error)
}

LabelAnalyzer suggests labels for GitHub issues

type OpenAI

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

func (*OpenAI) AnalyzeCode

func (a *OpenAI) AnalyzeCode(ctx context.Context, question string, files []github.GitHubFile) (answer string, confidence float64, err error)

func (*OpenAI) AnalyzeLabels

func (a *OpenAI) AnalyzeLabels(ctx context.Context, title, body string, availableLabels string) (github.LabelAnalysis, error)

Jump to

Keyboard shortcuts

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