Skip to content

App

load_version()

Load the application version from a file.

Source code in view/streamlit_app/app.py
72
73
74
75
76
77
78
79
def load_version():
    """Load the application version from a file."""
    version_file_path = 'view/streamlit_app/version.txt'
    if os.path.exists(version_file_path):
        with open(version_file_path, "r") as f:
            return f.read().strip()
    else:
        return "Version not found"

main(user='user')

Main application entry point.

Parameters:

Name Type Description Default
user str

Default user name for the application.

'user'
Source code in view/streamlit_app/app.py
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
def main(user='user'):
    """
    Main application entry point.

    Args:
        user (str): Default user name for the application.
    """
    with st.sidebar:
        st.text(f"Version: {load_version()}")
        option = option_menu(
            menu_title="Inspector",
            options=[
                'Home',
                'Medical Tests',
                'Status',
                'Responses',
            ],
            # Icons from https://icons.getbootstrap.com/
            icons=[
                'house',
                'eyeglasses',
                'easel2',
                'robot',
            ],
        )
        st.text_input(
            label='Input your user',
            value=user,
            max_chars=50,
            key='user',
        )

        st.radio(
            label="Choose the service used in your .env file",
            options=["azure", "openai"],
            index=1,
            disabled=True,
            key="service_option",
        )

    # Sidebar navigation logic
    if option == 'Home':
        page_home.app()
    elif option == 'Medical Tests':
        page_medical.app()
    elif option == 'Status':
        page_status.app()
    elif option == 'Responses':
        page_responses.app()