diva.gui.service_streamlit package¶
Submodules¶
diva.gui.service_streamlit.main module¶
This is the main python function for the generation of the streamlit interface service
- diva.gui.service_streamlit.main.main(updating=False)[source]¶
Build and run the DestinE Chatbot application interface.
This function sets up the application’s main interface and manages its core components, including: - Configuring the Streamlit page layout and initializing authentication. - Setting up the sidebar with navigation options. - Managing the main tabs and their associated content, such as banners, session handling, and tabbed navigation.
Parameters¶
- updatingbool, optional
If True, displays a message indicating that the DIVA feature is currently unavailable due to an update and prevents the full application from loading. Default is False.
Returns¶
None
diva.gui.service_streamlit.tab1 module¶
Tab 1 that contains the chatbot page
- diva.gui.service_streamlit.tab1.clear_conversation(source_lang)[source]¶
Clear all conversation history and reset state
- diva.gui.service_streamlit.tab1.get_module_llm()[source]¶
Imports and returns the default language model module.
This function dynamically imports the module_llm from the llm package and returns the default language model (default_llm) defined within that module.
Returns:¶
- object
The default language model (default_llm) from the module_llm.
- diva.gui.service_streamlit.tab1.get_user_input(source_lang, dev_mode)[source]¶
Get user input from chat or suggested prompts
- diva.gui.service_streamlit.tab1.handle_discussion(module_chat, prompt, source_lang)[source]¶
Handle simple discussion requests
- diva.gui.service_streamlit.tab1.handle_visualization(module_chat, module_config, prompt, source_lang, energy_meter, energy_records, user_type, langage)[source]¶
Handle visualization requests
- diva.gui.service_streamlit.tab1.initialize_session_state(module_chat, langage)[source]¶
Initialize all session state variables
- diva.gui.service_streamlit.tab1.main(tab1_options)[source]¶
Main function for Tab 1 - refactored version
diva.gui.service_streamlit.tab2 module¶
- diva.gui.service_streamlit.tab2.main(tab2_options)[source]¶
Defines the content and layout of Tab 2, which includes documentation and examples for using the DIVA application.
This function sets up the user interface for Tab 2, providing examples of natural language queries, links to documentation, and information about the available data within the DIVA package. It includes code snippets, links to external resources, and a summary of data availability.
Parameters:¶
- tab2_optionsdict
A dictionary containing options related to the current tab. (Not currently used in this function.)
Returns:¶
None