-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
fix: fix retrieve input restriction. #16744
base: main
Are you sure you want to change the base?
fix: fix retrieve input restriction. #16744
Conversation
When calling the interface, only check for the existence of the query without considering character limitations. Closes langgenius#16724
@@ -42,6 +42,11 @@ def get_and_validate_dataset(dataset_id: str): | |||
def hit_testing_args_check(args): | |||
HitTestingService.hit_testing_args_check(args) | |||
|
|||
@staticmethod | |||
def retrieval_args_check(args): |
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.
hit-testing
is the same with retrieve
.
retrieve
is the new endpoint- We keep the
hit-testing
mainly because we do not want to break existing applications.
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.
May I ask how many characters do you need, it seems 250 is enough for most of the cases.
Are there any examples?
- Dead code should also be removed
- Please fix the lint errors as well.
query's max length limit is required , you can make the value as an env variable, so you can changed it in your local server. |
Sorry for the delayed response. I had some matters to attend to today. Use a knowledge base for dynamic semantic deduplication. The reason for the second scenario is that we need to choose the knowledge base from three dimensions, one of which increases over time. We do not want to frequently modify the application (modifying the application carries risks). My idea is to store these configuration relationships in the database. When a user asks a question, retrieve the desired knowledge base from the database based on different dimensions, and then call the app with the result returned by the retrieve interface as a parameter. The user's questions cannot be controlled, and currently, the limit of 250 characters is indeed a bit short. I originally intended to write a separate RetrieveApi to differentiate between retrieve and hit_test, but I am not that familiar with Python web development, so I did not make any changes. Additionally, hit_testing_args_check is used in the api/controllers/datasets/hit_testing.py file. This time, I have only made modifications to the api/controllers/service_api/dataset/hit_testing.py file. |
When calling the interface, only check for the existence of the query without considering character limitations.
Closes #16724
Summary
Resolves #<16724>
Screenshots
| Before | After |
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