Skip to content

Commit

Permalink
Fix for breaking change in langchain (#147)
Browse files Browse the repository at this point in the history
Fix for breaking change in langchain:

BaseLanguageModel was moved from

```python
from langchain.schema import BaseLanguageModel
```

To:

```python
    from langchain.base_language import BaseLanguageModel
```

Fix for this issue: #145
  • Loading branch information
eyurtsev authored May 2, 2023
1 parent e9da5ac commit 8ced7b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kor/extraction/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
from langchain import PromptTemplate
from langchain.chains import LLMChain
from langchain.docstore.document import Document
from langchain.schema import BaseLanguageModel

try: # Handle breaking change in langchain
from langchain.base_language import BaseLanguageModel
except ImportError:
from langchain.schema import BaseLanguageModel

from kor.encoders import Encoder, InputFormatter, initialize_encoder
from kor.extraction.typedefs import DocumentExtraction, Extraction
Expand Down

0 comments on commit 8ced7b8

Please sign in to comment.