Skip to content

Go: fix compilation - #14418

Merged
JinHai-CN merged 1 commit into
infiniflow:mainfrom
JinHai-CN:fix401
Apr 28, 2026
Merged

JinHai-CN merged 1 commit into
infiniflow:mainfrom
JinHai-CN:fix401

Conversation

@JinHai-CN

Copy link
Copy Markdown
Member

What problem does this PR solve?

Add methods to volcengine

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

Signed-off-by: Jin Hai <[email protected]>
@JinHai-CN JinHai-CN added the ci Continue Integration label Apr 28, 2026
@coderabbitai

coderabbitai Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b35fb16a-a309-4e02-9cc2-11d5ac7a10f1

📥 Commits

Reviewing files that changed from the base of the PR and between effc84a and 1166a95.

📒 Files selected for processing (5)
  • internal/entity/models/types.go
  • internal/entity/models/volcengine.go
  • internal/service/model_service.go
  • internal/service/nlp/reranker.go
  • internal/service/nlp/retrieval.go

📝 Walkthrough

Walkthrough

Changes refactor model name storage from string to *string across EmbeddingModel, RerankModel, and ChatModel types. Model wrapper constructors are updated to accept pointer model names. Three new convenience methods are added to VolcEngine with "not implemented" stubs. One method is removed from ModelProviderService, and call sites are updated to pass model names by value instead of by reference.

Changes

Cohort / File(s) Summary
Model Type Definitions
internal/entity/models/types.go
Updated EmbeddingModel, RerankModel, and ChatModel to store ModelName as *string instead of string. Constructor functions (NewEmbeddingModel, NewRerankModel, NewChatModel) now accept *string parameters. RerankModel.Rerank adjusted to pass ModelName directly without pointer reference.
VolcEngine Driver Methods
internal/entity/models/volcengine.go
Added three new convenience methods: Encode, EncodeQuery, and Rerank, each accepting *string model names and returning "not implemented" errors.
Model Service
internal/service/model_service.go
Removed ChatToModelByApiKey method. Updated embedding, rerank, and chat model wrapper construction to pass model names by pointer (&modelName) to constructors.
NLP Service
internal/service/nlp/reranker.go, internal/service/nlp/retrieval.go
Updated RerankByModel and GetVector to pass model names by value instead of by pointer when invoking driver methods.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Go: add volcengine #14409: Modifies VolcEngine model driver and adjusts modelName pointer signatures, aligning with the model name pointer refactoring in this PR.

Suggested labels

size:L

Poem

🐰 Pointers now hold the model's name so true,
Dereferencing with care, signatures updated through,
VolcEngine awaits its future day,
While builders pass references the go-ish way!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete; it states 'Add methods to volcengine' but omits the significant refactoring of model name types from string to *string across multiple files, and provides no technical detail explaining what compilation issue is being resolved. Expand the description to explain both the pointer type refactoring and the new VolcEngine methods, including the specific compilation error being fixed.
Title check ❓ Inconclusive The title 'Go: fix compilation' is vague and generic, failing to convey the specific nature of the changes (shifting model names to pointers and adding VolcEngine methods). Consider a more descriptive title that captures the primary change, such as 'Use pointers for ModelName in model wrappers and add VolcEngine stub methods' or 'Fix compilation: use pointer types for model names.'
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JinHai-CN
JinHai-CN marked this pull request as ready for review April 28, 2026 05:14
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 28, 2026
@JinHai-CN
JinHai-CN merged commit ae420f6 into infiniflow:main Apr 28, 2026
1 check passed
@codecov

codecov Bot commented Apr 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.30%. Comparing base (819257f) to head (1166a95).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14418   +/-   ##
=======================================
  Coverage   95.30%   95.30%           
=======================================
  Files          10       10           
  Lines         703      703           
  Branches      112      112           
=======================================
  Hits          670      670           
  Misses         16       16           
  Partials       17       17           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant