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

ImportError: cannot import name 'AsyncCallbackManager' from 'langchain.callbacks.base' (/usr/local/Python-3.11.3/lib/python3.11/site-packages/langchain/callbacks/base.py) #70

Closed
dahaoGPT opened this issue May 1, 2023 · 8 comments

Comments

@dahaoGPT
Copy link

dahaoGPT commented May 1, 2023

when i run ‘make start’ command ,i meet the error ‘ImportError: cannot import name 'AsyncCallbackManager' from 'langchain.callbacks.base' (/usr/local/Python-3.11.3/lib/python3.11/site-packages/langchain/callbacks/base.py)’ ,
i have already install the langchain and make the path correct
is that 'AsyncCallbackManager' has removed or what can i do to sovle the problem ?thx for help

@dahaoGPT
Copy link
Author

dahaoGPT commented May 2, 2023

I solved this problem to install version 0.0.142,here is command "pip install langchain==0.0.142"

@HKAB
Copy link

HKAB commented May 2, 2023

Try from langchain.callbacks.manager import AsyncCallbackManager

@dahaoGPT
Copy link
Author

dahaoGPT commented May 2, 2023

Try from langchain.callbacks.manager import AsyncCallbackManager

nice job,i use this solve the problem and update to the latest version 0.0.155,but meet another problem
File "/usr/local/chat-langchain/chat-langchain/query_data.py", line 52, in get_chain
qa = ConversationalRetrievalChain(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Python-3.11.3/lib/python3.11/site-packages/pydantic/main.py", line 341, in init
raise validation_error
pydantic.error_wrappers.ValidationError: 2 validation errors for ConversationalRetrievalChain
retriever
field required (type=value_error.missing)
vectorstore
extra fields not permitted (type=value_error.extra)

@dahaoGPT
Copy link
Author

dahaoGPT commented May 2, 2023

Try from langchain.callbacks.manager import AsyncCallbackManager

nice job,i use this solve the problem and update to the latest version 0.0.155,but meet another problem File "/usr/local/chat-langchain/chat-langchain/query_data.py", line 52, in get_chain qa = ConversationalRetrievalChain( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Python-3.11.3/lib/python3.11/site-packages/pydantic/main.py", line 341, in init raise validation_error pydantic.error_wrappers.ValidationError: 2 validation errors for ConversationalRetrievalChain retriever field required (type=value_error.missing) vectorstore extra fields not permitted (type=value_error.extra)

i didn't follow all the operation on the pull request , when i add the extra fields to the 'ConversationalRetrievalChain' ,it runs .

@dahaoGPT
Copy link
Author

dahaoGPT commented May 2, 2023

the same issue as 69 ,so i close it ,we are create the issue at the same time.

@dahaoGPT dahaoGPT closed this as completed May 2, 2023
@amoseev
Copy link

amoseev commented May 9, 2023

Please accept fix
#73

@tianyalangzi
Copy link

Try from langchain.callbacks.manager import AsyncCallbackManager 尝试 from langchain.callbacks.manager import AsyncCallbackManager

nice job,i use this solve the problem and update to the latest version 0.0.155,but meet another problem File "/usr/local/chat-langchain/chat-langchain/query_data.py", line 52, in get_chain qa = ConversationalRetrievalChain( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Python-3.11.3/lib/python3.11/site-packages/pydantic/main.py", line 341, in init raise validation_error pydantic.error_wrappers.ValidationError: 2 validation errors for ConversationalRetrievalChain retriever field required (type=value_error.missing) vectorstore extra fields not permitted (type=value_error.extra)干得好,我使用它解决问题并更新到最新版本 0.0.155,但遇到另一个问题 文件“/usr/local/chat-langchain/chat-langchain/query_data.py”,第 52 行,get_chain qa = ConversationalRetrievalChain( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 文件 “/usr/local/Python-3.11.3/lib/python3.11/site-packages/pydantic/main.py”,第 341 行,在 init raise validation_error pydantic.error_wrappers。验证错误:会话检索链检索器字段需要 2 个验证错误(类型=value_error.缺失) 不允许向量存储额外字段(type=value_error.extra)

i didn't follow all the operation on the pull request , when i add the extra fields to the 'ConversationalRetrievalChain' ,it runs .我没有遵循拉取请求的所有操作,当我将额外的字段添加到“对话检索链”时,它会运行。

@dahaoGPT I have the same error.
qa = ConversationalRetrievalChain(
vectorstore = vectorstore.as_retriever().
combine_docs_chain=doc_chain.
question_generator=question_generator.
callback_manager=manager
) After adding any additional fields, can you let us know? Thanks!

@sgch1982
Copy link

sgch1982 commented Jun 6, 2023

Try from langchain.callbacks.manager import AsyncCallbackManager

nice job,i use this solve the problem and update to the latest version 0.0.155,but meet another problem File "/usr/local/chat-langchain/chat-langchain/query_data.py", line 52, in get_chain qa = ConversationalRetrievalChain( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Python-3.11.3/lib/python3.11/site-packages/pydantic/main.py", line 341, in init raise validation_error pydantic.error_wrappers.ValidationError: 2 validation errors for ConversationalRetrievalChain retriever field required (type=value_error.missing) vectorstore extra fields not permitted (type=value_error.extra)

i didn't follow all the operation on the pull request , when i add the extra fields to the 'ConversationalRetrievalChain' ,it runs .

good

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

5 participants