fehmikaya commited on
Commit
286afce
·
verified ·
1 Parent(s): 8e61e1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,7 +9,7 @@ def streamer(text):
9
  yield i
10
  time.sleep(0.005)
11
 
12
- console_out =""
13
 
14
  # Streamlit app initialization
15
  st.title("RAG AGENT")
@@ -39,7 +39,7 @@ with st.sidebar:
39
  st.success("Done")
40
  st.markdown("Console:")
41
  with st.container(height=200):
42
- st.markdown(console_out)
43
 
44
  user_prompt = st.chat_input("Ask me anything about the content of the PDF or Web Link:")
45
 
@@ -51,7 +51,7 @@ if user_prompt and (uploaded_file or video_url):
51
  # Trigger assistant's response retrieval and update UI
52
  with st.spinner("Thinking..."):
53
  response = "I have an answer coming soon..."
54
- console_out=console_out+response+"\n"
55
  with st.chat_message("user", avatar="robot.png"):
56
  st.write_stream(streamer(response))
57
  st.session_state.messages.append({'role': 'assistant', "content": response})
 
9
  yield i
10
  time.sleep(0.005)
11
 
12
+ st.session_state.console_out=""
13
 
14
  # Streamlit app initialization
15
  st.title("RAG AGENT")
 
39
  st.success("Done")
40
  st.markdown("Console:")
41
  with st.container(height=200):
42
+ st.text_area(value=st.session_state.console_out, height=2000)
43
 
44
  user_prompt = st.chat_input("Ask me anything about the content of the PDF or Web Link:")
45
 
 
51
  # Trigger assistant's response retrieval and update UI
52
  with st.spinner("Thinking..."):
53
  response = "I have an answer coming soon..."
54
+ st.session_state.console_out=st.session_state.console_out+response+"\n"
55
  with st.chat_message("user", avatar="robot.png"):
56
  st.write_stream(streamer(response))
57
  st.session_state.messages.append({'role': 'assistant', "content": response})