client = TavilyClient(api_key=os.getenv("TAVILY_API_KEY")) def fetch_recent_news(query: str) -> str: """Inputs a query string, searches for news and returns top results.""" response = tavily_client.search(query, search_depth="advanced", topic="news", days=7, max_results=3) return [x["content"] for x in response["results"]]