grantjw commited on
Commit
0d1a5ce
·
verified ·
1 Parent(s): 084fc14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -125,18 +125,19 @@ If the DOCUMENT doesn’t contain the facts to answer the QUESTION return {NONE}
125
  key="system_prompt")
126
 
127
 
 
128
 
129
  if "base_url" not in st.session_state:
130
- st.session_state.base_url = ""
131
 
132
- base_url = st.text_input("Site URL", value=st.session_state.base_url, key="base_url", disabled=True)
133
  # Optionally, you can also display the URL in a non-editable text input as an FYI to the user
134
- #base_url = st.text_input("Site URL", value=st.session_state.base_url, key="base_url", disabled=True)
135
 
136
 
137
  if st.session_state.base_url != "":
138
 
139
  retriever = get_retriever(base_url)
 
140
  # We store the conversation in the session state.
141
  # This will be used to render the chat conversation.
142
  # We initialize it with the first message we want to be greeted with.
@@ -160,7 +161,7 @@ if st.session_state.base_url != "":
160
  llm_chain = create_chain(retriever)
161
 
162
  # We take questions/instructions from the chat input to pass to the LLM
163
- if user_prompt := st.chat_input("https://raw.githubusercontent.com/grantjw/aesop-review/main/output_transcripts.csv", key="user_input"):
164
 
165
  # Add our input to the session state
166
  st.session_state.messages.append(
@@ -185,3 +186,4 @@ if st.session_state.base_url != "":
185
  # Add the response to the chat window
186
  with st.chat_message("assistant"):
187
  st.markdown(response)
 
 
125
  key="system_prompt")
126
 
127
 
128
+ default_url = "https://raw.githubusercontent.com/grantjw/product_chatbot_rag/main/data/output_transcripts.csv"
129
 
130
  if "base_url" not in st.session_state:
131
+ st.session_state.base_url = default_url
132
 
 
133
  # Optionally, you can also display the URL in a non-editable text input as an FYI to the user
134
+ base_url = st.text_input("Site URL", value=st.session_state.base_url, key="base_url", disabled=True)
135
 
136
 
137
  if st.session_state.base_url != "":
138
 
139
  retriever = get_retriever(base_url)
140
+
141
  # We store the conversation in the session state.
142
  # This will be used to render the chat conversation.
143
  # We initialize it with the first message we want to be greeted with.
 
161
  llm_chain = create_chain(retriever)
162
 
163
  # We take questions/instructions from the chat input to pass to the LLM
164
+ if user_prompt := st.chat_input("Your message here", key="user_input"):
165
 
166
  # Add our input to the session state
167
  st.session_state.messages.append(
 
186
  # Add the response to the chat window
187
  with st.chat_message("assistant"):
188
  st.markdown(response)
189
+