naman1102 commited on
Commit
8f6a15e
·
1 Parent(s): a9c5bda

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -6,7 +6,7 @@ import pandas as pd
6
  from typing import Dict, Any, List, TypedDict, Optional
7
  from langgraph.graph import Graph, StateGraph
8
  from langgraph.prebuilt import ToolNode
9
- from tools import create_calculator_tool, create_search_tool
10
  print("trial")
11
  # (Keep Constants as is)
12
  # --- Constants ---
@@ -158,17 +158,16 @@ class BasicAgent:
158
  def _use_search(self, state: AgentState) -> AgentState:
159
  """Use the search tool."""
160
  try:
161
- # Create search state with input from search_query
162
- search_input = {
163
- "query": state["search_query"],
164
- "max_results": 3
165
- }
166
- result = self.search_tool.invoke({"input": search_input})
167
 
168
  state["history"].append({
169
  'step': 'search',
170
  'query': state["search_query"],
171
- 'results': [str(r) for r in result['output']['results']]
172
  })
173
  state["needs_more_info"] = False
174
  state["current_step"] = 'final_answer'
 
6
  from typing import Dict, Any, List, TypedDict, Optional
7
  from langgraph.graph import Graph, StateGraph
8
  from langgraph.prebuilt import ToolNode
9
+ from tools import create_calculator_tool, create_search_tool, simple_search
10
  print("trial")
11
  # (Keep Constants as is)
12
  # --- Constants ---
 
158
  def _use_search(self, state: AgentState) -> AgentState:
159
  """Use the search tool."""
160
  try:
161
+ # Use the simplified search function
162
+ search_results = simple_search(
163
+ query=state["search_query"],
164
+ max_results=3
165
+ )
 
166
 
167
  state["history"].append({
168
  'step': 'search',
169
  'query': state["search_query"],
170
+ 'results': search_results
171
  })
172
  state["needs_more_info"] = False
173
  state["current_step"] = 'final_answer'