Skip to content

fix(go-model): default Jina rerank top_n to document count - #17242

Merged
JinHai-CN merged 7 commits into
infiniflow:mainfrom
Harry-Hz-Zhang:fix/jina-rerank
Jul 24, 2026
Merged

JinHai-CN merged 7 commits into
infiniflow:mainfrom
Harry-Hz-Zhang:fix/jina-rerank

Conversation

@Harry-Hz-Zhang

Copy link
Copy Markdown
Contributor

Summary

  • Default Jina rerank top_n to the document count
  • Add coverage for default and explicitly configured top_n values

Testing

  • bash build.sh --test -c -o /tmp/ragflow-models.test ./internal/entity/models
  • git diff --check

@Harry-Hz-Zhang Harry-Hz-Zhang added 🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration labels Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: df5576f1-2c69-4c24-b934-b69c2398cdee

📥 Commits

Reviewing files that changed from the base of the PR and between 8bfc292 and fd33cbb.

📒 Files selected for processing (1)
  • internal/entity/models/jina_test.go

📝 Walkthrough

Walkthrough

Jina reranking now defaults top_n to the input document count and applies smaller positive TopN values. A mock endpoint test verifies the default request value.

Changes

Jina rerank top_n behavior

Layer / File(s) Summary
Top_n selection and validation
internal/entity/models/jina.go, internal/entity/models/jina_test.go
Rerank defaults top_n to the document count, conditionally applies smaller positive TopN values, and tests the default request value.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: jinhai-cn

Poem

A rabbit counts each doc in line,
Sets rerank tops just right and fine.
A mock request confirms the way,
Two documents guide the day.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: defaulting Jina rerank top_n to the document count.
Description check ✅ Passed The description matches the required Summary template and includes relevant testing details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 22, 2026
@Harry-Hz-Zhang
Harry-Hz-Zhang marked this pull request as draft July 22, 2026 07:55
@Harry-Hz-Zhang
Harry-Hz-Zhang marked this pull request as ready for review July 22, 2026 07:55
# 请输入一个提交信息以解释此合并的必要性,尤其是将一个更新后的上游分支
# 合并到主题分支。
#
# 以 '#' 开始的行将被忽略,而空的提交说明将终止提交。
…flow into fix/jina-rerank

# 请输入一个提交信息以解释此合并的必要性,尤其是将一个更新后的上游分支
# 合并到主题分支。
#
# 以 '#' 开始的行将被忽略,而空的提交说明将终止提交。
@JinHai-CN
JinHai-CN merged commit e66d617 into infiniflow:main Jul 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants