Skip to content

Commit

Permalink
community[patch]: fix import in language parser (#17538)
Browse files Browse the repository at this point in the history
- **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 <[email protected]>
  • Loading branch information
Rakib-hosen and baskaryan authored Feb 14, 2024
1 parent 685d62b commit 5ce1827
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
)

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,
Expand Down
3 changes: 3 additions & 0 deletions libs/langchain/langchain/text_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,9 @@ class Language(str, Enum):
SOL = "sol"
CSHARP = "csharp"
COBOL = "cobol"
C = "c"
LUA = "lua"
PERL = "perl"


class RecursiveCharacterTextSplitter(TextSplitter):
Expand Down

0 comments on commit 5ce1827

Please sign in to comment.