Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/simili-web/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

"github.com/similigh/simili-bot/internal/core/config"
"github.com/similigh/simili-bot/internal/core/pipeline"
"github.com/similigh/simili-bot/internal/integrations/gemini"
"github.com/similigh/simili-bot/internal/integrations/ai"
"github.com/similigh/simili-bot/internal/integrations/github"
"github.com/similigh/simili-bot/internal/integrations/qdrant"
"github.com/similigh/simili-bot/internal/steps"
Expand Down Expand Up @@ -115,7 +115,7 @@ func initDependencies(cfg *config.Config) (*pipeline.Dependencies, error) {
}

// Embedder (Gemini/OpenAI auto-selected by available keys)
embedder, err := gemini.NewEmbedder(cfg.Embedding.APIKey, cfg.Embedding.Model)
embedder, err := ai.NewEmbedder(cfg.Embedding.APIKey, cfg.Embedding.Model)
if err != nil {
return nil, fmt.Errorf("failed to init embedder: %w", err)
}
Expand Down Expand Up @@ -151,7 +151,7 @@ func initDependencies(cfg *config.Config) (*pipeline.Dependencies, error) {
if envModel := os.Getenv("LLM_MODEL"); envModel != "" {
llmModel = envModel
}
llm, err := gemini.NewLLMClient(llmKey, llmModel)
llm, err := ai.NewLLMClient(llmKey, llmModel)
if err != nil {
return nil, fmt.Errorf("failed to init LLM: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/simili/commands/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"github.com/similigh/simili-bot/internal/core/config"
"github.com/similigh/simili-bot/internal/core/pipeline"
"github.com/similigh/simili-bot/internal/integrations/gemini"
"github.com/similigh/simili-bot/internal/integrations/ai"
"github.com/similigh/simili-bot/internal/integrations/github"
"github.com/similigh/simili-bot/internal/integrations/qdrant"
)
Expand Down Expand Up @@ -281,7 +281,7 @@ func initializeDependencies(cfg *config.Config) (*pipeline.Dependencies, error)
deps := &pipeline.Dependencies{}

// Initialize Embedder (Gemini/OpenAI auto-selected by available keys)
embedder, err := gemini.NewEmbedder(cfg.Embedding.APIKey, cfg.Embedding.Model)
embedder, err := ai.NewEmbedder(cfg.Embedding.APIKey, cfg.Embedding.Model)
if err != nil {
return nil, fmt.Errorf("failed to initialize embedder: %w", err)
}
Expand Down Expand Up @@ -338,7 +338,7 @@ func initializeDependencies(cfg *config.Config) (*pipeline.Dependencies, error)
if envModel := os.Getenv("LLM_MODEL"); envModel != "" {
llmModel = envModel
}
llm, err := gemini.NewLLMClient(llmKey, llmModel)
llm, err := ai.NewLLMClient(llmKey, llmModel)
if err != nil {
return nil, fmt.Errorf("failed to initialize LLM client: %w", err)
}
Expand Down
12 changes: 6 additions & 6 deletions cmd/simili/commands/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/google/go-github/v60/github"
"github.com/google/uuid"
similiConfig "github.com/similigh/simili-bot/internal/core/config"
"github.com/similigh/simili-bot/internal/integrations/gemini"
"github.com/similigh/simili-bot/internal/integrations/ai"
similiGithub "github.com/similigh/simili-bot/internal/integrations/github"
"github.com/similigh/simili-bot/internal/integrations/qdrant"
"github.com/similigh/simili-bot/internal/utils/text"
Expand Down Expand Up @@ -89,13 +89,13 @@ func runIndex(cmd *cobra.Command, args []string) {

ghClient := similiGithub.NewClient(ctx, token)

geminiClient, err := gemini.NewEmbedder(cfg.Embedding.APIKey, cfg.Embedding.Model)
embedder, err := ai.NewEmbedder(cfg.Embedding.APIKey, cfg.Embedding.Model)
if err != nil {
log.Fatalf("Failed to init embedder: %v", err)
}
defer geminiClient.Close()
defer embedder.Close()
embeddingDimensions := cfg.Embedding.Dimensions
if dim := geminiClient.Dimensions(); dim > 0 {
if dim := embedder.Dimensions(); dim > 0 {
embeddingDimensions = dim
}

Expand Down Expand Up @@ -144,7 +144,7 @@ func runIndex(cmd *cobra.Command, args []string) {
go func(id int) {
defer wg.Done()
for job := range jobs {
processIssue(ctx, id, job.Issue, ghClient, geminiClient, qdrantClient, splitter, cfg.Qdrant.Collection, org, repoName, indexDryRun)
processIssue(ctx, id, job.Issue, ghClient, embedder, qdrantClient, splitter, cfg.Qdrant.Collection, org, repoName, indexDryRun)
}
}(i)
}
Expand Down Expand Up @@ -198,7 +198,7 @@ func runIndex(cmd *cobra.Command, args []string) {
log.Println("Indexing complete.")
}

func processIssue(ctx context.Context, workerID int, issue *github.Issue, gh *similiGithub.Client, em *gemini.Embedder, qd *qdrant.Client, splitter *text.RecursiveCharacterSplitter, collection, org, repo string, dryRun bool) {
func processIssue(ctx context.Context, workerID int, issue *github.Issue, gh *similiGithub.Client, em *ai.Embedder, qd *qdrant.Client, splitter *text.RecursiveCharacterSplitter, collection, org, repo string, dryRun bool) {
// 1. Fetch Comments (with pagination)
var allComments []*github.IssueComment
page := 1
Expand Down
4 changes: 2 additions & 2 deletions cmd/simili/commands/learn.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"time"

similiConfig "github.com/similigh/simili-bot/internal/core/config"
"github.com/similigh/simili-bot/internal/integrations/gemini"
"github.com/similigh/simili-bot/internal/integrations/ai"
similiGithub "github.com/similigh/simili-bot/internal/integrations/github"
"github.com/similigh/simili-bot/internal/integrations/qdrant"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -89,7 +89,7 @@ func runLearn(cmd *cobra.Command, args []string) {
ghClient := similiGithub.NewClient(ctx, token)

// 3. Initialize Embedder
embedder, err := gemini.NewEmbedder(cfg.Embedding.APIKey, cfg.Embedding.Model)
embedder, err := ai.NewEmbedder(cfg.Embedding.APIKey, cfg.Embedding.Model)
if err != nil {
log.Fatalf("Failed to initialize embedder: %v", err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/simili/commands/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

"github.com/similigh/simili-bot/internal/core/config"
"github.com/similigh/simili-bot/internal/core/pipeline"
"github.com/similigh/simili-bot/internal/integrations/gemini"
"github.com/similigh/simili-bot/internal/integrations/ai"
"github.com/similigh/simili-bot/internal/integrations/github"
"github.com/similigh/simili-bot/internal/integrations/qdrant"
)
Expand Down Expand Up @@ -204,7 +204,7 @@ func runProcess() {

// Initialize clients with error logging
// Embedder
embedder, err := gemini.NewEmbedder(cfg.Embedding.APIKey, cfg.Embedding.Model)
embedder, err := ai.NewEmbedder(cfg.Embedding.APIKey, cfg.Embedding.Model)
if err == nil {
deps.Embedder = embedder
if verbose {
Expand Down Expand Up @@ -262,7 +262,7 @@ func runProcess() {
if envModel := os.Getenv("LLM_MODEL"); envModel != "" {
llmModel = envModel
}
llm, err := gemini.NewLLMClient(llmKey, llmModel)
llm, err := ai.NewLLMClient(llmKey, llmModel)
if err == nil {
deps.LLMClient = llm
if verbose {
Expand Down
6 changes: 3 additions & 3 deletions internal/core/pipeline/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"fmt"
"sync"

"github.com/similigh/simili-bot/internal/integrations/gemini"
"github.com/similigh/simili-bot/internal/integrations/ai"
"github.com/similigh/simili-bot/internal/integrations/github"
"github.com/similigh/simili-bot/internal/integrations/qdrant"
)
Expand All @@ -28,8 +28,8 @@ type StepFactory func(deps *Dependencies) (Step, error)

// Dependencies holds the dependencies that can be injected into steps.
type Dependencies struct {
Embedder *gemini.Embedder
LLMClient *gemini.LLMClient
Embedder *ai.Embedder
LLMClient *ai.LLMClient
VectorStore qdrant.VectorStore
GitHub *github.Client
DryRun bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
// Created: 2026-02-02
// Last Modified: 2026-02-17

// Package gemini provides AI integration for embeddings and LLM.
//
// TODO(2026-02-16): This package is named "gemini" for historical reasons, but it
// now supports multiple providers (Gemini and OpenAI). Recommend renaming
// directory/package to provider-neutral naming (for example `internal/integrations/ai`).
package gemini
// Package ai provides AI integration for embeddings and LLM.
package ai

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Created: 2026-02-02
// Last Modified: 2026-02-17

package gemini
package ai

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Created: 2026-02-02
// Last Modified: 2026-02-05

package gemini
package ai

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Created: 2026-02-02
// Last Modified: 2026-02-02

package gemini
package ai

import (
"strings"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gemini
package ai

import (
"bytes"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gemini
package ai

import "testing"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// Created: 2026-02-15
// Last Modified: 2026-02-17

// Package gemini provides Gemini AI integration for embeddings and LLM.
package gemini
// Package ai provides provider-neutral AI integration for embeddings and LLM.
package ai

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Created: 2026-02-15
// Last Modified: 2026-02-17

package gemini
package ai

import (
"context"
Expand Down
12 changes: 6 additions & 6 deletions internal/steps/duplicate_detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"log"

"github.com/similigh/simili-bot/internal/core/pipeline"
"github.com/similigh/simili-bot/internal/integrations/gemini"
"github.com/similigh/simili-bot/internal/integrations/ai"
)

// DuplicateDetector analyzes similarity results for duplicates using LLM.
type DuplicateDetector struct {
llm *gemini.LLMClient
llm *ai.LLMClient
}

// NewDuplicateDetector creates a new duplicate detector step.
Expand Down Expand Up @@ -60,9 +60,9 @@ func (s *DuplicateDetector) Run(ctx *pipeline.Context) error {
maxSimilar = len(ctx.SimilarIssues)
}

similarInput := make([]gemini.SimilarIssueInput, maxSimilar)
similarInput := make([]ai.SimilarIssueInput, maxSimilar)
for i := 0; i < maxSimilar; i++ {
similarInput[i] = gemini.SimilarIssueInput{
similarInput[i] = ai.SimilarIssueInput{
Number: ctx.SimilarIssues[i].Number,
Title: ctx.SimilarIssues[i].Title,
Body: ctx.SimilarIssues[i].Body,
Expand All @@ -72,8 +72,8 @@ func (s *DuplicateDetector) Run(ctx *pipeline.Context) error {
}
}

input := &gemini.DuplicateCheckInput{
CurrentIssue: &gemini.IssueInput{
input := &ai.DuplicateCheckInput{
CurrentIssue: &ai.IssueInput{
Title: ctx.Issue.Title,
Body: ctx.Issue.Body,
Author: ctx.Issue.Author,
Expand Down
4 changes: 2 additions & 2 deletions internal/steps/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import (
"github.com/google/go-github/v60/github"
"github.com/google/uuid"
"github.com/similigh/simili-bot/internal/core/pipeline"
"github.com/similigh/simili-bot/internal/integrations/gemini"
"github.com/similigh/simili-bot/internal/integrations/ai"
similiGithub "github.com/similigh/simili-bot/internal/integrations/github"
"github.com/similigh/simili-bot/internal/integrations/qdrant"
"github.com/similigh/simili-bot/internal/utils/text"
)

// Indexer adds/updates the issue in the vector database.
type Indexer struct {
embedder *gemini.Embedder
embedder *ai.Embedder
store qdrant.VectorStore
github *similiGithub.Client
dryRun bool
Expand Down
14 changes: 7 additions & 7 deletions internal/steps/llm_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
"log"

"github.com/similigh/simili-bot/internal/core/pipeline"
"github.com/similigh/simili-bot/internal/integrations/gemini"
"github.com/similigh/simili-bot/internal/integrations/ai"
"github.com/similigh/simili-bot/internal/integrations/qdrant"
)

// LLMRouter analyzes issue intent and routes to best repository using LLM.
type LLMRouter struct {
llm *gemini.LLMClient
embedder *gemini.Embedder
llm *ai.LLMClient
embedder *ai.Embedder
store qdrant.VectorStore
}

Expand Down Expand Up @@ -64,14 +64,14 @@ func (s *LLMRouter) Run(ctx *pipeline.Context) error {
log.Printf("[llm_router] Analyzing issue #%d for routing", ctx.Issue.Number)

// Collect repository candidates (include current repo to allow "stay here" decision)
var candidates []gemini.RepositoryCandidate
var candidates []ai.RepositoryCandidate
currentRepo := fmt.Sprintf("%s/%s", ctx.Issue.Org, ctx.Issue.Repo)

for _, repo := range ctx.Config.Repositories {
if !repo.Enabled || repo.Description == "" {
continue
}
candidates = append(candidates, gemini.RepositoryCandidate{
candidates = append(candidates, ai.RepositoryCandidate{
Org: repo.Org,
Repo: repo.Repo,
Description: repo.Description,
Expand Down Expand Up @@ -171,8 +171,8 @@ func (s *LLMRouter) Run(ctx *pipeline.Context) error {
}

// Call LLM to route issue (reuse currentRepo from above)
input := &gemini.RouteIssueInput{
Issue: &gemini.IssueInput{
input := &ai.RouteIssueInput{
Issue: &ai.IssueInput{
Title: ctx.Issue.Title,
Body: ctx.Issue.Body,
Author: ctx.Issue.Author,
Expand Down
6 changes: 3 additions & 3 deletions internal/steps/quality_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"log"

"github.com/similigh/simili-bot/internal/core/pipeline"
"github.com/similigh/simili-bot/internal/integrations/gemini"
"github.com/similigh/simili-bot/internal/integrations/ai"
)

// QualityChecker assesses issue quality using LLM.
type QualityChecker struct {
llm *gemini.LLMClient
llm *ai.LLMClient
}

// NewQualityChecker creates a new quality checker step.
Expand Down Expand Up @@ -42,7 +42,7 @@ func (s *QualityChecker) Run(ctx *pipeline.Context) error {

log.Printf("[quality_checker] Assessing quality for issue #%d", ctx.Issue.Number)

input := &gemini.IssueInput{
input := &ai.IssueInput{
Title: ctx.Issue.Title,
Body: ctx.Issue.Body,
Author: ctx.Issue.Author,
Expand Down
Loading
Loading