-
Notifications
You must be signed in to change notification settings - Fork 15.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
text-splitters: Add JSFrameworkTextSplitter for Handling JavaScript Framework Code #28972
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be implemented as a new case in the get_separators_for_language method?
hi @ccurme, we need the special method to handle React component tags (such as |
…broader JS frameworks
Description
This pull request introduces a new text splitter,
JSFrameworkTextSplitter
, to the Langchain library. TheJSFrameworkTextSplitter
extends theRecursiveCharacterTextSplitter
to handle JavaScript framework code effectively, including React (JSX), Vue, and Svelte. It identifies and utilizes framework-specific component tags and syntax elements as splitting points, alongside standard JavaScript syntax. This ensures that code is divided at natural boundaries, enhancing the parsing and processing of JavaScript and framework-specific code.Key Features
RecursiveCharacterTextSplitter
for seamless integration.Issue
No specific issue addressed.
Dependencies
No additional dependencies required.