Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
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 |
-
#
|
186 |
-
st.
|
|
|
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 |
|