async def conversation_time(current_user: User = Depends( auth.get_current_user)): return {"data": ChatHistory.conversation_time(current_user.get_bot())}
async def conversation_time(current_user: User = Depends( auth.get_current_user)): """ This returns the duration of the chat that took place between the user and the chatbot """ return {"data": ChatHistory.conversation_time(current_user.get_bot())}
def test_conversation_time_empty(self, mock_chat_history_empty): conversation_time = ChatHistory.conversation_time("tests") assert not conversation_time
def test_conversation_time(self, mock_chat_history): conversation_time = ChatHistory.conversation_time("tests") assert conversation_time
def test_conversation_time_error(self, mock_get_tracker_and_domain): with pytest.raises(Exception): conversation_time = ChatHistory.conversation_time("tests") assert not conversation_time