Spaces:
Sleeping
Sleeping
File size: 611 Bytes
f154798 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
from loggers.logger import logger
from helper.web_search_agent import WEB_SEARCH_TOOL
import sys
sys.dont_write_bytecode = True
tool = WEB_SEARCH_TOOL
def web_search(state):
"""
Route question to web search
Args:
state (dict): The current graph state
Returns:
state (dict): Next node to call
"""
logger.info("INSIDE THE WEB SEARCH FILE")
query = state['search_query']
logger.info(f"SEARCH QUERY ENTERED: {query}")
result = WEB_SEARCH_TOOL.invoke(query)
logger.info("WEB SEARCH TOOL INVOKED")
return {
"context": result
}
|