Alexa 爬虫
`scraper.alexa` 执行器返回的 Alexa 响应会附带相关提示词、引用和媒体资源,以便您评估该模型在不同市场中的回答表现。
请求示例
curl 'https://api.scrapeless.com/api/v2/scraper/request' \
--header 'Content-Type: application/json' \
--header 'x-api-token: {you_api_key}' \
--data '{
"actor": "scraper.alexa",
"input": {
"prompt": "Recommended attractions in New York",
"country": "US"
},
"webhook": {
"url": "http://www.youwebhook.com"
}
}'请求体参数
| 参数 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
prompt | string | 是 | 发送给 Alexa 的提示词。 |
country | string | 是 | 国家或地区代码。 |
响应字段
| 参数 | 类型 | 描述 |
|---|---|---|
user_text | string | 用户发送的原始文本。 |
md_text | string | Alexa 返回的 Markdown 格式回答。 |
raw_text | string | Alexa 返回的纯文本回答。 |
completed | bool | 回答生成是否已完成。 |
answer_fragment_uri | string | 回答片段的 URI。 |
answer_revision | int | 回答的版本号。 |
dialog_request_id | string | 对话请求的标识符。 |
endpoint_id | string | 响应端点/设备的标识符。 |
fragment_count | int | 响应片段的数量。 |
conversation | object | 对话上下文。 |
conversation.id | string | 对话标识符。 |
directives | array | 交互过程中发出的处理指令。 |
directives.name | string | 指令名称,例如 RequestProcessingStarted。 |
directives.namespace | string | 指令命名空间,例如 InteractionModel。 |
directives.message_id | string | 指令消息的唯一标识符。 |
directives.dialog_request_id | string | 与该指令关联的对话请求 ID。 |
directives.fragment_count | int | 该指令的片段数量。 |
references | array | 回答中引用的来源。 |
references.id | string | 引用标识符,例如 cite_NWXekzs。 |
references.title | string | 引用来源的标题。 |
references.url | string | 引用来源的 URL。 |
sources | array | 支撑回答的来源链接。 |
sources.text | string | 来源的显示文本,例如网站名称。 |
sources.url | string | 来源的 URL。 |
sources.type | string | 来源类型,例如 OpenURL。 |
sources.fragment_uri | string | 来源片段的 URI。 |
suggestions | array | 建议的后续提示词。 |
suggestions.text | string | 建议的显示文本。 |
suggestions.message | string | 选择该建议时发送的消息。 |
suggestions.type | string | 建议类型,例如 TextMessage。 |
suggestions.fragment_uri | string | 建议片段的 URI。 |
products | array | Alexa 返回的产品信息(不适用时为空)。 |
products.product_id | string | 产品标识符,例如 Amazon ASIN。 |
products.citation_id | string | 将产品与回答关联的引用标识符。 |
products.title | string | 产品标题。 |
products.image_url | string | 产品图片 URL。 |
products.url | string | 产品页面 URL。 |
products.price | string | 显示价格,例如 $989.95。 |
products.delivery | string | 配送信息,例如 Delivery by Tuesday, July 7。 |
products.details | array | 详细信息行列表(标题、价格、配送等)。 |
products.fragment_uri | string | 产品片段的 URI。 |
products.purpose | string | 产品条目的用途,例如 INFORMATION。 |