from typing import Any, Dict
from collections import deque

from langchain.callbacks.base import BaseCallbackHandler

class ChainCallbacks(BaseCallbackHandler):
    def __init__(self):
        pass
    
    def on_chain_start(self, serialized, inputs, **kwargs):
        pass
    
    def on_agent_action(self, action, **kwargs):
        pass
    
class QwinBotConversationContext:  
    user_id: str
    chat_history: deque[Any]
    need_operator: bool
    
    def __init__(self, user_id: str, chat_history_max_depth: int=5):
        self.user_id = user_id
        self.chat_history = deque(maxlen=chat_history_max_depth*2)
        self.need_operator = False