-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add retireval_top_n to config in env #11132
Conversation
4987220
to
1846793
Compare
6f4e2d5
to
a07a5e1
Compare
Yes, this is only a temporary solution for users with a rag background. Adding relevant parameters on the page side would involve product design, so we have not made any relevant modifications. |
@@ -3,6 +3,7 @@ | |||
|
|||
from flask import Flask, current_app | |||
|
|||
from configs import DifyConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the wrong way to use the config object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I made a stupid mistake and caused a bad impact on your, but the revised submission
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ProseGuys We reverted this change in this version and reopened the related issue.
Summary
Solution: Add a new retrieval-related parameter
top_n
in the environment variables. During the retrieval process, use the defaulttop_k
parameter to obtain thetop_k
most relevant slices. When reranking, use thetop_n
parameter to return thetop_n
slices.Tip
Close issue syntax:
Fixes #<issue number>
orResolves #<issue number>
, see documentation for more details.Resolves #11068
Screenshots
Checklist
Important
Please review the checklist below before submitting your pull request.
dev/reformat
(backend) andcd web && npx lint-staged
(frontend) to appease the lint gods