mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
[PR #1585] [MERGED] feat: add JSON and YAML extractors to dify_extractor #1970
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langgenius/dify-official-plugins/pull/1585
Author: @brianxiadong
Created: 8/26/2025
Status: ✅ Merged
Merged: 8/27/2025
Merged by: @crazywoola
Base:
feat/datasource← Head:feat/datasource📝 Commits (2)
c62ded8feat: add JSON and YAML extractors to dify_extractord5eaab3bump the version📊 Changes
5 files changed (+157 additions, -5 deletions)
View changed files
📝
tools/dify_extractor/manifest.yaml(+1 -1)📝
tools/dify_extractor/tools/dify_extractor.py(+6 -0)📝
tools/dify_extractor/tools/dify_extractor.yaml(+4 -4)➕
tools/dify_extractor/tools/json_extractor.py(+73 -0)➕
tools/dify_extractor/tools/yaml_extractor.py(+73 -0)📄 Description
Add JSON and YAML Extractors to Dify Extractor
Overview
This PR adds support for JSON and YAML file extraction to the
dify_extractortool, expanding its capabilities to handle structured data formats commonly used in configuration files, APIs, and data exchange.close https://github.com/langgenius/dify/issues/24530
close https://github.com/langgenius/dify/issues/24529
Changes Made
New Files Added
tools/json_extractor.py: ImplementsJSONExtractorclass for parsing JSON filestools/yaml_extractor.py: ImplementsYAMLExtractorclass for parsing YAML filesModified Files
tools/dify_extractor.py: Updated to integrate the new extractorstools/dify_extractor.yaml: Updated configuration to support.jsonand.yaml/.ymlfile extensionsFeatures
JSON Extractor
YAML Extractor
.yamland.ymlfile extensionsTechnical Implementation
Architecture
Both extractors follow the established pattern:
BaseExtractorabstract classextract()methodExtractorResultwith formatted content and metadataError Handling
Output Format
Both extractors convert structured data to Markdown format:
Testing
The implementation includes comprehensive error handling and has been tested with:
Benefits
Backward Compatibility
This change is fully backward compatible:
Usage Examples
JSON Files
YAML Files
Both file types will be converted to searchable Markdown format while preserving their structure and readability.
Future Enhancements
This foundation enables future support for:
Type: Feature Enhancement
Impact: Low Risk - Additive functionality only
Testing: Manual testing completed for various file formats and edge cases
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.