Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR systematically renames the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~18 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Introduces internal/integrations/ai as a renamed copy of the former gemini package. Package declaration updated to `package ai` across all source and test files. Removes the TODO comment in embedder.go that flagged the misleading package name and updates the package-level doc comment accordingly. No behaviour changes — all logic, types, and tests are identical. Relates to #68 Signed-off-by: Kavirubc <hapuarachchikaviru@gmail.com>
…s/ai
Updates every import path and package qualifier across all 16 caller
files:
internal/steps/ — 10 files (transfer_check, response_builder,
duplicate_detector, similarity, vectordb_prep,
indexer, llm_router, quality_checker, triage,
response_builder_test)
internal/transfer/ — vdb_router.go
internal/core/pipeline/ — registry.go
cmd/simili/commands/ — batch, index, learn, process
cmd/simili-web/ — main.go
`gemini.X` → `ai.X` at every call site. No logic changes.
Relates to #68
Signed-off-by: Kavirubc <hapuarachchikaviru@gmail.com>
Deletes internal/integrations/gemini now that all callers have been migrated to internal/integrations/ai. Keeps the codebase free of dead code and eliminates the misleading provider-specific package name. Closes #68 Signed-off-by: Kavirubc <hapuarachchikaviru@gmail.com>
310656f to
db21ccc
Compare
There was a problem hiding this comment.
Pull request overview
This PR is a pure structural rename that resolves issue #68: the internal AI integration package is moved from internal/integrations/gemini (package gemini) to internal/integrations/ai (package ai), reflecting that it already supports multiple providers (Gemini and OpenAI), not just Gemini.
Changes:
- Renamed
internal/integrations/gemini/→internal/integrations/ai/with updatedpackage aideclarations and an updated package-level doc comment inembedder.go - Updated all import paths from
integrations/gemini→integrations/aiand allgemini.Xcall-site qualifiers toai.Xacross 16 caller files - Deleted the now-obsolete
internal/integrations/gemini/directory
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
internal/integrations/ai/embedder.go |
Updated package declaration from gemini → ai and replaced package-level doc comment with provider-neutral wording |
internal/integrations/ai/llm.go |
Updated package declaration |
internal/integrations/ai/prompts.go |
Updated package declaration |
internal/integrations/ai/provider.go |
Updated package declaration |
internal/integrations/ai/retry.go |
Updated package declaration (doc comment left stale — see comment) |
internal/integrations/ai/gemini_test.go |
Updated package declaration (filename not renamed — see comment) |
internal/integrations/ai/provider_test.go |
Updated package declaration |
internal/integrations/ai/retry_test.go |
Updated package declaration |
internal/transfer/vdb_router.go |
Updated import path and ai.Embedder type; function and doc comment names still reference "Gemini" |
internal/steps/vectordb_prep.go |
Import path and type updated |
internal/steps/triage.go |
Import path and type/struct references updated |
internal/steps/transfer_check.go |
Import path and all type references updated |
internal/steps/similarity.go |
Import path and type updated |
internal/steps/response_builder.go |
Import path and type assertion references updated |
internal/steps/response_builder_test.go |
Import path and struct literal references updated |
internal/steps/quality_checker.go |
Import path and type references updated |
internal/steps/llm_router.go |
Import path and all type references updated |
internal/steps/indexer.go |
Import path and type updated |
internal/steps/duplicate_detector.go |
Import path and all type references updated |
internal/core/pipeline/registry.go |
Import path and Dependencies struct fields updated |
cmd/simili/commands/process.go |
Import path and constructor calls updated |
cmd/simili/commands/learn.go |
Import path and constructor call updated |
cmd/simili/commands/index.go |
Import path and function signature updated; local variable still named geminiClient |
cmd/simili/commands/batch.go |
Import path and constructor calls updated |
cmd/simili-web/main.go |
Import path and constructor calls updated |
Comments suppressed due to low confidence (2)
internal/integrations/ai/gemini_test.go:6
- The test file is still named
gemini_test.goeven though it now belongs topackage ai. The filename was not updated as part of this rename. It should be renamed to a provider-neutral name (e.g.,prompts_test.goorllm_test.go) to be consistent with the purpose of this PR and the surrounding package name.
internal/integrations/ai/retry.go:6 - The package-level doc comment on line 6 still reads
// Package gemini provides Gemini AI integration for embeddings and LLM.— it was not updated as part of this rename. It should be updated to// Package ai provides AI integration for embeddings and LLM.to match the updated doc comment inembedder.go.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cmd/simili/commands/index.go
Outdated
| ghClient := similiGithub.NewClient(ctx, token) | ||
|
|
||
| geminiClient, err := gemini.NewEmbedder(cfg.Embedding.APIKey, cfg.Embedding.Model) | ||
| geminiClient, err := ai.NewEmbedder(cfg.Embedding.APIKey, cfg.Embedding.Model) |
There was a problem hiding this comment.
The local variable geminiClient (lines 92–147) was not renamed as part of this PR, even though the underlying type is now *ai.Embedder and the PR description states all gemini.X qualifiers were updated. This leaves a stale, provider-specific name for an instance of the now provider-neutral ai.Embedder. It should be renamed to something like embedder or aiEmbedder for consistency.
internal/transfer/vdb_router.go
Outdated
| // VDBRouterWithGeminiEmbedder is a convenience constructor accepting *ai.Embedder directly. | ||
| func NewVDBRouterFromGemini(embedder *ai.Embedder, store qdrant.VectorStore, collection string, maxResults int) *VDBRouter { |
There was a problem hiding this comment.
The function name NewVDBRouterFromGemini and its doc comment VDBRouterWithGeminiEmbedder both still contain "Gemini" references despite this being a rename PR aimed at removing provider-specific naming. Since this function accepts an *ai.Embedder (which is now provider-neutral), the function name and comment are inconsistent with the rest of the refactoring. The function should be renamed to something like NewVDBRouterFromEmbedder (or simply removed as a thin wrapper over NewVDBRouter), and the doc comment should be updated accordingly.
| // VDBRouterWithGeminiEmbedder is a convenience constructor accepting *ai.Embedder directly. | |
| func NewVDBRouterFromGemini(embedder *ai.Embedder, store qdrant.VectorStore, collection string, maxResults int) *VDBRouter { | |
| // VDBRouterWithEmbedder is a convenience constructor accepting *ai.Embedder directly. | |
| func NewVDBRouterFromEmbedder(embedder *ai.Embedder, store qdrant.VectorStore, collection string, maxResults int) *VDBRouter { |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
cmd/simili/commands/index.go (1)
92-96: Variable namegeminiClientis misleading after package rename.The variable is named
geminiClient, but it's now an*ai.Embedderthat could be backed by either Gemini or OpenAI. Consider renaming toembedderoraiClientfor consistency with the provider-neutral package name.♻️ Suggested rename for clarity
- geminiClient, err := ai.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 }Also update the reference at line 147:
- 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)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cmd/simili/commands/index.go` around lines 92 - 96, The variable name geminiClient is misleading because ai.NewEmbedder returns an *ai.Embedder that may wrap different providers; rename geminiClient to embedder (or aiClient) wherever used (the local declaration from ai.NewEmbedder, the subsequent defer geminiClient.Close(), and any other references such as the usage noted around line 147) and update the defer call to embedder.Close() and all usages to match the new name so the identifier reflects the provider-neutral ai.Embedder type.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@internal/integrations/ai/retry.go`:
- Around line 6-7: The package-level doc comment is stale ("Package gemini")
while the file declares package ai; update the top-of-file package comment to
read "Package ai ..." to match the declared package and godoc conventions so
tools and readers aren't misled; locate the comment immediately above the
package ai declaration and edit its text accordingly.
In `@internal/transfer/vdb_router.go`:
- Around line 140-142: The docstring and constructor name drift: the comment
refers to a non-existent symbol VDBRouterWithGeminiEmbedder and the exported
constructor NewVDBRouterFromGemini uses provider-specific wording in a
provider-neutral package; rename or add a neutral constructor (e.g.,
NewVDBRouterFromEmbedder) that calls NewVDBRouter(embedder, store, collection,
maxResults) and update the doc comment to reference that neutral name, then add
a thin deprecated alias function named VDBRouterWithGeminiEmbedder (or keep
NewVDBRouterFromGemini) that simply calls the new neutral constructor so
existing callers continue to work while new code uses the neutral API.
---
Nitpick comments:
In `@cmd/simili/commands/index.go`:
- Around line 92-96: The variable name geminiClient is misleading because
ai.NewEmbedder returns an *ai.Embedder that may wrap different providers; rename
geminiClient to embedder (or aiClient) wherever used (the local declaration from
ai.NewEmbedder, the subsequent defer geminiClient.Close(), and any other
references such as the usage noted around line 147) and update the defer call to
embedder.Close() and all usages to match the new name so the identifier reflects
the provider-neutral ai.Embedder type.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (25)
cmd/simili-web/main.gocmd/simili/commands/batch.gocmd/simili/commands/index.gocmd/simili/commands/learn.gocmd/simili/commands/process.gointernal/core/pipeline/registry.gointernal/integrations/ai/embedder.gointernal/integrations/ai/gemini_test.gointernal/integrations/ai/llm.gointernal/integrations/ai/prompts.gointernal/integrations/ai/provider.gointernal/integrations/ai/provider_test.gointernal/integrations/ai/retry.gointernal/integrations/ai/retry_test.gointernal/steps/duplicate_detector.gointernal/steps/indexer.gointernal/steps/llm_router.gointernal/steps/quality_checker.gointernal/steps/response_builder.gointernal/steps/response_builder_test.gointernal/steps/similarity.gointernal/steps/transfer_check.gointernal/steps/triage.gointernal/steps/vectordb_prep.gointernal/transfer/vdb_router.go
🧪 E2E Test✅ Bot responded: yes | Auto-closer (dry-run) | processed: 0 closed: 0 grace: 0 human: 0 | Test repo → gh-simili-bot/simili-e2e-22613358902 Auto-generated by E2E pipeline |
- retry.go: update package-level doc from "Package gemini" to "Package ai" to match the declared package name - vdb_router.go: rename NewVDBRouterFromGemini → NewVDBRouterFromEmbedder and fix its stale doc comment - index.go: rename local variable geminiClient → embedder to match the provider-neutral *ai.Embedder type - gemini_test.go → prompts_test.go: rename test file to a provider-neutral name consistent with the package rename Relates to #68 Signed-off-by: Kavirubc <hapuarachchikaviru@gmail.com>
The previous commit added prompts_test.go but did not stage the deletion of gemini_test.go, leaving both files tracked by git and causing duplicate function declaration errors in CI. Relates to #68 Signed-off-by: Kavirubc <hapuarachchikaviru@gmail.com>
🧪 E2E Test✅ Bot responded: yes | Auto-closer (dry-run) | processed: 0 closed: 0 grace: 0 human: 0 | Test repo → gh-simili-bot/simili-e2e-22613922911 Auto-generated by E2E pipeline |
Description
Renames
internal/integrations/gemini→internal/integrations/aito reflect that the package now supports multiple AI providers (Gemini and OpenAI), not just Gemini. This is a pure structural rename with no behaviour changes.Type of Change
Related Issues
Fixes #68
Changes Made
internal/integrations/ai/withpackage aideclarations (renamed frompackage gemini)embedder.gothat flagged the misleading package name; updated the package-level doc commentintegrations/gemini→integrations/aiin all 16 caller files acrossinternal/steps/,internal/transfer/,internal/core/pipeline/, andcmd/gemini.Xpackage qualifiers toai.Xat every call siteinternal/integrations/gemini/directoryTesting
go build ./...successfullygo test ./...successfullygo vet ./...successfullyChecklist
Additional Notes
Three modular commits:
feat(integrations): add provider-neutral ai package— new directory with updated package declarationsrefactor: migrate all callers from integrations/gemini to integrations/ai— import path + qualifier updateschore(integrations): remove deprecated gemini package— deletion of old directorySummary by CodeRabbit
Release Notes
Refactor
Tests