Skip to content
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

Importing Cohere from langchain root module is no longer supported. #8

Open
ibrahim-string opened this issue Jan 18, 2024 · 1 comment

Comments

@ibrahim-string
Copy link

when I run test.py or test2.py either one gives me error.
I guess there are some updates required in the module importing part.

  warnings.warn(
D:\github\virenv\Lib\site-packages\langchain\__init__.py:29: UserWarning: Importing LLMChain from langchain root module is no longer supported. Please use langchain.chains.LLMChain instead.
  warnings.warn(
D:\github\virenv\Lib\site-packages\langchain\__init__.py:29: UserWarning: Importing OpenAI from langchain root module is no longer supported. Please use langchain_community.llms.OpenAI instead.
  warnings.warn(
D:\github\virenv\Lib\site-packages\langchain\chat_models\__init__.py:31: LangChainDeprecationWarning: Importing chat models from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

`from langchain_community.chat_models import ChatOpenAI`.

To install langchain-community run `pip install -U langchain-community`.
  warnings.warn(
D:\github\virenv\Lib\site-packages\langchain\llms\__init__.py:548: LangChainDeprecationWarning: Importing LLMs from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

`from langchain_community.llms import AI21`.

To install langchain-community run `pip install -U langchain-community`.
  warnings.warn(
Traceback (most recent call last):
  File "d:\github\blackmaria\blackmaria\examples\test2.py", line 1, in <module>
    from blackmaria import maria
  File "D:\github\virenv\Lib\site-packages\blackmaria\maria.py", line 11, in <module>
    from gpt_index import (GPTSimpleVectorIndex, PromptHelper,
  File "D:\github\virenv\Lib\site-packages\gpt_index\__init__.py", line 18, in <module>
    from gpt_index.indices.common.struct_store.base import SQLDocumentContextBuilder
  File "D:\github\virenv\Lib\site-packages\gpt_index\indices\__init__.py", line 4, in <module>
    from gpt_index.indices.keyword_table.base import GPTKeywordTableIndex
  File "D:\github\virenv\Lib\site-packages\gpt_index\indices\keyword_table\__init__.py", line 4, in <module>
    from gpt_index.indices.keyword_table.base import GPTKeywordTableIndex
  File "D:\github\virenv\Lib\site-packages\gpt_index\indices\keyword_table\base.py", line 16, in <module>
    from gpt_index.indices.base import DOCUMENTS_INPUT, BaseGPTIndex
  File "D:\github\virenv\Lib\site-packages\gpt_index\indices\base.py", line 23, in <module>
    from gpt_index.indices.prompt_helper import PromptHelper
  File "D:\github\virenv\Lib\site-packages\gpt_index\indices\prompt_helper.py", line 12, in <module>    
    from gpt_index.langchain_helpers.chain_wrapper import LLMPredictor
  File "D:\github\virenv\Lib\site-packages\gpt_index\langchain_helpers\chain_wrapper.py", line 6, in <module>
    from gpt_index.llm_predictor.base import (  # noqa: F401
  File "D:\github\virenv\Lib\site-packages\gpt_index\llm_predictor\__init__.py", line 4, in <module>    
    from gpt_index.llm_predictor.base import LLMPredictor
  File "D:\github\virenv\Lib\site-packages\gpt_index\llm_predictor\base.py", line 12, in <module>       
    from langchain.schema import BaseLanguageModel
ImportError: cannot import name 'BaseLanguageModel' from 'langchain.schema' (D:\github\virenv\Lib\site-packages\langchain\schema\__init__.py)```
@ibrahim-string
Copy link
Author

I am working on this issue as of now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant