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

hi , it has error #6

Open
ramin951 opened this issue Sep 16, 2024 · 1 comment
Open

hi , it has error #6

ramin951 opened this issue Sep 16, 2024 · 1 comment

Comments

@ramin951
Copy link

AttributeError: st.session_state has no attribute "messages". Did you forget to initialize it? More info: https://docs.streamlit.io/develop/concepts/architecture/session-state#initialization
Traceback:
File "D:****.venv\chatbot\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 589, in _run_script
exec(code, module.dict)
File "D:\project\chatbot\pages\5_🛢_chat_with_sql_db.py", line 94, in
obj.main()
File "D:\project\chatbot\utils.py", line 35, in execute
func(*args, kwargs)
File "D:\project\chatbot\pages\5_🛢_chat_with_sql_db.py", line 77, in main
st.session_state.messages.append({"role": "user", "content": user_query})
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:*
.venv\chatbot\Lib\site-packages\streamlit\runtime\state\session_state_proxy.py", line 129, in getattr
raise AttributeError(_missing_attr_error_message(key))

@shashankdeshpande
Copy link
Owner

@ramin951 That key is getting assigned in decorator - refer this

langchain-chatbot.streamlit.app is also using same codebase and didn't face this issue.

Could you please provide more details about the issue?

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

2 participants