-
Notifications
You must be signed in to change notification settings - Fork 808
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
Will this no longer work? #63
Comments
This is the imports that worked for me: import openai import constants` If you are using conda to install packages, I would suggest using python -m pip install langchain-openai langchain-community langchain-core in your conda environment, and avoid using conda install, so that your conda can actually find these packages. |
`import os import openai import constants os.environ["OPENAI_API_KEY"] = constants.APIKEY PERSIST = False query = None if PERSIST and os.path.exists("persist"): chain = ConversationalRetrievalChain.from_llm( chat_history = [] chat_history.append((query, result['answer'])) when I run - python chatgpt.py "What is my name" |
have you installed langchain-core and langchain-community manually using pip install? Check if your Python interpreter can find these packages, e.g. go to site-packages |
`import os import openai import constants os.environ["OPENAI_API_KEY"] = constants.APIKEY Enable to save to disk & reuse the model (for repeated queries on the same data)PERSIST = False query = None if PERSIST and os.path.exists("persist"): chain = ConversationalRetrievalChain.from_llm( chat_history = [] chat_history.append((query, result['answer'])) output: still same |
It does not make sense to fix these errors one by one. I had to completely rewrite it, but it still is not as good as I wanted. Here I wrote about my experience, my script included https://yastr.dev/posts/genai-rag-pitfalls/ |
@LevYas thank you for your updates on that. Your Version looks really good and its actually workin for me |
Traceback (most recent call last):
File "/Users/sooraj/Documents/chat/chatgpt-retrieval/chatgpt.py", line 6, in
from langchain.chat_models import ChatOpenAI
File "/opt/homebrew/lib/python3.12/site-packages/langchain/chat_models/init.py", line 27, in getattr
from langchain_community import chat_models
ModuleNotFoundError: No module named 'langchain_community'
iconv: iconv_open(, -t): Invalid argument
Error converting string from to UTF-8
The text was updated successfully, but these errors were encountered: