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 格式,支持按行切分 |
| 部分支持,需本身有目录信息 | 不支持 | |
| epub | 支持 | 支持独立拆分,支持转换 markdown 格式,支持按行切分 |
| xlsx | 支持 | 支持独立拆分,支持转换 markdown 格式,支持按行切分 |
| csv | 支持 | 支持独立拆分,支持转换 markdown 格式,支持按行切分 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dify_rag-0.1.6.tar.gz.
File metadata
- Download URL: dify_rag-0.1.6.tar.gz
- Upload date:
- Size: 48.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
804aa9bea2b575aa2f5a1fb1d075fb3fff4f4e6963fa1e277abbda621cfd2508
|
|
| MD5 |
7e9bee774670827fdc497dcce2c49ab6
|
|
| BLAKE2b-256 |
ad3369fe2249cba81723f695fe4e6e10611403983394f0f58f0901ccf5f106ea
|
File details
Details for the file dify_rag-0.1.6-py3-none-any.whl.
File metadata
- Download URL: dify_rag-0.1.6-py3-none-any.whl
- Upload date:
- Size: 64.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdc1b3f0e324d46cef72c8473b9f4b4dc1d55fd6652415fc292688fe59dbe01d
|
|
| MD5 |
8f0668b2c3ecd4d4333f468577c115b2
|
|
| BLAKE2b-256 |
42d074402edcb15f5bc015fd5e0e860ac67a98b7357df25fb7433b666a064279
|