gemini

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanLabels added in v1.7.0

func CleanLabels(labels []string, availableLabels []string) []string

CleanLabels cleans and validates labels, keeping only the allowed ones. It accepts a list of labels to clean and a list of available labels from the repository. If availableLabels is empty, it falls back to a default list of common labels.

func GetGenerateConfig

func GetGenerateConfig(modelName string, responseType string, schema *genai.Schema) *genai.GenerateContentConfig

GetGenerateConfig returns the optimal configuration for the model, enabling Thinking Mode if compatible.

Types

type CodeAnalysisJSON

type CodeAnalysisJSON struct {
	OverView string `json:"overview"`
	Purpose  string `json:"purpose"`
	Impact   string `json:"impact"`
}

type CommitSuggestionJSON

type CommitSuggestionJSON struct {
	Title        string            `json:"title"`
	Desc         string            `json:"desc"`
	Files        []string          `json:"files"`
	Analysis     *CodeAnalysisJSON `json:"analysis,omitempty"`
	Requirements *RequirementsJSON `json:"requirements,omitempty"`
}

type GeminiCommitSummarizer

type GeminiCommitSummarizer struct {
	*GeminiProvider
	// contains filtered or unexported fields
}

func NewGeminiCommitSummarizer

func NewGeminiCommitSummarizer(ctx context.Context, cfg *config.Config, onConfirmation ai.ConfirmationCallback) (*GeminiCommitSummarizer, error)

func (*GeminiCommitSummarizer) GenerateSuggestions

func (s *GeminiCommitSummarizer) GenerateSuggestions(ctx context.Context, info models.CommitInfo, count int) ([]models.CommitSuggestion, error)

type GeminiIssueContentGenerator

type GeminiIssueContentGenerator struct {
	*GeminiProvider
	// contains filtered or unexported fields
}

func NewGeminiIssueContentGenerator

func NewGeminiIssueContentGenerator(ctx context.Context, cfg *config.Config, onConfirmation ai.ConfirmationCallback) (*GeminiIssueContentGenerator, error)

func (*GeminiIssueContentGenerator) GenerateIssueContent

GenerateIssueContent generates issue content using Gemini AI.

type GeminiPRSummarizer

type GeminiPRSummarizer struct {
	*GeminiProvider
	// contains filtered or unexported fields
}

func NewGeminiPRSummarizer

func NewGeminiPRSummarizer(ctx context.Context, cfg *config.Config, onConfirmation ai.ConfirmationCallback) (*GeminiPRSummarizer, error)

func (*GeminiPRSummarizer) GeneratePRSummary

func (gps *GeminiPRSummarizer) GeneratePRSummary(ctx context.Context, prContent string, availableLabels []string) (models.PRSummary, error)

type GeminiProvider

type GeminiProvider struct {
	Client *genai.Client
	// contains filtered or unexported fields
}

GeminiProvider is a shared base for all Gemini services that implements the ai.CostAwareAIProvider interface

func NewGeminiProvider

func NewGeminiProvider(client *genai.Client, model string) *GeminiProvider

NewGeminiProvider creates a new instance of GeminiProvider

func (*GeminiProvider) CountTokens

func (g *GeminiProvider) CountTokens(ctx context.Context, prompt string) (int, error)

CountTokens implements ai.CostAwareAIProvider

func (*GeminiProvider) GetModelName

func (g *GeminiProvider) GetModelName() string

GetModelName implements ai.CostAwareAIProvider

func (*GeminiProvider) GetProviderName

func (g *GeminiProvider) GetProviderName() string

GetProviderName implements ai.CostAwareAIProvider

type PRSummaryJSON

type PRSummaryJSON struct {
	Title  string   `json:"title"`
	Body   string   `json:"body"`
	Labels []string `json:"labels"`
}

type ReleaseNotesGenerator

type ReleaseNotesGenerator struct {
	*GeminiProvider
	// contains filtered or unexported fields
}

func NewReleaseNotesGenerator

func NewReleaseNotesGenerator(ctx context.Context, cfg *config.Config, onConfirmation ai.ConfirmationCallback, owner, repo string) (*ReleaseNotesGenerator, error)

func (*ReleaseNotesGenerator) GenerateNotes

func (g *ReleaseNotesGenerator) GenerateNotes(ctx context.Context, release *models.Release) (*models.ReleaseNotes, error)

type ReleaseNotesJSON

type ReleaseNotesJSON struct {
	Title      string   `json:"title"`
	Summary    string   `json:"summary"`
	Highlights []string `json:"highlights"`
	Sections   []struct {
		Title string   `json:"title"`
		Items []string `json:"items"`
	} `json:"sections"`
	BreakingChanges []string `json:"breaking_changes"`
	Contributors    string   `json:"contributors"`
}

type RequirementsJSON

type RequirementsJSON struct {
	Status      string   `json:"status"`
	Missing     []string `json:"missing"`
	Suggestions []string `json:"suggestions"`
}

Jump to

Keyboard shortcuts

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