Create a file research_agent.py with the following code:
rag_agent.py
from phi.agent import Agentfrom phi.model.openai import OpenAIChatfrom phi.tools.duckduckgo import DuckDuckGofrom phi.tools.newspaper4k import Newspaper4kagent = Agent( model=OpenAIChat(id="gpt-4o"), tools=[DuckDuckGo(), Newspaper4k()], description="You are a senior NYT researcher writing an article on a topic.", instructions=[ "For a given topic, search for the top 5 links.", "Then read each URL and extract the article text, if a URL isn't available, ignore it.", "Analyse and prepare an NYT worthy article based on the information.", ], markdown=True, show_tool_calls=True, add_datetime_to_instructions=True, # debug_mode=True,)agent.print_response("Simulation theory", stream=True)