prevent podcast without context

This commit is contained in:
LUIS NOVO 2024-10-26 18:55:07 -03:00
parent 1002c6b4eb
commit 9719146210

View file

@ -77,6 +77,11 @@ def chat_sidebar(session_id):
instructions = st.text_area(
"Instructions", value=selected_template.user_instructions
)
if len(context.get("note", [])) + len(context.get("source", [])) == 0:
st.warning(
"No notes or sources found in context. You don't want a boring podcast, right? So, add some context first."
)
else:
if st.button("Generate"):
with st.spinner("Go grab a coffee, almost there..."):
selected_template.generate_episode(