Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -122,13 +122,13 @@ with col2:
|
|
122 |
)
|
123 |
|
124 |
with col3:
|
125 |
-
|
|
|
126 |
"Choose a prompt:",
|
127 |
options=list(prompts.keys()),
|
128 |
format_func=lambda x: x,
|
129 |
-
index=0
|
130 |
-
|
131 |
-
)
|
132 |
|
133 |
# Display chat messages from history on app rerun
|
134 |
for message in st.session_state.messages:
|
@@ -179,8 +179,8 @@ if prompt := st.chat_input("Enter your prompt here..."):
|
|
179 |
{"role": "assistant", "content": combined_response}
|
180 |
)
|
181 |
|
182 |
-
if prompt := prompts.get(
|
183 |
-
st.session_state
|
184 |
|
185 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
186 |
with st.chat_message("user", avatar="❓"):
|
|
|
122 |
)
|
123 |
|
124 |
with col3:
|
125 |
+
if "prompt_selectbox" not in st.session_state:
|
126 |
+
st.session_state["prompt_selectbox"] = st.selectbox(
|
127 |
"Choose a prompt:",
|
128 |
options=list(prompts.keys()),
|
129 |
format_func=lambda x: x,
|
130 |
+
index=0
|
131 |
+
)
|
|
|
132 |
|
133 |
# Display chat messages from history on app rerun
|
134 |
for message in st.session_state.messages:
|
|
|
179 |
{"role": "assistant", "content": combined_response}
|
180 |
)
|
181 |
|
182 |
+
if prompt := prompts.get(st.session_state["prompt_selectbox"]):
|
183 |
+
st.session_state["prompt_selectbox"].option("none")
|
184 |
|
185 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
186 |
with st.chat_message("user", avatar="❓"):
|