Update app.py
Browse files
app.py
CHANGED
@@ -107,7 +107,7 @@ def show_mbti_quiz():
|
|
107 |
"""
|
108 |
try:
|
109 |
response = openai.ChatCompletion.create(
|
110 |
-
model="gpt-
|
111 |
messages=[{"role": "system", "content": "You are a helpful assistant."},
|
112 |
{"role": "user", "content": prompt}]
|
113 |
)
|
@@ -125,5 +125,41 @@ def main():
|
|
125 |
else:
|
126 |
st.info("Please enter your OpenAI API Key to begin the quiz.")
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
if __name__ == "__main__":
|
129 |
-
|
|
|
|
107 |
"""
|
108 |
try:
|
109 |
response = openai.ChatCompletion.create(
|
110 |
+
model="gpt-4",
|
111 |
messages=[{"role": "system", "content": "You are a helpful assistant."},
|
112 |
{"role": "user", "content": prompt}]
|
113 |
)
|
|
|
125 |
else:
|
126 |
st.info("Please enter your OpenAI API Key to begin the quiz.")
|
127 |
|
128 |
+
# Custom CSS styling for the app
|
129 |
+
def add_custom_css():
|
130 |
+
st.markdown("""
|
131 |
+
<style>
|
132 |
+
body {
|
133 |
+
background-image: url('https://images.unsplash.com/photo-1501487526377-c63d4e41556e?crop=entropy&cs=tinysrgb&fit=max&ixid=MnwzNjUyOXwwfDF8c2VhcmNofDJ8fGxlZ2VuZGVyfGVufDB8fHx8fDE2NzkzNzY3Njg&ixlib=rb-1.2.1&q=80&w=1080');
|
134 |
+
background-size: cover;
|
135 |
+
font-family: 'Helvetica', sans-serif;
|
136 |
+
color: white;
|
137 |
+
}
|
138 |
+
.css-18e3b3s {
|
139 |
+
background: rgba(0, 0, 0, 0.5);
|
140 |
+
}
|
141 |
+
.stButton>button {
|
142 |
+
background-color: #2f7ed0;
|
143 |
+
color: white;
|
144 |
+
font-size: 16px;
|
145 |
+
border-radius: 12px;
|
146 |
+
border: none;
|
147 |
+
padding: 12px 24px;
|
148 |
+
cursor: pointer;
|
149 |
+
transition: background-color 0.3s;
|
150 |
+
}
|
151 |
+
.stButton>button:hover {
|
152 |
+
background-color: #4c9bd0;
|
153 |
+
}
|
154 |
+
.stRadio>div>label {
|
155 |
+
font-size: 16px;
|
156 |
+
}
|
157 |
+
.stTextInput>div>label {
|
158 |
+
font-size: 18px;
|
159 |
+
}
|
160 |
+
</style>
|
161 |
+
""", unsafe_allow_html=True)
|
162 |
+
|
163 |
if __name__ == "__main__":
|
164 |
+
add_custom_css()
|
165 |
+
main()
|