Skip to main content

dify's rag patch module

Project description

Dify-RAG

高效模块化的 RAG 包,可以快速替换 Dify 中原有的默认模块,大幅提升 Dify 的 RAG 效果。作为通用的基础包,也可以用于其他开源 RAG 服务。

安装

pip install dify-rag

为了在 Dify 项目中使用,可以在 api/pyproject.toml 中添加 dify-rag 依赖,之后调用 poetry lock --no-update 更新依赖,即可在 Dify 项目中使用 Dify-RAG 包。

使用

目前实现的模块是直接可以插拔放入 Dify 项目中的,只需要在 Dify 项目中替换掉相关模块即可。下面以 html 解析为例:

api/core/rag/extractor/extract_processor.py 中将原先使用 Dify 内置的 HtmlExtractor 切换为 Dify-RAG 中的 HtmlExtractor 即可。

具体需要将原有的 from core.rag.extractor.html_extractor import HtmlExtractor 替换为 from dify_rag.extractor.html_extractor import HtmlExtractor 即可

其他模块的替换也是类似的,可以根据自己的需要自行替换增强。

支持的文档格式

格式 结构化解析 表格解析
html 支持 支持独立拆分,支持转换 markdown 格式,支持按行切分
md 支持 支持独立拆分,支持 markdown 格式,支持按行切分
docx 支持 支持独立拆分,支持转换 markdown 格式,支持按行切分
pdf 部分支持,需本身有目录信息 不支持
epub 支持 支持独立拆分,支持转换 markdown 格式,支持按行切分
xlsx 支持 支持独立拆分,支持转换 markdown 格式,支持按行切分
csv 支持 支持独立拆分,支持转换 markdown 格式,支持按行切分

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dify_rag-0.1.0.tar.gz (47.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dify_rag-0.1.0-py3-none-any.whl (63.4 kB view details)

Uploaded Python 3

File details

Details for the file dify_rag-0.1.0.tar.gz.

File metadata

  • Download URL: dify_rag-0.1.0.tar.gz
  • Upload date:
  • Size: 47.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.9

File hashes

Hashes for dify_rag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4754fc0915270b1a9c3d909a0298f61ae7a4d072436af83ff06c308d9028ceef
MD5 94a5001eefe5fa6df145b2bf282354fe
BLAKE2b-256 81395067af12886d0fb9dd26b43ad2c469d3e34b57b06315d89c0685fb1edb3d

See more details on using hashes here.

File details

Details for the file dify_rag-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dify_rag-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 63.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.9

File hashes

Hashes for dify_rag-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 792de0a18deb71f0b9f2ce13270beaf4cb7eed87ad6fefaeb3d430fb728370bb
MD5 56f1620026412e6f1f368769cb376e25
BLAKE2b-256 a7348bcaff53b7266bf150a0041b361fefc17285766c0639a95d0f5e0c527f3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page