Skip to content
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

feature. add feat to modify metadata via dataset api #13116

Merged

Conversation

aplio
Copy link
Contributor

@aplio aplio commented Jan 30, 2025

Summary

Allow user to change document's metadata via dataset api.
closes #13114

Sample curl command to be tested.

curl --location --request POST 'http://127.0.0.1:5001/v1/datasets/${UUID}/document/create-by-file' \
--header 'Authorization: Bearer ${API_KEY}' \
--form 'data="{
  \"indexing_technique\":\"high_quality\",
  \"process_rule\":{
    \"rules\":{
      \"pre_processing_rules\":[
        {\"id\":\"remove_extra_spaces\",\"enabled\":true},
        {\"id\":\"remove_urls_emails\",\"enabled\":true}
      ],
      \"segmentation\":{
        \"separator\":\"###\",
        \"max_tokens\":500
      }
    },
    \"mode\":\"custom\"
  },
  \"doc_type\": \"book\",
  \"doc_metadata\": {
    \"title\": \"Sample Book\",
    \"author\": \"John Doe\",
    \"language\": \"English\",
    \"publisher\": \"Sample Publisher\",
    \"publication_date\": \"2024-01-01\",
    \"isbn\": \"123-456-789\",
    \"category\": \"Fiction\"
  }, \"duplicate\":false
}";type=text/plain' \
--form 'file=@"./README.md"'

Screenshots

Before After

|
スクリーンショット 2025-01-30 22 01 37
| スクリーンショット 2025-01-30 22 01 07 |

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. 💪 enhancement New feature or request 📚 documentation Improvements or additions to documentation labels Jan 30, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 31, 2025
@crazywoola crazywoola force-pushed the feature/allow-modify-metadata-via-api branch from 8b1153c to ef39389 Compare February 2, 2025 07:03
@crazywoola crazywoola merged commit d73d191 into langgenius:main Feb 2, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 documentation Improvements or additions to documentation 💪 enhancement New feature or request lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow user to modify or add metadata when creating document via api.
2 participants