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

> ## Agent Instructions
> Use https://docs.fastino.ai/openapi.json as the source of truth for customer-facing routes. For GLiDE decision inference, call POST https://api.fastino.ai/v1/systemone with model fastino/glide. Do not infer undocumented routes. Read API keys from FASTINO_API_KEY and never embed credentials in code, logs, or reports.

# Choice：GLiDE 的多选一决策基本类型

> 让 GLiDE 从你定义的集合中选出一个选项，并返回所选选项、置信度值以及完整的概率分布。

**Choice** 问题让 GLiDE 从调用方定义的固定集合（最多 255 个命名选项）中选出一个选项。响应包含所选选项、一个置信度值，以及你定义的所有选项上的完整概率分布。

当答案是若干无序类别中的一个时，请使用 Choice：应由哪个团队处理某张工单、某个产品属于哪个类别、某段代码片段使用的是哪种语言。

## 请求

<ParamField body="type" type="string" required>
  始终为 `"choice"`。
</ParamField>

<ParamField body="instructions" type="string" required>
  以自然语言描述的待评估问题。
</ParamField>

<ParamField body="criteria" type="object" required>
  将最多 255 个选项键映射到描述字符串的对象，例如 `{"billing": "Payment or charge disputes", "returns": "Refund or return requests"}`。选项名称及其描述都会发送给模型，因此请编写能够区分相似选项的描述。
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -s https://api.fastino.ai/v1/systemone \
    -H "X-API-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "fastino/glide",
      "state": "Refund request: the receipt is attached, the purchase was 10 days ago, and refunds are allowed within 30 days.",
      "questions": {
        "department": {
          "type": "choice",
          "instructions": "Which team should handle this request?",
          "criteria": {
            "billing": "Payment or charge disputes",
            "returns": "Refund or return requests",
            "shipping": "Delivery or shipping issues"
          }
        }
      }
    }'
  ```
</CodeGroup>

## 响应

```json theme={null}
{
  "department": {
    "type": "choice",
    "choice": "returns",
    "confidence": 0.9983415574354015,
    "probabilities": {
      "billing": 0.000576420510560337,
      "returns": 0.9989179779459618,
      "shipping": 0.0005056015434779647
    }
  }
}
```

* `choice`：概率最高的选项。
* `probabilities`：你定义的所有选项上的完整分布；键与你的 `criteria` 键一致，总和约为 1。
* `confidence`：`top1 − top2`，即最佳与次佳选项之间的概率差，从 `0`（两个选项持平）到 `1`（某个选项占据几乎全部概率质量）。关于如何据此采取行动，请参阅[置信度](/cn/concepts/decision-models#置信度)。

## 使用结果

```python theme={null}
answer = response["answers"]["department"]

queue_map = {"billing": "billing-team", "returns": "returns-desk", "shipping": "logistics"}
target_queue = queue_map[answer["choice"]]

if answer["confidence"] < 0.5:
    notify("routing uncertain — runner-up may also apply")
```

## 在一次调用中提出所需的全部问题

请在单个请求中针对同一个 `state` 评估多个 Choice 问题，而不是每个问题发送一个请求。这些问题会被独立回答，因此增加一个问题会消耗更多 token，但几乎不会影响延迟。例如，支持分诊调用可以一次性提出 `department`、`urgency` 和 `tone`，而无需三次往返；你的代码可以先根据 `department` 采取行动，在需要时再使用其余结果。完整示例请参阅[组合多个问题](/cn/concepts/decision-models#组合多个问题)。

请向模型提供真实选项的完整列表，而不是精简后的候选列表：一个 Choice 问题最多接受 255 个选项，而每个选项只消耗少量 token。当输入可能无法覆盖所有情况时，请添加 `other` 或 `none of the above` 选项，让 GLiDE 有地方安放概率质量，而不是被迫将其错误地匹配到某个命名选项上。

## 相关内容

* [Noul](/cn/concepts/glide-noul)：返回概率的是/否决策
* [Score](/cn/concepts/glide-score)：在有序量表上评级
* [决策模型](/cn/concepts/decision-models)：基本类型概览、限制以及完整的请求约定
* [GLiDE](/cn/concepts/glide)：GLiDE 是什么以及何时使用它
