Documentation
¶
Overview ¶
Package gemini provides Gemini AI integration for embeddings and LLM.
Index ¶
- type DuplicateCheckInput
- type DuplicateResult
- type Embedder
- type IssueInput
- type LLMClient
- func (l *LLMClient) AnalyzeIssue(ctx context.Context, issue *IssueInput) (*TriageResult, error)
- func (l *LLMClient) AssessQuality(ctx context.Context, issue *IssueInput) (*QualityResult, error)
- func (l *LLMClient) Close() error
- func (l *LLMClient) DetectDuplicate(ctx context.Context, input *DuplicateCheckInput) (*DuplicateResult, error)
- func (l *LLMClient) GenerateResponse(ctx context.Context, similar []SimilarIssueInput) (string, error)
- func (l *LLMClient) RouteIssue(ctx context.Context, input *RouteIssueInput) (*RouterResult, error)
- type QualityResult
- type RepositoryCandidate
- type RepositoryRanking
- type RouteIssueInput
- type RouterResult
- type SimilarIssueInput
- type TriageResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DuplicateCheckInput ¶ added in v0.1.0
type DuplicateCheckInput struct {
CurrentIssue *IssueInput
SimilarIssues []SimilarIssueInput
}
DuplicateCheckInput represents input for duplicate detection.
type DuplicateResult ¶ added in v0.1.0
type DuplicateResult struct {
IsDuplicate bool `json:"is_duplicate"`
DuplicateOf int `json:"duplicate_of"` // Issue number
Confidence float64 `json:"confidence"` // 0.0-1.0
Reasoning string `json:"reasoning"`
SimilarIssues json.RawMessage `json:"similar_issues"` // Flexible: can be []int or []object
}
DuplicateResult holds duplicate detection analysis.
type Embedder ¶
type Embedder struct {
// contains filtered or unexported fields
}
Embedder generates embeddings using Gemini.
func NewEmbedder ¶
NewEmbedder creates a new Gemini embedder.
func (*Embedder) Dimensions ¶
Dimensions returns the dimensionality of the embeddings.
type IssueInput ¶
IssueInput represents the issue data needed for analysis.
type LLMClient ¶
type LLMClient struct {
// contains filtered or unexported fields
}
LLMClient provides LLM-based analysis using Gemini.
func NewLLMClient ¶
NewLLMClient creates a new Gemini LLM client.
func (*LLMClient) AnalyzeIssue ¶
func (l *LLMClient) AnalyzeIssue(ctx context.Context, issue *IssueInput) (*TriageResult, error)
AnalyzeIssue performs triage analysis on an issue.
func (*LLMClient) AssessQuality ¶ added in v0.1.0
func (l *LLMClient) AssessQuality(ctx context.Context, issue *IssueInput) (*QualityResult, error)
AssessQuality evaluates issue completeness and clarity.
func (*LLMClient) DetectDuplicate ¶ added in v0.1.0
func (l *LLMClient) DetectDuplicate(ctx context.Context, input *DuplicateCheckInput) (*DuplicateResult, error)
DetectDuplicate analyzes semantic similarity for duplicate detection.
func (*LLMClient) GenerateResponse ¶
func (l *LLMClient) GenerateResponse(ctx context.Context, similar []SimilarIssueInput) (string, error)
GenerateResponse creates a comment for similar issues.
func (*LLMClient) RouteIssue ¶ added in v0.1.0
func (l *LLMClient) RouteIssue(ctx context.Context, input *RouteIssueInput) (*RouterResult, error)
RouteIssue analyzes issue intent and ranks repositories by relevance.
type QualityResult ¶ added in v0.1.0
type QualityResult struct {
Score float64 `json:"score"` // 0.0 (poor) to 1.0 (excellent)
Assessment string `json:"assessment"` // "excellent"|"good"|"needs-improvement"|"poor"
Issues []string `json:"issues"` // Missing elements
Suggestions []string `json:"suggestions"` // How to improve
Reasoning string `json:"reasoning"`
}
QualityResult holds issue quality assessment.
type RepositoryCandidate ¶ added in v0.1.0
type RepositoryCandidate struct {
Org string
Repo string
Description string
Definition string // Full repository documentation (README, etc.)
}
RepositoryCandidate represents a repository option for routing.
type RepositoryRanking ¶ added in v0.1.0
type RepositoryRanking struct {
Org string `json:"org"`
Repo string `json:"repo"`
Confidence float64 `json:"confidence"` // 0.0-1.0
Reasoning string `json:"reasoning"`
}
RepositoryRanking represents a repository match with confidence.
type RouteIssueInput ¶ added in v0.1.0
type RouteIssueInput struct {
Issue *IssueInput
Repositories []RepositoryCandidate
CurrentRepo string // Current repository (org/repo) where issue was created
}
RouteIssueInput represents input for repository routing.
type RouterResult ¶ added in v0.1.0
type RouterResult struct {
Rankings []RepositoryRanking
BestMatch *RepositoryRanking
}
RouterResult holds repository routing analysis.
type SimilarIssueInput ¶
type SimilarIssueInput struct {
Number int
Title string
Body string // Full text content from vector DB
URL string
Similarity float64
State string
}
SimilarIssueInput represents a similar issue found.
type TriageResult ¶
type TriageResult struct {
Quality string `json:"quality"` // "good", "needs-improvement", "poor"
SuggestedLabels []string `json:"suggested_labels"`
Reasoning string `json:"reasoning"`
IsDuplicate bool `json:"is_duplicate"`
DuplicateReason string `json:"duplicate_reason"`
}
TriageResult holds the result of issue triage analysis.