跳转到内容

网络搜索工具 (`google_web_search`)

本文档描述了google_web_search工具。

使用google_web_search通过Gemini API进行Google 搜索以执行网络搜索。google_web_search工具返回带有来源的网页结果摘要。

google_web_search接受一个参数:

  • query(字符串,必填):搜索查询。
Section titled “如何使用Gemini CLI运行google_web_search”

google_web_search工具向Gemini API发送查询,然后执行网络搜索。google_web_search将根据搜索结果返回生成的响应,包括引文和来源。

用法:

google_web_search(query="Your query goes here.")

获取一个主题的信息:

google_web_search(query="latest advancements in AI-powered code generation")
  • 返回的响应: google_web_search工具返回一个处理过的摘要,而不是原始的搜索结果列表。
  • 引文: 响应包括生成摘要所使用的来源的引文。