Skip to content

fixing langchain text splitter import#4981

Open
norbbrog wants to merge 1 commit intoPaddlePaddle:developfrom
norbbrog:fix_langchain_import
Open

fixing langchain text splitter import#4981
norbbrog wants to merge 1 commit intoPaddlePaddle:developfrom
norbbrog:fix_langchain_import

Conversation

@norbbrog
Copy link

@norbbrog norbbrog commented Feb 5, 2026

fixing langchain text splitter import to be compatible with langchain v0 and v1 as suggested in PaddlePaddle/PaddleOCR#17186

Note that the dependency on langchain may come not through the extra dependencies of paddlex[ie] in setup.py; in that case langchain <1.0 is not enforced

should also consider using "lazy" imports to postpone importing dependencies that may not be needed. The 'is_dep_available("langchain")' triggers the imports if langchain is installed as part of a larger project, even if the functionalities of paddlex[ie] are not needed

@paddle-bot
Copy link

paddle-bot bot commented Feb 5, 2026

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Feb 5, 2026
@CLAassistant
Copy link

CLAassistant commented Feb 5, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@Bobholamovic Bobholamovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also update .precommit/check_imports.py by adding an entry to MOD_TO_DEP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants