Recommended way up splitting streamlit app into multiple file?

Hello Streamlit community,
I am building a chatbot application for an Organization. The chatbot is calling different API’s and getting the answer back.

As we add new functionailty the size of the file is growing everyday. How should we split the application file? also I felt when i externalize some api calls into different file the chatbot caches data and I have to stop and start the chat in my localhost to see new changes. Whereas when everything is in single file there is no such issues

Have you tried the multi-page feature?

Could you elaborate more on that?

Hi @Pro_Buzz maybe just try some modularization and modules importing?

My app The Dungeon does something like that. Maybe not in the best way possible, but you can get the concept:

I have divided the game into main streamlit_app.py file and:

import game_config
import game_js
import game_def

In this way I can modyfiy things like rendering engine outside the main app. In the main app I am importing needed modules:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.