Spaces:
Runtime error
Runtime error
Added web_search directly
Browse files377 unmodified lines3783793803813823832 unmodified lines386387388389390391377 unmodified lines# Import tool from Hubimage_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)with open("prompts.yaml", 'r') as stream:prompt_templates = yaml.safe_load(stream)2 unmodified linestools=[final_answer,Sonar_Web_Search_Tool,ddg_search_tool, # Added DuckDuckGo search tool# google_search_tool, # Added Google search toolget_current_time_in_timezone,377 unmodified lines3783793803813823833843853863873883893903913923933943953963973983992 unmodified lines402403404405406407408377 unmodified lines# Import tool from Hubimage_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)@tooldef web_search(query: str) -> str:"""A tool that searches the web for information.Args:query: The search query stringReturns:Search results as text"""try:# Use the already initialized DuckDuckGo search toolreturn ddg_search_tool(query)except Exception as e:return f"Error performing web search for '{query}': {str(e)}"with open("prompts.yaml", 'r') as stream:prompt_templates = yaml.safe_load(stream)2 unmodified linestools=[final_answer,Sonar_Web_Search_Tool,web_search, # Added explicit web_search toolddg_search_tool, # Added DuckDuckGo search tool# google_search_tool, # Added Google search toolget_current_time_in_timezone,
app.py+17