prevent podcast without context
This commit is contained in:
parent
1002c6b4eb
commit
9719146210
1 changed files with 13 additions and 8 deletions
|
|
@ -77,14 +77,19 @@ def chat_sidebar(session_id):
|
||||||
instructions = st.text_area(
|
instructions = st.text_area(
|
||||||
"Instructions", value=selected_template.user_instructions
|
"Instructions", value=selected_template.user_instructions
|
||||||
)
|
)
|
||||||
if st.button("Generate"):
|
if len(context.get("note", [])) + len(context.get("source", [])) == 0:
|
||||||
with st.spinner("Go grab a coffee, almost there..."):
|
st.warning(
|
||||||
selected_template.generate_episode(
|
"No notes or sources found in context. You don't want a boring podcast, right? So, add some context first."
|
||||||
episode_name=episode_name,
|
)
|
||||||
text=context,
|
else:
|
||||||
instructions=instructions,
|
if st.button("Generate"):
|
||||||
)
|
with st.spinner("Go grab a coffee, almost there..."):
|
||||||
st.success("Episode generated successfully")
|
selected_template.generate_episode(
|
||||||
|
episode_name=episode_name,
|
||||||
|
text=context,
|
||||||
|
instructions=instructions,
|
||||||
|
)
|
||||||
|
st.success("Episode generated successfully")
|
||||||
st.page_link("pages/5_🎙️_Podcasts.py", label="🎙️ Go to Podcasts")
|
st.page_link("pages/5_🎙️_Podcasts.py", label="🎙️ Go to Podcasts")
|
||||||
with chat_tab:
|
with chat_tab:
|
||||||
with st.container(border=True):
|
with st.container(border=True):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue