DrishtiSharma commited on
Commit
15dbb7f
Β·
verified Β·
1 Parent(s): 4c5cd46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -159,7 +159,7 @@ else:
159
 
160
  if query:
161
  with st.spinner("πŸ”„ Retrieving relevant context..."):
162
- retriever = st.session_state.vector_store.as_retriever(search_type="similarity", search_kwargs={"k": 5})
163
  contexts = retriever.invoke(query)
164
  # Debugging: Check what was retrieved
165
  st.write("Retrieved Contexts:", contexts)
@@ -232,7 +232,7 @@ if query:
232
  context_prompt = PromptTemplate(
233
  input_variables=["context_number"],
234
  template="""
235
- You main task is to analyze the json structure as a part of the Context Number Response and the list of Contexts provided in the 'Content List' and perform the following steps:-
236
  (1) Look at the output from the Relevant Context Picker Agent.
237
  (2) Analyze the 'content' key in the Json Structure format({{"content":<<content_number>>}}).
238
  (3) Retrieve the value of 'content' key and pick up the context corresponding to that element from the Content List provided.
@@ -252,7 +252,7 @@ if query:
252
  """
253
  )
254
 
255
- rag_prompt = """ You are ahelpful assistant very profiient in formulating clear and meaningful answers from the context provided.Based on the CONTEXT Provided ,Please formulate
256
  a clear concise and meaningful answer for the QUERY asked.Please refrain from making up your own answer in case the COTEXT provided is not sufficient to answer the QUERY.In such a situation please respond as 'I do not know'.
257
 
258
  QUERY:
 
159
 
160
  if query:
161
  with st.spinner("πŸ”„ Retrieving relevant context..."):
162
+ retriever = st.session_state.vector_store.as_retriever(search_type="similarity", search_kwargs={"k": 4})
163
  contexts = retriever.invoke(query)
164
  # Debugging: Check what was retrieved
165
  st.write("Retrieved Contexts:", contexts)
 
232
  context_prompt = PromptTemplate(
233
  input_variables=["context_number"],
234
  template="""
235
+ Your main task is to analyze the json structure as a part of the Context Number Response and the list of Contexts provided in the 'Content List' and perform the following steps:-
236
  (1) Look at the output from the Relevant Context Picker Agent.
237
  (2) Analyze the 'content' key in the Json Structure format({{"content":<<content_number>>}}).
238
  (3) Retrieve the value of 'content' key and pick up the context corresponding to that element from the Content List provided.
 
252
  """
253
  )
254
 
255
+ rag_prompt = """ You are a helpful assistant very profiient in formulating clear and meaningful answers from the context provided.Based on the CONTEXT Provided ,Please formulate
256
  a clear concise and meaningful answer for the QUERY asked.Please refrain from making up your own answer in case the COTEXT provided is not sufficient to answer the QUERY.In such a situation please respond as 'I do not know'.
257
 
258
  QUERY: