Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions agents/python/src/lib/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async def async_tavily_search(query: str) -> Dict[str, Any]:
query=query,
search_depth="advanced",
include_answer=True,
max_results=10,
max_results=5,
),
)
except Exception as e:
Expand Down Expand Up @@ -99,7 +99,10 @@ async def search_node(state: AgentState, config: RunnableConfig):
if ai_message.tool_calls and ai_message.tool_calls[0]["name"] == "Search":
queries = ai_message.tool_calls[0]["args"].get("queries", [])[:MAX_WEB_SEARCHES]
else:
queries = [] # No web search queries when coming from GenerateDataQuestions
# Use research question for web search when coming from GenerateDataQuestions
research_question = state.get("research_question", "")
queries = [research_question] if research_question else []
queries = queries[:MAX_WEB_SEARCHES]

data_questions = state.get("data_questions", [])

Expand Down