I am trying to create a chatbot using Langchain and HuggingFace and Streamlit’s Chat Message function.
It works fine for the first message and correctly answers it, but when I send 2nd message it shows this error:
TypeError: ‘HumanMessage’ object is not subscriptable
Traceback:
File "/home/ahsan/.local/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 542, in _run_script
exec(code, module.__dict__)File "/home/ahsan/Desktop/Projects/ChatbotWithRAG/app.py", line 120, in <module>
main()File "/home/ahsan/Desktop/Projects/ChatbotWithRAG/app.py", line 92, in main
with st.chat_message(msg['role']):