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
即可
其他模块的替换也是类似的,可以根据自己的需要自行替换增强。
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
dify_rag-0.0.14.tar.gz
(30.8 kB
view hashes)
Built Distribution
dify_rag-0.0.14-py3-none-any.whl
(38.6 kB
view hashes)
Close
Hashes for dify_rag-0.0.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d840b211a8f6733c004c9ab1b1d48cf8435b2f8fcb00653059a4d6b5b76cf3b6 |
|
MD5 | 16a810afceffa16c1d573386f72486a7 |
|
BLAKE2b-256 | e4c42f1a3d2495799c3ab2fb81073b7919cf10f5b033c8f8b266b994ef8797e4 |