im commited on
Commit
9e0f2ab
·
1 Parent(s): 2484f91

fix Doodle button

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -184,7 +184,8 @@ def main() -> None:
184
  if 'web_url' in st.session_state:
185
  col1, col2 = st.columns(2)
186
  col1.caption(f"discussing: {st.session_state.web_url}")
187
- col2.caption(f"{st.session_state.title}")
 
188
 
189
  if 'content' not in st.session_state:
190
  init_session()
@@ -200,7 +201,7 @@ def main() -> None:
200
  st.divider()
201
 
202
  content_url = st.text_input(label='Paste your link, e.g. https://expresso.today', label_visibility='collapsed',
203
- placeholder='Paste your link:')
204
  col1, _, _, _, col2 = st.columns(5)
205
  col1.button("Doodle")
206
  if col2.button("Random Page"):
@@ -215,7 +216,7 @@ def main() -> None:
215
  st.session_state.content = st.session_state.web_page['content']
216
  st.experimental_rerun()
217
  else:
218
- st.warning("invalid link")
219
  elif 'content_summary' not in st.session_state:
220
  content_summary = get_content_summary(content=st.session_state.content, model_name="gpt-3.5-turbo-16k",
221
  api_key=st.session_state.open_api_key)
@@ -239,7 +240,10 @@ def main() -> None:
239
  show_question_input()
240
  except Exception as e:
241
  logging.error(e)
242
- st.warning("Whoops, looks like a hiccup in the system! But no worries, our tech wizards are already on the case, working their magic. In the meantime, how about giving it another shot?")
 
 
 
243
  if st.button("Give It Another Go!"):
244
  st.experimental_rerun()
245
 
@@ -249,5 +253,6 @@ if __name__ == "__main__":
249
  main()
250
 
251
  # TODO:
 
252
  # - chat history
253
  # - store history externaly along with audio description and return from cache
 
184
  if 'web_url' in st.session_state:
185
  col1, col2 = st.columns(2)
186
  col1.caption(f"discussing: {st.session_state.web_url}")
187
+ if 'title' in st.session_state:
188
+ col2.caption(f"{st.session_state.title}")
189
 
190
  if 'content' not in st.session_state:
191
  init_session()
 
201
  st.divider()
202
 
203
  content_url = st.text_input(label='Paste your link, e.g. https://expresso.today', label_visibility='collapsed',
204
+ placeholder='Paste your link, e.g. https://expresso.today')
205
  col1, _, _, _, col2 = st.columns(5)
206
  col1.button("Doodle")
207
  if col2.button("Random Page"):
 
216
  st.session_state.content = st.session_state.web_page['content']
217
  st.experimental_rerun()
218
  else:
219
+ st.warning("Whoops! That link seems to be doing the vanishing act. Could you give it another shot? Magic words: 'Valid Link, Please!' 🪄")
220
  elif 'content_summary' not in st.session_state:
221
  content_summary = get_content_summary(content=st.session_state.content, model_name="gpt-3.5-turbo-16k",
222
  api_key=st.session_state.open_api_key)
 
240
  show_question_input()
241
  except Exception as e:
242
  logging.error(e)
243
+ st.warning("""\
244
+ Whoops, looks like a hiccup in the system! But no worries, our tech wizards are already on
245
+ the case, working their magic. In the meantime, how about giving it another shot?
246
+ """)
247
  if st.button("Give It Another Go!"):
248
  st.experimental_rerun()
249
 
 
253
  main()
254
 
255
  # TODO:
256
+ # - connect to langsmith
257
  # - chat history
258
  # - store history externaly along with audio description and return from cache