langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Callback Manager

Open shreyabhadwal opened this issue 2 years ago • 1 comments

What's the difference between the two parameters handlers and inheritable_handlers in the callback manager class?

Also if I am not wrong, previously there was only AsyncCallBackManager and BaseCallbackManager. What's the recent introduction of langchain.callbacks.manager for?

Which one should I use for ConversationalRetrievalChain?

shreyabhadwal avatar May 02 '23 10:05 shreyabhadwal

This is a part of the error I get back when running the chat-langchain uvicorn server. The base.py file doesn't have the AsyncCallbackManager class anymore since version 0.0.154.

from query_data import get_chain File "/home/user/Documents/Langchain/chat-langchain/./query_data.py", line 2, in from langchain.callbacks.base import AsyncCallbackManager ImportError: cannot import name 'AsyncCallbackManager' from 'langchain.callbacks.base' (/home/user/Documents/Langchain/callbacks/base.py)

robstoof avatar May 04 '23 13:05 robstoof

Hi, This is referenced in #3256. Replace from langchain.callbacks.base import AsyncCallbackManager with from langchain.callbacks.manager import AsyncCallbackManager and it should work. Works for me.

I think there's an overhaul of callbacks being done. Really looking forward to additional documentation on this.

shreyabhadwal avatar May 06 '23 04:05 shreyabhadwal