naman1102 commited on
Commit
0e8ebd2
·
1 Parent(s): 6341f90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -103,7 +103,10 @@ class BasicAgent:
103
 
104
  def _analyze_question(self, state: AgentState) -> AgentState:
105
  """Analyze the question and determine the next step."""
106
- prompt = f"""Analyze this question and determine what needs to be done: {state['question']}
 
 
 
107
 
108
  Return only a valid Python dictionary in this exact format:
109
  {{
@@ -127,7 +130,7 @@ Do not include any other text or explanation. Only return the dictionary.
127
  print(f"Error parsing LLM response: {e}")
128
  # Default to search if we can't parse the response
129
  state["needs_more_info"] = True
130
- state["search_query"] = state["question"]
131
  state["current_step"] = 'search'
132
 
133
  return state
 
103
 
104
  def _analyze_question(self, state: AgentState) -> AgentState:
105
  """Analyze the question and determine the next step."""
106
+ # Get the most recent question from the list
107
+ current_question = state["question"][-1]
108
+
109
+ prompt = f"""Analyze this question and determine what needs to be done: {current_question}
110
 
111
  Return only a valid Python dictionary in this exact format:
112
  {{
 
130
  print(f"Error parsing LLM response: {e}")
131
  # Default to search if we can't parse the response
132
  state["needs_more_info"] = True
133
+ state["search_query"] = current_question
134
  state["current_step"] = 'search'
135
 
136
  return state