> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/api-targets/cn/sou-suo-yin-qing/google/ai-mode.md).

# AI 模式

该 `google_ai_mode` 该 source 旨在提交提示并获取 Google AI Mode 对话响应。它会同时返回完整的 Google AI Mode 响应文本及其结构化元数据。

## AI Mode 区域可用性

Google AI Mode 在全球大多数国家/地区可用 **除以下例外情况外**:

<table><thead><tr><th width="96">地区</th><th>国家/地区</th></tr></thead><tbody><tr><td>欧洲</td><td>法国、土耳其</td></tr><tr><td>亚洲</td><td>中国、伊朗、朝鲜、叙利亚</td></tr><tr><td>美洲</td><td>古巴</td></tr></tbody></table>

{% hint style="warning" %}
Google AI Mode 功能正在持续推出，并会随着时间增加更多国家/地区。
{% endhint %}

## 请求示例

以下代码示例演示如何检索带解析结果的 Google AI Mode 响应。

{% tabs %}
{% tab title="cURL" %}

```bash
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "google_ai_mode",
        "query": "best health trackers under $200",
        "render": "html",
        "parse": true
    }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from pprint import pprint


# 构造负载。
payload = {
    'source': 'google_ai_mode',
    'query': 'best health trackers under $200',
    'render': 'html',
    'parse': True
}


# 获取响应。
response = requests.request(
    'POST',
    'https://realtime.oxylabs.io/v1/queries',
    auth=('USERNAME', 'PASSWORD'),
    json=payload,
)

# Print prettified response to stdout.
pprint(response.json())
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const https = require("https");

const username = "USERNAME";
const password = "PASSWORD";
const body = {
    source: "google_ai_mode",
    query: "best health trackers under $200",
    render: "html",
    parse: true
};

const options = {
    hostname: "realtime.oxylabs.io",
    path: "/v1/queries",
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        Authorization:
            "Basic " + Buffer.from(`${username}:${password}`).toString("base64"),
    },
};

const request = https.request(options, (response) => {
    let data = "";

    response.on("data", (chunk) => {
        data += chunk;
    });

    response.on("end", () => {
        const responseData = JSON.parse(data);
        console.log(JSON.stringify(responseData, null, 2));
    });
});

request.on("error", (error) => {
    console.error("Error:", error);
});

request.write(JSON.stringify(body));
request.end();
```

{% endtab %}

{% tab title="HTTP" %}

```http
https://realtime.oxylabs.io/v1/queries?source=google_ai_mode&query=best%20health%20trackers%20under%20$200&render=html&parse=true&access_token=12345abcde
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$params = array(
    'source' => 'google_ai_mode',
    'query' => 'best health trackers under $200',
    'render' => 'html',
    'parse' => true
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "USERNAME" . ":" . "PASSWORD");


$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);
```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	const Username = "USERNAME"
	const Password = "PASSWORD"

  	payload := map[string]interface{}{
        	"source": "google_ai_mode",
        	"query": "best health trackers under $200",
        	"render": "html",
        	"parse":  true,
    	}

	jsonValue, _ := json.Marshal(payload)

	client := &http.Client{}
	request, _ := http.NewRequest("POST",
		"https://realtime.oxylabs.io/v1/queries",
		bytes.NewBuffer(jsonValue),
	)

	request.SetBasicAuth(Username, Password)
	response, _ := client.Do(request)

	responseText, _ := ioutil.ReadAll(response.Body)
	fmt.Println(string(responseText))
}
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;

namespace OxyApi
{
    class Program
    {
        static async Task Main()
        {
            const string Username = "USERNAME";
            const string Password = "PASSWORD";

            var parameters = new
            {
                source = "google_ai_mode",
                query = "best health trackers under $200",
                render = "html",
                parse = true
            };

            var client = new HttpClient();

            Uri baseUri = new Uri("https://realtime.oxylabs.io");
            client.BaseAddress = baseUri;

            var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/v1/queries");
            requestMessage.Content = JsonContent.Create(parameters);

            var authenticationString = $"{Username}:{Password}";
            var base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.UTF8.GetBytes(authenticationString));
            requestMessage.Headers.Add("Authorization", "Basic " + base64EncodedAuthenticationString);

            var response = await client.SendAsync(requestMessage);
            var contents = await response.Content.ReadAsStringAsync();

            Console.WriteLine(contents);
        }
    }
}
```

{% endtab %}

{% tab title="Java" %}

```java
package org.example;

import okhttp3.*;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.concurrent.TimeUnit;

public class Main implements Runnable {
    private static final String AUTHORIZATION_HEADER = "Authorization";
    public static final String USERNAME = "USERNAME";
    public static final String PASSWORD = "PASSWORD";

    public void run() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("source", "google_ai_mode");
        jsonObject.put("query", "best health trackers under $200");
        jsonObject.put("render", "html");
        jsonObject.put("parse", true);

        Authenticator authenticator = (route, response) -> {
            String credential = Credentials.basic(USERNAME, PASSWORD);
            return response
                    .request()
                    .newBuilder()
                    .header(AUTHORIZATION_HEADER, credential)
                    .build();
        };

        var client = new OkHttpClient.Builder()
                .authenticator(authenticator)
                .readTimeout(180, TimeUnit.SECONDS)
                .build();

        var mediaType = MediaType.parse("application/json; charset=utf-8");
        var body = RequestBody.create(jsonObject.toString(), mediaType);
        var request = new Request.Builder()
                .url("https://realtime.oxylabs.io/v1/queries")
                .post(body)
                .build();

        try (var response = client.newCall(request).execute()) {
            if (response.body() != null) {
                try (var responseBody = response.body()) {
                    System.out.println(responseBody.string());
                }
            }
        } catch (Exception exception) {
            System.out.println("Error: " + exception.getMessage());
        }

        System.exit(0);
    }

    public static void main(String[] args) {
        new Thread(new Main()).start();
    }
}
```

{% endtab %}

{% tab title="JSON" %}

```json
{
        "source": "google_ai_mode",
        "query": "best health trackers under $200",
        "render": "html",
        "parse": true
}
```

{% endtab %}
{% endtabs %}

我们在示例中使用同步 [**Realtime**](/products/cn/web-scraper-api/integration-methods/realtime.md) 集成方法。如果你想使用 [**Proxy Endpoint**](/products/cn/web-scraper-api/integration-methods/proxy-endpoint.md) 或异步 [**Push-Pull**](/products/cn/web-scraper-api/integration-methods/push-pull.md) 集成，请参考 [**集成方法**](/products/cn/web-scraper-api/integration-methods.md) 部分。

## 请求参数值

用于检索 Google AI Mode 响应的基本设置和自定义选项。

<table><thead><tr><th width="222">参数</th><th width="350.3333333333333">描述</th><th>默认值</th></tr></thead><tbody><tr><td><mark style="background-color:green;"><strong>source</strong></mark></td><td>设置爬虫。使用 <code>google_ai_mode</code>.</td><td>–</td></tr><tr><td><mark style="background-color:green;"><strong>query</strong></mark></td><td>提交给 Google AI Mode 的提示或问题。必须少于 400 个字符。</td><td>–</td></tr><tr><td><mark style="background-color:green;"><strong>render</strong></mark></td><td>设置为 <code>html</code> 此 source 需要此设置。 <a href="/spaces/ZwEHB9k4MH4pDy80n9mF/pages/9d7133837001de31de5dfd0796cfbc6fdd7c78c8#javascript-rendering"><strong>更多信息</strong></a><strong>.</strong></td><td>–</td></tr><tr><td><code>parse</code></td><td>当设置为时返回解析后的数据 <code>true</code>.</td><td><code>false</code></td></tr><tr><td><code>geo_location</code></td><td>结果应适配的地理位置。更多信息，请阅读我们建议的 <code>geo_location</code> 参数结构 <a href="/spaces/ZwEHB9k4MH4pDy80n9mF/pages/8100bad86572299adc88ab0e6fd42d380eb8ca21#google"><strong>此处</strong></a><strong>.</strong></td><td>–</td></tr><tr><td><code>callback_url</code></td><td>指向你的回调端点的 URL。 <a href="/spaces/ZwEHB9k4MH4pDy80n9mF/pages/f93fe40aed5366f8033cd2ebfae30e61c16a4f51"><strong>更多信息</strong></a></td><td>–</td></tr></tbody></table>

&#x20;    \- 必填参数

## 结构化数据

网页爬虫API 返回 Google AI Mode 输出的 HTML 或 JSON 对象，其中包含结果页的结构化数据。

{% hint style="warning" %}
元素的组成可能会因查询是否来自于一个 **桌面端** 或 **移动** 设备。
{% endhint %}

<details>

<summary><code>google_ai_mode</code> 结构化输出</summary>

```json
{
    "results": [
        {
            "content": {
                "links": [
                    {
                        "url": "https://www.nytimes.com/wirecutter/reviews/the-best-fitness-trackers/#:~:text=%7C,Apple%20users:%20Apple%20Watch%20SE",
                        "text": "2025年3款最佳健身追踪器 | Wirecutter评测"
                    },
                    {
                        "url": "https://www.wareable.com/fitness-trackers/the-best-fitness-tracker#:~:text=Fitbit%20Charge%206%20%E2%80%93%20the%20best,10%20%E2%80%93%20Best%20fitness%2Dtracking%20smartwatch",
                        "text": "2025年最佳健身追踪器：已评测、测试和比较"
                    },
                    {
                        "url": "https://www.techradar.com/best/best-cheap-fitness-trackers",
                        "text": "2025年最佳平价健身追踪器 - TechRadar"
                    },
                    {
                        "url": "https://www.livescience.com/best-budget-fitness-tracker",
                        "text": "2025年最佳平价健身追踪器：由我们的专家评审精选"
                    },
                    {
                        "url": "https://www.garagegymreviews.com/best-budget-fitness-tracker",
                        "text": "专家测试：最佳平价健身追踪器（2025）"
                    },
                    {
                        "url": "https://www.businessinsider.com/guides/tech/best-fitbit#:~:text=Our%20top%20recommendation%20is%20the,fitness%20tools%20for%20under%20%24100.",
                        "text": "2025年最佳 Fitbit - Business Insider"
                    },
                    {
                        "url": "https://medium.com/@kellyshephard/best-smartwatches-under-200-5961cbc1a6f8#:~:text=The%20Apple%20Watch%20SE%20(2022)%20is%20the,it%20still%20performs%20well%20throughout%20the%20day.",
                        "text": "2025年200美元以下最佳智能手表：已测试并认可"
                    },
                    {
                        "url": "https://www.gminsights.com/industry-analysis/smartwatch-market#:~:text=More%20advanced%20functions%20such%20as%20ECG%20monitoring%2C,Galaxy%20Watch%205%2C%20and%20Fitbit%20Sense%202.",
                        "text": "智能手表市场份额、增长分析报告 2025-2034"
                    },
                    {
                        "url": "https://www.linkedin.com/pulse/best-smartwatches-law-enforcement-rugged-reliable-ready-samar-abbas-n1bif#:~:text=Q6:%20What's%20the%20best%20smartwatch%20for%20health,especially%20for%20VO2%20Max%20and%20stress%20levels.",
                        "text": "执法人员最佳智能手表：坚固、可靠、随时待命"
                    },
                    {
                        "url": "https://gearjunkie.com/health-fitness/best-fitness-watch#:~:text=Technology%20for%20health%20tracking%20has%20advanced%20a,and%20infrared%20light)%20and%20Heart%20Rate%20Variability.",
                        "text": "2025年最佳健身手表"
                    }
                ],
                "prompt": "200美元以下最佳健康追踪器"
                "citations": [
                    {
                        "text": "追踪器",
                        "urls": [
                            "https://www.nytimes.com/wirecutter/reviews/the-best-fitness-trackers/#:~:text=%7C,Apple%20users:%20Apple%20Watch%20SE",
                            "https://www.livescience.com/best-budget-fitness-tracker",
                            "https://www.techradar.com/best/best-cheap-fitness-trackers"
                        ]
                    },
                    {
                        "text": "追踪准确性：像 Fitbit 和 Garmin 这样的知名品牌在心率、步数和睡眠追踪方面准确可靠。许多机型还提供更高级的指标，如血氧（SpO2）和压力。GPS：对于跑步者和骑行者来说，内置 GPS 对于规划路线和记录距离至关重要，无需随身携带手机。如果你不需要这项功能，或者愿意依赖手机的 GPS，就可以选择没有此功能的追踪器来省钱。订阅服务：像 Fitbit 这样的品牌提供高级会员，用于解锁更详细的洞察和指导计划。不过，这份列表中的所有追踪器都提供免费的基础追踪。电池续航：更简单的追踪器通常一次充电可使用一周或更久，而像 Apple Watch SE 这样的更复杂智能手表则需要每天充电。设计与舒适度：考虑追踪器的尺寸和样式。有些人偏好基础手环的小巧轻便设计，而另一些人则喜欢智能手表更大、交互性更强的显示屏。",
                        "urls": [
                            "https://www.nytimes.com/wirecutter/reviews/the-best-fitness-trackers/#:~:text=%7C,Apple%20users:%20Apple%20Watch%20SE",
                            "https://www.wareable.com/fitness-trackers/the-best-fitness-tracker#:~:text=Fitbit%20Charge%206%20%E2%80%93%20the%20best,10%20%E2%80%93%20Best%20fitness%2Dtracking%20smartwatch"
                        ]
                    }
                ],
                "response_text": "对于 200 美元以下的产品，最佳健康追踪器包括：Fitbit Inspire 3，综合价值最佳；Xiaomi Smart Band 9，最佳超低预算选择；以及 Apple Watch SE（第二代），适合 iPhone 用户。其他强有力的竞争者包括更先进的 Fitbit Charge 6 和 Garmin Vivosmart 5。200 美元以下最佳健康追踪器对比 追踪器 最适合 内置 GPS 功能 优点 缺点 Fitbit Inspire 3 综合最佳，适合初学者 否（使用手机 GPS） 24/7 心率、SpO2、睡眠追踪、Active Zone Minutes 超高性价比、低调设计、续航长（最长 10 天） 需要订阅才能获得更详细的洞察；屏幕较小 Fitbit Charge 6 更高级的追踪 是 内置 GPS、ECG、压力追踪、用于压力的 EDA 传感器、Google Wallet/Maps 准确的心率追踪，包含实用的 Google 集成 需要 Google 账号；部分功能需订阅才能使用 Xiaomi Smart Band 9 最佳超低预算选择 否（使用手机 GPS） 心率、SpO2、睡眠追踪、150+ 种锻炼模式 非常实惠、大屏幕、续航出色（最长 21 天） 一些用户反映应用连接不稳定，准确性不一致 Garmin Vivosmart 5 Garmin 最佳 否（使用手机 GPS） Body Battery 能量监测、睡眠追踪、SpO2、自动活动追踪 轻便舒适，睡眠追踪尤其出色 单色屏幕，且无内置 GPS Apple Watch SE（第二代） 适合 iPhone 用户 是 心率、活动环、跌倒检测、应用生态 与 iPhone 无缝集成；屏幕鲜艳 电池续航较短（最长 18 小时）；价格更高 Fitbit Inspire 3 健康与健身活动追踪器 黑色，带运动强度 R$646.00 4.4 (5K+) XIAOMI SMART BAND 9 - 午夜黑 R$237.07 (Rs\u00a012,499.00) 4.8 (7K+) Apple Watch SE GPS + Cellular 40mm 午夜铝金属表壳，配午夜运动表带 - M/L R$184.11/mo x 18 4.6 (9K+) Fitbit Charge 6 活动与健身追踪器，内置 Google 应用 R$832.34 ($156.00) 4.2 (5K+) Garmin Vivosmart 5，黑色 S/m (010-02645-00) R$800.27 ($149.99) 4.2 (2K+) 查看更多 需要考虑的关键功能 追踪准确性：像 Fitbit 和 Garmin 这样的知名品牌在心率、步数和睡眠追踪方面准确可靠。许多机型还提供更高级的指标，如血氧（SpO2）和压力。GPS：对于跑步者和骑行者来说，内置 GPS 对于规划路线和记录距离至关重要，无需随身携带手机。如果你不需要这项功能，或者愿意依赖手机的 GPS，就可以选择没有此功能的追踪器来省钱。订阅服务：像 Fitbit 这样的品牌提供高级会员，用于解锁更详细的洞察和指导计划。不过，这份列表中的所有追踪器都提供免费的基础追踪。电池续航：更简单的追踪器通常一次充电可使用一周或更久，而像 Apple Watch SE 这样的更复杂智能手表则需要每天充电。设计与舒适度：考虑追踪器的尺寸和样式。有些人偏好基础手环的小巧轻便设计，而另一些人则喜欢智能手表更大、交互性更强的显示屏。谢谢 你的反馈有助于 Google 改进。查看我们的隐私政策。分享更多反馈 报告问题 关闭",
                "parse_status_code": 12000
            },
            "created_at": "2025-10-28 14:41:42",
            "updated_at": "2025-10-28 14:41:59",
            "page": 1,
            "url": "https://www.google.com/search?udm=50&q=best+health+trackers+under+$200&hl=en&sei=KtYAaaHbBZ_m1sQP0IOaqQg&mstk=AUtExfAUpaUCxnFayf6G4-kNkwNbm0bQCoQ9U98qUnjI2A0E7T5DCKi2lmolJe5o9X9h3tJVH-Cx91tGJrhIiDPrrcvO4kX8vex4rnW_IUsQA-b6EGmpCtqj2ocY-FWO95EcMcaYeOvsQhtFqGdYF4CChex2n6h4PeopuL0&csuir=1",
            "job_id": "7388948081053534209",
            "is_render_forced": false,
            "status_code": 200,
            "type": "已解析",
            "parser_type": "",
            "parser_preset": null
        }
    ],
    "job": {
        "callback_url": null,
        "client_id": 12345,
        "context": [
            {
                "key": "force_headers",
                "value": false
            },
            {
                "key": "force_Cookie",
                "value": false
            },
            {
                "key": "hc_policy",
                "value": true
            },
            {
                "key": "successful_parse_status_codes",
                "value": []
            }
        ],
        "created_at": "2025-10-28 14:41:42",
        "geo_location": null,
        "id": "7388948081053534209",
        "limit": 10,
        "locale": null,
        "pages": 1,
        "parse": true,
        "parser_type": null,
        "parser_preset": null,
        "parsing_instructions": null,
        "browser_instructions": null,
        "render": "html",
        "xhr": false,
        "markdown": false,
        "url": null,
        "query": "best health trackers under $200",
        "source": "google_ai_mode",
        "start_page": 1,
        "status": "done",
        "storage_type": null,
        "storage_url": null,
        "subdomain": "www",
        "content_encoding": "utf-8",
        "updated_at": "2025-10-28 14:41:59",
        "user_agent_type": "desktop",
        "session_info": null,
        "statuses": [],
        "client_notes": null,
        "_links": [
            {
                "rel": "self",
                "href": "http://data.oxylabs.io/v1/queries/7388948081053534209",
                "method": "GET"
            },
            {
                "rel": "results",
                "href": "http://data.oxylabs.io/v1/queries/7388948081053534209/results",
                "method": "GET"
            },
            {
                "rel": "results-content",
                "href_list": [
                    "http://data.oxylabs.io/v1/queries/7388948081053534209/results/1/content"
                ],
                "method": "GET"
            },
            {
                "rel": "results-html",
                "href": "http://data.oxylabs.io/v1/queries/7388948081053534209/results?type=raw",
                "method": "GET"
            },
            {
                "rel": "results-content-html",
                "href_list": [
                    "http://data.oxylabs.io/v1/queries/7388948081053534209/results/1/content?type=raw"
                ],
                "method": "GET"
            },
            {
                "rel": "results-parsed",
                "href": "http://data.oxylabs.io/v1/queries/7388948081053534209/results?type=parsed",
                "method": "GET"
            },
            {
                "rel": "results-content-parsed",
                "href_list": [
                    "http://data.oxylabs.io/v1/queries/7388948081053534209/results/1/content?type=parsed"
                ],
                "method": "GET"
            }
        ]
    }
}
```

</details>

## 输出数据字典

### HTML 示例

<figure><img src="/files/a7109db7ba42b324a1fe584c08581736ea439a50" alt=""><figcaption></figcaption></figure>

### JSON 结构

结构化的 `google_ai_mode` 输出包含如下字段 `URL`, `页`, `结果`等。下表详细列出我们解析的每个 Google AI Mode 元素，包括说明、数据类型和相关元数据。

{% hint style="info" %}
特定结果类型的项目数和字段数可能会因搜索查询而异。
{% endhint %}

<table data-full-width="false"><thead><tr><th width="289">键名</th><th width="337.3333333333333">描述</th><th>类型</th></tr></thead><tbody><tr><td><code>url</code></td><td>Google AI Mode 的 URL。</td><td>字符串</td></tr><tr><td><code>页</code></td><td>页码。</td><td>整数</td></tr><tr><td><code>内容</code></td><td>包含已解析 Google AI Mode 响应数据的对象。</td><td>对象</td></tr><tr><td><code>content.links</code></td><td>响应中引用的外部链接列表。显示在页面右侧的框中。</td><td>数组</td></tr><tr><td><code>content.prompt</code></td><td>提交到 Google AI Mode 的原始提示。</td><td>字符串</td></tr><tr><td><code>content.citations</code></td><td>包含 URL 和相关文本的引用列表，如 Google AI Mode 响应主块中所示。引用同一文本的多个 URL 会分组到一个列表中。</td><td>数组</td></tr><tr><td><code>content.response_text</code></td><td>来自 Google AI Mode 的完整响应文本。</td><td>字符串</td></tr><tr><td><code>content.parse_status_code</code></td><td>解析操作的状态码。</td><td>整数</td></tr><tr><td><code>created_at</code></td><td>抓取任务创建时的时间戳。</td><td>时间戳</td></tr><tr><td><code>updated_at</code></td><td>抓取任务完成时的时间戳。</td><td>时间戳</td></tr><tr><td><code>job_id</code></td><td>与抓取任务关联的任务 ID。</td><td>字符串</td></tr><tr><td><code>status_code</code></td><td>抓取任务的状态码。你可以查看所描述的爬虫状态码 <a href="/spaces/ZwEHB9k4MH4pDy80n9mF/pages/3d4407f90bbe20d112e9eeb355b2d8d6a2289d82"><strong>此处</strong></a>.</td><td>整数</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.oxylabs.io/api-targets/cn/sou-suo-yin-qing/google/ai-mode.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
