gemini

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package gemini provides Gemini AI integration for embeddings and LLM.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

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

Embedder generates embeddings using Gemini.

func NewEmbedder

func NewEmbedder(apiKey string) (*Embedder, error)

NewEmbedder creates a new Gemini embedder.

func (*Embedder) Close

func (e *Embedder) Close() error

Close closes the Gemini client.

func (*Embedder) Dimensions

func (e *Embedder) Dimensions() int

Dimensions returns the dimensionality of the embeddings.

func (*Embedder) Embed

func (e *Embedder) Embed(ctx context.Context, text string) ([]float32, error)

Embed generates an embedding for a single text.

func (*Embedder) EmbedBatch

func (e *Embedder) EmbedBatch(ctx context.Context, texts []string) ([][]float32, error)

EmbedBatch generates embeddings for multiple texts. Note: Gemini API doesn't support true batch embedding, so this calls Embed for each text.

type IssueInput

type IssueInput struct {
	Title  string
	Body   string
	Author string
	Labels []string
}

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

func NewLLMClient(apiKey string) (*LLMClient, error)

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) Close

func (l *LLMClient) Close() error

Close closes the Gemini client.

func (*LLMClient) GenerateResponse

func (l *LLMClient) GenerateResponse(ctx context.Context, similar []SimilarIssueInput) (string, error)

GenerateResponse creates a comment for similar issues.

type SimilarIssueInput

type SimilarIssueInput struct {
	Number     int
	Title      string
	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.

Jump to

Keyboard shortcuts

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