File size: 752 Bytes
d7c468c
 
 
 
 
 
 
 
 
 
 
 
 
0dc1b30
d7c468c
 
 
 
870dd36
d7c468c
0dc1b30
d7c468c
 
0dc1b30
d7c468c
01ecf0a
d7c468c
 
 
 
 
0dc1b30
d7c468c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import streamlit as st
from spirit_animal.pages import intro, quiz, image_gen


# Define stateful objects

if "openai_model" not in st.session_state:
    st.session_state["openai_model"] = "gpt-4"

if "spirit_animal" not in st.session_state:
    st.session_state["spirit_animal"] = ""

# Define the pages
PAGES = {"Intro": "intro", "Quiz": "quiz", "Build Your Surprise": "image_gen"}


# Page functions dictionary
PAGE_FUNCTIONS = {
    "intro": intro.intro,
    "quiz": quiz.quiz,
    "image_gen": image_gen.image_gen,
}


def main():
    st.sidebar.title("Navigation :world_map:")
    choice = st.sidebar.selectbox("Go to", list(PAGES.keys()))

    # Call the page function
    PAGE_FUNCTIONS[PAGES[choice]]()


if __name__ == "__main__":
    main()