The package is broken as it runs into ImportError when we invoke gpt github review command on CLI.
ImportError: cannot import name 'BaseCache' from 'langchain' (/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/langchain/__init__.py)
A suggestion was made to install specific version of some packages as described in Issue # 208
Traceback (most recent call last):
File "/home/emumba/Documents/emumba/gpt-review/.env/bin/gpt", line 5, in <module>
from gpt_review.main import __main__
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/gpt_review/main.py", line 6, in <module>
from gpt_review._gpt_cli import cli
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/gpt_review/_gpt_cli.py", line 9, in <module>
from gpt_review._ask import AskCommandGroup
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/gpt_review/_ask.py", line 13, in <module>
from gpt_review._openai import _call_gpt
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/gpt_review/_openai.py", line 6, in <module>
from openai.error import RateLimitError
ModuleNotFoundError: No module named 'openai.error'
I want to run it with AzureOpenAI. It would be great if we can get a running example of a GitHub Action with Azure OpenAI.
To reproduce
Simply follow the commands provided in the workflow.
$ gpt github review
/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/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 AzureChatOpenAI`.
To install langchain-community run `pip install -U langchain-community`.
warnings.warn(
/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/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(
/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/langchain/embeddings/__init__.py:29: LangChainDeprecationWarning: Importing embeddings 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.embeddings import OpenAIEmbeddings`.
To install langchain-community run `pip install -U langchain-community`.
warnings.warn(
/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/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 AzureOpenAI`.
To install langchain-community run `pip install -U langchain-community`.
warnings.warn(
/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/langchain/__init__.py:29: UserWarning: Importing Cohere from langchain root module is no longer supported. Please use langchain_community.llms.Cohere instead.
warnings.warn(
/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/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(
/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/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(
Traceback (most recent call last):
File "/home/emumba/Documents/emumba/gpt-review/.env/bin/gpt", line 5, in <module>
from gpt_review.main import __main__
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/gpt_review/main.py", line 6, in <module>
from gpt_review._gpt_cli import cli
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/gpt_review/_gpt_cli.py", line 9, in <module>
from gpt_review._ask import AskCommandGroup
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/gpt_review/_ask.py", line 12, in <module>
from gpt_review._llama_index import _query_index
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/gpt_review/_llama_index.py", line 10, in <module>
from llama_index import (
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/llama_index/__init__.py", line 19, in <module>
from llama_index.indices.common.struct_store.base import SQLDocumentContextBuilder
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/llama_index/indices/__init__.py", line 4, in <module>
from llama_index.indices.keyword_table.base import GPTKeywordTableIndex
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/llama_index/indices/keyword_table/__init__.py", line 4, in <module>
from llama_index.indices.keyword_table.base import GPTKeywordTableIndex
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/llama_index/indices/keyword_table/base.py", line 18, in <module>
from llama_index.indices.base import BaseGPTIndex
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/llama_index/indices/base.py", line 6, in <module>
from llama_index.chat_engine.types import BaseChatEngine, ChatMode
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/llama_index/chat_engine/__init__.py", line 1, in <module>
from llama_index.chat_engine.condense_question import CondenseQuestionChatEngine
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/llama_index/chat_engine/condense_question.py", line 5, in <module>
from llama_index.chat_engine.utils import to_chat_buffer
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/llama_index/chat_engine/utils.py", line 6, in <module>
from llama_index.indices.service_context import ServiceContext
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/llama_index/indices/service_context.py", line 9, in <module>
from llama_index.indices.prompt_helper import PromptHelper
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/llama_index/indices/prompt_helper.py", line 13, in <module>
from llama_index.llm_predictor.base import BaseLLMPredictor
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/llama_index/llm_predictor/__init__.py", line 4, in <module>
from llama_index.llm_predictor.base import LLMPredictor
File "/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/llama_index/llm_predictor/base.py", line 11, in <module>
from langchain import BaseCache, Cohere, LLMChain, OpenAI
ImportError: cannot import name 'BaseCache' from 'langchain' (/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/langchain/__init__.py)
Module path
gpt github review
review-gpt CLI version
v0.9.5
Describe the bug
The package is broken as it runs into ImportError when we invoke
gpt github review
command on CLI.ImportError: cannot import name 'BaseCache' from 'langchain' (/home/emumba/Documents/emumba/gpt-review/.env/lib/python3.8/site-packages/langchain/__init__.py)
A suggestion was made to install specific version of some packages as described in Issue # 208
However, after this we run into new error:
I want to run it with AzureOpenAI. It would be great if we can get a running example of a GitHub Action with Azure OpenAI.
To reproduce
Simply follow the commands provided in the workflow.
Code snippet
Relevant log output