-
Notifications
You must be signed in to change notification settings - Fork 19.2k
feat(improve-api-endpoints): Added Datasets and Annotation APIs #12237
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
Conversation
- Added AnnotationReplyActionApi, AnnotationListApi, AnnotationUpdateDeleteApi - Added GET and PATCH endpoints to DatasetApi - Applied current_user in validate_app_token just like what it is done in validate_dataset_token Related to: langgenius#11727
This API endpoint shares the same API token with Dataset API. It is essential for patching the knowledge base in terms of embedding model. Related to: langgenius#11727
Related to: PR#12237(langgenius/dify#12237)
Because app token is assigned to a specific app, the validate_app_token decorator has already validated the app_id. The returned app_model is the app targeted. Therefore there is no need to pass app_id separately. Simply use app_model.id instead. So app_id is removed from the api routes. Related to: langgenius#11727
|
Please fix the errors in CI. |
Errors fixed. |
Please run |
Sorry for the trouble. Code has now been reformated. |
|
The code part LGTM, however you should add according docs to the API Access as well in CN, EN & JA. |
The relevant docs have been added and amended outdated part. I have included both Chinese and English versions. However as I do not speak Japanese, I wouldn't be able to verify the translated version therefore I would wait for a Japanese contributor get it translated in a later time. |
Could you let me know when this PR will be merged? How does dify team manage PRs? When do PRs ususally get merged? |
It is added to Chat App due to Annotation is under Apps, and there is no individual Annotation API doc page. It seems correct to have Annotation APIs put here.
Outcome
Suggestion:I have always been wondering why there are docs.dify.ai and these API docs in the portal. It does not only confuse developers but also becomes a nightmare for contributors like me. I personally don't know mdx and my VSCode doesn't provide preview for mdx. It would be a lot better if we can consolidate all docs to the same place without having to prepare duplicate docs all over the places. docs.dify.ai is already a built up platform hosting our docs. using markdown is also a standard way for the community to prepare docs. Anyway, I'm just a newbie contributor. Dify team might have been preparing a new doc platform. So it's your call. |
|
@JohnJyong Happy New Year. Just a follow up on this PR. Please kindly process at your earliest convenience. |
Hi, I was wondering if you could speed up the merge of this PR? I'm desparately willing to use these APIs for my project. Thanks |
Update to lastest version
|
@crazywoola Could you please clarify that version 1.0 has got these APIs implemented? The Dify Doc PR got denied due to not planned. If this is never gonna be a feature in the official package, then I won't be bothered to contribute. My pay rate is too high to be wasted. Very much disappointed that when other contributors spent quite some time but received no response. |
Sorry for the late response, this is a great feature that we would like to have. I know that the explanation is rather insipid. The fact is, we had a major infra update this week. So most of the PRs can not get merged during this time. Can you resolve the conflicts, I will merged it asap. :) |
|
Thanks for the reply, I will arrange a time to get the conflicts sorted. |
Cool Thanks, sorry for the inconvience. |
Hi Crazywoola, I have managed to get the conflicts resolved. New doc added by other contributors did get honoured so no info missed. Please help get this PR merged to prevent further conflicts at your earliest convenience. Very much appreciated! Jason |
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.
Copilot reviewed 5 out of 11 changed files in this pull request and generated 1 comment.
Files not reviewed (6)
- web/app/(commonLayout)/datasets/template/template.en.mdx: Language not supported
- web/app/(commonLayout)/datasets/template/template.zh.mdx: Language not supported
- web/app/components/develop/template/template.zh.mdx: Language not supported
- web/app/components/develop/template/template_advanced_chat.en.mdx: Language not supported
- web/app/components/develop/template/template_advanced_chat.zh.mdx: Language not supported
- web/app/components/develop/template/template_chat.en.mdx: Language not supported
Comments suppressed due to low confidence (1)
api/controllers/service_api/dataset/dataset.py:156
- The retrieval and update for 'partial_member_list' is performed twice in the GET method which appears redundant. Consider removing one of the duplicate calls to streamline the response assembly.
if data.get("permission") == "partial_members":






Close #11727
Summary
Basically copied the functions from console to the service api. Also added clear_partial_member_list() to Dataset Delete endpoint as what has been added in the console api.
I will keep working on this feature until it fulfills my needs. More endpoints will be added.
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