Brave Search LLM Context

6积分/次
ae_bravesearch_llm_context

根据问题检索网页,为调用者提供相关正文片段和来源元信息,而不是 AI 生成的最终答案。必填 q 填写问题或关键词;可选参数可调整搜索结果数、纳入的网页数量,以及每页和总 token 预算。返回内容包括 grounding.generic 中的网页 URL、标题和 snippets,以及 sources 来源元信息(如有返回)。总 token 限制是近似上限。

搜索
6积分/次

价格说明

6积分/次
条件费用
每次调用6积分/次

工具参数

未传入的可选参数将使用平台默认值。

参数类型必填说明默认值
qstring是要检索的问题或关键词,非空,最多600字符和75个词。—
countinteger否参与筛选上下文的搜索结果数。20
countrystring否搜索市场的两字母国家代码,例如US。—
gogglesstring否自定义重排规则,填写托管规则URL或内联Goggle文本。—
freshnessstring否网页时间范围:pd、pw、pm、py或YYYY-MM-DDtoYYYY-MM-DD。—
operatorsboolean否是否应用搜索运算符。true
safesearchenum (off | moderate | strict)否成人内容过滤级别。—
spellcheckboolean否是否对查询做拼写纠正。true
search_langstring否搜索语言代码,例如en、zh-hans或zh-hant;不是zh-CN。—
enable_localboolean否是否包含地点相关上下文。—
operators_fallbackboolean否是否允许搜索运算符匹配回退。true
context_threshold_modeenum (disabled | strict | lenient | balanced)否内容相关性阈值模式。—
enable_source_metadataboolean否是否包含站点名称、图标、缩略图和抓取时间等来源元信息。false
maximum_number_of_urlsinteger否上下文最多纳入的不同网页数量。—
maximum_number_of_tokensinteger否上下文总token数的近似上限,并非严格截断。8192
maximum_number_of_tokens_per_urlinteger否每个网页纳入的token数上限。4096

调用示例

复制请求代码,查看对应的返回示例。

POST/agent-api/v1/tool/executeX-Api-Key
请求代码request.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_bravesearch_llm_context' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "enable_source_metadata": true,
    "maximum_number_of_tokens": 1024,
    "maximum_number_of_urls": 3,
    "q": "Python asyncio TaskGroup exception handling"
  }
}'
返回示例response.json
JSON部分内容
{
  "grounding": {
    "generic": [
      {
        "snippets": [
          "# asyncio.gather Raised an Exception but the Other Tasks Kept Running: TaskGroup vs return\\_exceptions\nIf one coroutine in asyncio.gather() raises, the exception propagates to your await, but the sibling tasks are **not cancelled**. They keep running in th"
        ],
        "title": "asyncio.gather Raised an Exception but the Other Tasks Kept Running: TaskGroup vs return_exceptions - DEV Community",
        "url": "https://dev.to/libme/asynciogather-raised-an-exception-but-the-other-tasks-kept-running-taskgroup-vs-returnexceptions-4kg1"
      }
    ],
    "map": []
  },
  "sources": {
    "https://codemia.io/knowledge-hub/path/asynciogather_vs_asynciowait_vs_asynciotaskgroup": {
      "age": [
        "Tuesday, September 23, 2025"
      ],
      "description": "Python's asyncio module provides three primary tools for running multiple coroutines concurrently: asyncio.gather, asyncio.wait, and asyncio.TaskGroup. Each...",
      "favicon": "https://imgs.search.brave.com/pqkOCZGITTHgqk-p6nQyVxvKKtYA9KMqjCa_JW-lK_0/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvMzQ0ZTE1YWVj/YWI5YTNlZjRmODBm/NWMxNGVlY2VlMjNh/NzcxYmM1NjgxMWRk/YTliNWU3ZGYzYTcz/NWVhNWNlZC9jb2Rl/bWlhLml",
      "fetched_content_timestamp": 1794249418,
      "hostname": "codemia.io",
      "title": "asyncio.gather vs asyncio.wait vs asyncio.TaskGroup"
    },
    "https://dev.to/libme/asynciogather-raised-an-exception-but-the-other-tasks-kept-running-taskgroup-vs-returnexceptions-4kg1": {
      "age": [
        "Saturday, November 14, 2026"
      ],
      "description": "asyncio.gather leaves sibling tasks running after one fails. Here is how TaskGroup, return_exceptions and create_task differ, with runnable code. Tagged with python, programming, tutorial, backend.",
      "favicon": "https://imgs.search.brave.com/UUpF8I85K--vkQzrhameM7iRPRU5VCTXyWbS4sk6G2g/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvNTg5MTcxNDBh/N2U4ODc4MDg0NWQ4/MzU0YWJkNDY3ZWRm/MjUxY2U1YjY5MzJm/YWRlOTI4YjAyZDI1/ZjU0MmJjNi9kZXYu/dG8v",
      "fetched_content_timestamp": 1794697425,
      "hostname": "dev.to",
      "title": "asyncio.gather Raised an Exception but the Other Tasks Kept Running: TaskGroup vs return_exceptions - DEV Community"
    },
    "https://runebook.dev/en/docs/python/library/asyncio-task/asyncio.Task": {
      "age": [],
      "description": "Here's a friendly breakdown of common issues, their fixes, and some alternative approaches with sample code.This is perhaps the most frequent pitfall",
      "favicon": "https://imgs.search.brave.com/Z_N2GGmoYepmBi95IVB6-5t63qpwEuD7K8cQfA4Lr84/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvMmJmZDQwYmIw/Zjg0MGYzNzY3NWY0/YjMxMDI2NzQ3MGU5/OGU3ZTdkMDJjNjJi/NDlmMWU5OTA2MjQ4/N2NiODU0Mi9ydW5l/Ym9vay5",
      "fetched_content_timestamp": 1778803589,
      "hostname": "runebook.dev",
      "title": "python - Mastering asyncio.Task: Fixes for Early Exits and Unhandled Exceptions"
    }
  }
}

返回示例仅展示部分内容,不代表完整响应;复制内容为合法 JSON。