Skip to main content
本笔记本介绍如何使用 Google 搜索组件。 首先,您需要设置正确的 API 密钥和环境变量。要进行设置,请在 Google Cloud 凭据控制台(console.cloud.google.com/apis/credentials)中创建 GOOGLE_API_KEY,并使用可编程搜索引擎(programmablesearchengine.google.com/controlpanel/create)创建 GOOGLE_CSE_ID。接下来,最好遵循编程式 Google 搜索的说明 然后我们需要设置一些环境变量。

结果数量

您可以使用 k 参数来设置结果数量。
‘The official home of the Python Programming Language.‘

元数据结果

通过 GoogleSearch 运行查询,并返回摘要、标题和链接元数据。
  • 摘要:结果的描述。
  • 标题:结果的标题。
  • 链接:结果的链接。