> ## Documentation Index
> Fetch the complete documentation index at: https://docs.querying.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini API：回答、依据来源与商品卡片

> 向 Google Gemini 提问，获取回答、依据来源、商品、地点和视频。

`GEMINI` 向 Google Gemini 提问，返回回答及其依据的来源。

| | |
| - | - |
| taskType | `GEMINI` |
| 读取 | `prompt`（回退到 `query`） |
| 积分 | 1.25 |
| 国家 | 可选，默认 `US`。`CN` 从美国出口提问，并使用北京的设备位置。 |
| 位置 | 接受 `payload.location`。见[地区与位置](/zh/engines/capacity.md)。 |

## 请求

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskType": "GEMINI", "payload": { "prompt": "best CRM for a small team", "country": "US" } }'
```

## 响应

| 字段 | 类型 | 说明 |
| - | - | - |
| `text` | string | 回答。始终存在。 |
| `sources` | array | 依据来源：`position`、`url`、`label`、`description` 和 `confidence_level`（0-100）。始终存在。 |
| `model` | string | Gemini 回答所用的模型（如已知）。 |
| `markdown` | string | Markdown 格式的回答。仅在设置 `include.markdown` 时返回。 |
| `shoppingCards` | array | 回答中绘制的商品卡片：`title`、`position`、`price`（`value`、`currency`、`raw`）、`store`、`rating`、`reviews`、`thumbnail`、`productLink`。 |
| `inlineProducts` | array | 回答中带链接的商品名称：`title`、`position`、`productLink`。 |
| `map` | array | 回答中的地点：`name`、`position`、`placeId`、`location`、`phoneNumber`、`url`、`mapsUrl`、`reviews`、`category`。 |
| `videos` | array | YouTube 卡片：`title`、`url`、`medium`、`thumbnail`、`source`、`duration`。 |
| `images` | array | 随回答显示的图片。 |
| `weather` | object | 回答显示天气组件时的 Gemini 天气组件。 |
| `rawResponse` | array | 流帧。仅在设置 `include.rawResponse` 时返回。 |

商品、地点、视频和天气字段仅在回答显示它们时出现。

例如：

```json theme={"theme":"css-variables"}
{
  "text": "For a small team, HubSpot CRM and Pipedrive are strong choices ...",
  "sources": [
    { "position": 1, "url": "https://www.example.com/crm-guide", "label": "CRM guide for small teams", "confidence_level": 87 }
  ],
  "model": "...",
  "shoppingCards": [
    {
      "title": "Acme Desk Phone",
      "position": 1,
      "price": { "value": 249.99, "currency": "$", "raw": "$249.99" },
      "store": "Northwind Electronics",
      "rating": 4.7,
      "reviews": "14292",
      "thumbnail": "https://...",
      "productLink": "https://google.com/search?...&ibp=oshop..."
    }
  ]
}
```

卡片名称保留在 `text` 中，句中的商品链接指向 Google 商品页面。YouTube 卡片在 Gemini 绘制它的位置，以带链接的缩略图出现在 `text` 和 `markdown` 中。Gemini 运行代码进行计算时，回答是它给出的结果，代码及其输出不包含在内。

## Include 标志

| 标志 | 效果 |
| - | - |
| `markdown` | 添加 `markdown`。 |
| `rawResponse` | 添加 `rawResponse`。 |
| `html` | 添加 `html`，即 Gemini 显示的画面。见 [HTML 页面](/zh/engines/html-pages.md)。 |
| `analysis` | 添加 `analysis`，1 积分。见[回答分析](/zh/engines/answer-analysis.md)。 |
| `citationAnalysis` | 对回答运行[Citation Analysis](/zh/research/citation-analysis.md)。 |

`searchQueries`、`ads` 和 `shopping` 不起作用。见 [Markdown 与原始响应](/zh/engines/response-options.md)。

## 相关内容

* [Gemini 产品页](https://querying.ai/zh/engines/gemini)
* [引擎概览](/zh/engines/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.