Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,8 @@ def streamer(text):
|
|
9 |
yield i
|
10 |
time.sleep(0.005)
|
11 |
|
|
|
|
|
12 |
# Streamlit app initialization
|
13 |
st.title("RAG AGENT")
|
14 |
st.markdown("RAG Agent with PDF and Web Search")
|
@@ -37,7 +39,7 @@ with st.sidebar:
|
|
37 |
st.success("Done")
|
38 |
|
39 |
with st.container(height=200):
|
40 |
-
st.markdown(
|
41 |
|
42 |
user_prompt = st.chat_input("Ask me anything about the content of the PDF or Web Link:")
|
43 |
|
@@ -49,6 +51,7 @@ if user_prompt and (uploaded_file or video_url):
|
|
49 |
# Trigger assistant's response retrieval and update UI
|
50 |
with st.spinner("Thinking..."):
|
51 |
response = "I have an answer coming soon..."
|
|
|
52 |
with st.chat_message("user", avatar="robot.png"):
|
53 |
st.write_stream(streamer(response))
|
54 |
st.session_state.messages.append({'role': 'assistant', "content": response})
|
|
|
9 |
yield i
|
10 |
time.sleep(0.005)
|
11 |
|
12 |
+
console_out =""
|
13 |
+
|
14 |
# Streamlit app initialization
|
15 |
st.title("RAG AGENT")
|
16 |
st.markdown("RAG Agent with PDF and Web Search")
|
|
|
39 |
st.success("Done")
|
40 |
|
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 |
# Trigger assistant's response retrieval and update UI
|
52 |
with st.spinner("Thinking..."):
|
53 |
response = "I have an answer coming soon..."
|
54 |
+
console_out.append(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})
|