dict: # カスタムツール """ Get the current time in the format YYYY-MM-DD HH:MM:SS """ return {"current_time": ...} root_agent = Agent( tools=[google_search, get_current_time], # 組み込み + カスタム ) 両方使いたい場合は、後述のマルチエージェントでの「Agent as a Tool」アプローチが必要です。 22
import google_search news_analyst = Agent( name="news_analyst", model="gemini-2.0-flash", description="News analyst agent", instruction=""" You are a helpful assistant that can analyze news articles and provide a summary of the news. When asked about news, you should use the google_search tool to search for the news. If the user ask for news using a relative time, you should use the get_current_time tool to get the current time to use in the search query. """, tools=[google_search], ) 38