community[patch]: fix import in language parser (#17538)

- **Description:** Resolving import error in language_parser.py during
"from langchain.langchain.text_splitter import Language - **Issue:** the
issue #17536
- **Dependencies:** NO
- **Twitter handle:** @iRakibHosen

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
Rakib Hosen 2024-02-15 01:11:23 +06:00 committed by GitHub
parent 685d62b032
commit 5ce1827d31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -27,10 +27,10 @@ from langchain_community.document_loaders.parsers.language.typescript import (
)
if TYPE_CHECKING:
from langchain.langchain.text_splitter import Language
from langchain.text_splitter import Language
try:
from langchain.langchain.text_splitter import Language
from langchain.text_splitter import Language
LANGUAGE_EXTENSIONS: Dict[str, str] = {
"py": Language.PYTHON,

View File

@ -843,6 +843,9 @@ class Language(str, Enum):
SOL = "sol"
CSHARP = "csharp"
COBOL = "cobol"
C = "c"
LUA = "lua"
PERL = "perl"
class RecursiveCharacterTextSplitter(TextSplitter):