Skip to content

网络搜索工具 (google_web_search)

¥Web Search Tool (google_web_search)

本文档描述了google_web_search工具。

¥This document describes the google_web_search tool.

描述

¥Description

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

¥Use google_web_search to perform a web search using Google Search via the Gemini API. The google_web_search tool returns a summary of web results with sources.

参数

¥Arguments

google_web_search接受一个参数:

¥google_web_search takes one argument:

  • query(字符串,必需):搜索查询。

    ¥query (string, required): The search query.

如何使用google_web_search使用 Gemini CLI

¥How to use google_web_search with the Gemini CLI

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

¥The google_web_search tool sends a query to the Gemini API, which then performs a web search. google_web_search will return a generated response based on the search results, including citations and sources.

用法:

¥Usage:

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

google_web_search示例

¥google_web_search examples

获取有关某个主题的信息:

¥Get information on a topic:

google_web_search(query="latest advancements in AI-powered code generation")

重要说明

¥Important notes

  • 返回响应:google_web_search工具返回的是处理过的摘要,而不是原始的搜索结果列表。

    ¥Response returned: The google_web_search tool returns a processed summary, not a raw list of search results.

  • 引用:回应中包括用于生成摘要的来源的引用。

    ¥Citations: The response includes citations to the sources used to generate the summary.