rehanafzal commited on
Commit
34a43e5
·
verified ·
1 Parent(s): 80b7291

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -105,7 +105,7 @@ import streamlit as st
105
  from tempfile import NamedTemporaryFile
106
 
107
  # Initialize Groq client
108
- client = Groq(api_key=os.environ.get("Groq_api_key"))
109
 
110
  # Function to extract text from a PDF
111
  def extract_text_from_pdf(pdf_file_path):
@@ -182,6 +182,7 @@ if uploaded_file:
182
  # Append query and response to the chat history
183
  st.session_state.chat_history.append({"query": user_query, "response": response})
184
 
185
- # Refresh the app without needing manual rerun
186
- st.experimental_set_query_params(rerun="true")
 
187
 
 
105
  from tempfile import NamedTemporaryFile
106
 
107
  # Initialize Groq client
108
+ client = Groq(api_key=os.getenv("Groq_api_key"))
109
 
110
  # Function to extract text from a PDF
111
  def extract_text_from_pdf(pdf_file_path):
 
182
  # Append query and response to the chat history
183
  st.session_state.chat_history.append({"query": user_query, "response": response})
184
 
185
+ # Update query parameters to trigger a soft refresh
186
+ st.query_params["chat_length"] = len(st.session_state.chat_history)
187
+
188