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 即可

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

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.0.27.tar.gz (39.7 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.0.27-py3-none-any.whl (51.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dify_rag-0.0.27.tar.gz
  • Upload date:
  • Size: 39.7 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.0.27.tar.gz
Algorithm Hash digest
SHA256 391179b07c3007f4eac7768d6314aa48e14de2eece6ca357e302ef5e28e02b46
MD5 3fe755f560bfed0bec0eda406c781b2c
BLAKE2b-256 10ed9e32ed169a54f6dac8c091f8d8619f767814f2dd025d0ed9d8b711ddb25c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dify_rag-0.0.27-py3-none-any.whl
  • Upload date:
  • Size: 51.8 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.0.27-py3-none-any.whl
Algorithm Hash digest
SHA256 2e530ae6229dbb0a139b7db29d944f216dd1395107467a54b7b7088c79b7eac3
MD5 868793dc248a11b809c5c06763393f02
BLAKE2b-256 c39914fa70ff453dbc57ab36849f5712befcfc4c036957a2e63fda33d4f21af9

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