virtUOS / kiwi

A simple and configurable portal to proxy to llms.
https://virtuos.github.io/kiwi/
GNU Affero General Public License v3.0
2 stars 3 forks source link

Chat not working at all #18

Closed lkiesow closed 8 months ago

lkiesow commented 9 months ago

Trying to paste something in the chat ends with a stack trace:

Screenshot from 2024-02-15 00-22-03

KeyError: 'st.session_state has no key "use_witty_prompts". Did you forget to initialize it? More info: https://docs.streamlit.io/library/advanced-features/session-state#initialization'

Traceback:

File "/usr/local/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
    exec(code, module.__dict__)
File "/ai-portal/pages/app.py", line 86, in <module>
    load_prompts()
File "/ai-portal/pages/app.py", line 36, in load_prompts
    st.session_state["use_witty_prompts"])
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/streamlit/runtime/state/session_state_proxy.py", line 90, in __getitem__
    return get_session_state()[key]
           ~~~~~~~~~~~~~~~~~~~^^^^^
File "/usr/local/lib/python3.12/site-packages/streamlit/runtime/state/safe_session_state.py", line 91, in __getitem__
    return self._state[key]
           ~~~~~~~~~~~^^^^^
File "/usr/local/lib/python3.12/site-packages/streamlit/runtime/state/session_state.py", line 400, in __getitem__
    raise KeyError(_missing_key_error_message(key))
Odrec commented 9 months ago

I get this error as well which is strange since that session variable is no longer in the code which makes me think it is a server-side cache issue. If you activate the predefined prompts at least once the error doesn't happen.

Odrec commented 8 months ago

Now it should work.