linkfox-amazon-alexa-for-shopping

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Amazon Alexa Shopping Assistant

Amazon Alexa 购物助手

This skill drives Amazon's storefront Alexa shopping assistant: pose a natural-language question and get an answer, a curated product list (with ASINs and links), and a set of follow-up questions Alexa is willing to continue with. Each call supports only one prompt. For multi-turn conversations, the agent must summarize prior context and concatenate it with the new question in a fresh call.
本技能用于调用亚马逊前台的Alexa购物助手:提出自然语言问题,即可获取回答、精选商品列表(包含ASIN及链接),以及Alexa可继续回应的追问问题集合。每次调用仅支持一个prompt。如需多轮对话,Agent必须总结之前的上下文并将其与新问题拼接后发起新调用。

Core Concepts

核心概念

  1. Single-turn per call:
    prompts
    is an array but only supports 1 element. Each API call sends exactly one question to Alexa and returns one answer. Do not pass multiple elements.
  2. Cross-call context is not preserved: every call starts a brand-new Alexa session. To ask follow-up questions, the agent must summarize the previous answer (key recommendations, ASINs, relevant context) and concatenate it with the new question as
    prompts[0]
    in a new call.
  3. Optional page context (
    url
    )
    : pass an Amazon page URL only when you want the conversation anchored to a specific page (a category page, search results page, or product detail page). Do not pass a plain marketplace homepage URL like
    https://www.amazon.com/
    — it adds no useful context. Omit
    url
    entirely when there is no specific page to anchor on.
  4. Two output formats:
    • markdown
      (default) — a single readable Markdown report containing the question, Alexa's answer, recommended product groups, and follow-up questions.
    • json
      — a structured array under
      data
      , where each entry carries
      prompt
      ,
      content
      ,
      products
      (grouped recommendations),
      followUpQuestions
      , and
      screenshot
      .
resultsNum
is the number of conversation turns Alexa actually answered; if
0
, Alexa did not produce a usable reply for the input.
  1. 单次调用单轮对话
    prompts
    是一个数组,但仅支持1个元素。每次API调用向Alexa发送一个问题并返回一个回答,请勿传入多个元素。
  2. 跨调用不保留上下文:每次调用都会开启一个全新的Alexa会话。如需发起追问,Agent必须总结之前的回答(核心推荐内容、ASIN、相关上下文),并将其与新问题拼接后作为新调用中的
    prompts[0]
    传入。
  3. 可选页面上下文(
    url
    :仅当你希望对话锚定到特定页面(分类页、搜索结果页或商品详情页)时,才传入亚马逊页面URL。请勿传入
    https://www.amazon.com/
    这类普通的商城首页URL——它无法提供有用的上下文。当没有特定页面可锚定时,请完全省略
    url
    参数。
  4. 两种输出格式
    • markdown
      (默认)——一份易读的Markdown报告,包含问题、Alexa的回答、推荐商品分组以及追问问题。
    • json
      ——
      data
      字段下的结构化数组,每个条目包含
      prompt
      content
      products
      (分组推荐商品)、
      followUpQuestions
      screenshot
resultsNum
是Alexa实际回应的对话轮次数量;若为
0
,则表示Alexa未对输入生成可用回复。

Parameters

参数说明

ParameterTypeRequiredDescriptionDefault
promptsstring[]YesConversation prompts. Only 1 element is allowed per call. To ask follow-up questions, make a new call with context summary + new question as
prompts[0]
.
-
formatstringNoResponse format:
markdown
returns a readable report;
json
returns a structured array.
markdown
urlstringNoSpecific Amazon page URL (category, search results, or product detail) to anchor the conversation. Skip when there is no specific page; do not pass a plain homepage URL such as
https://www.amazon.com/
.
-
参数类型是否必填描述默认值
promptsstring[]对话提示词。每次调用仅允许1个元素。如需发起追问,需发起新调用,并将上下文总结+新问题作为
prompts[0]
传入。
-
formatstring响应格式:
markdown
返回易读的报告;
json
返回结构化数组。
markdown
urlstring用于锚定对话的特定亚马逊页面URL(分类页、搜索结果页或商品详情页)。无特定页面时请跳过;请勿传入
https://www.amazon.com/
这类普通首页URL。
-

Response Fields

响应字段

FieldTypeDescription
stdoutstringMarkdown report when
format=markdown
: per-turn question, Alexa answer, recommended product groups, follow-up questions
dataarrayStructured turns when
format=json
. Each item has
prompt
,
content
,
products[]
,
followUpQuestions[]
,
screenshot
resultsNumintegerNumber of answered turns (0 = Alexa did not respond)
code / errcodestring / integer
200
on success; non-200 indicates a business error
msg / errmsgstring
ok
on success; otherwise an error description
costTimeintegerAPI latency in milliseconds
costTokenintegerTokens consumed (only billed on success)
taskIdstringUpstream task identifier for tracing
typestringRender hint:
stdoutWorkbenches
for markdown,
json
for json
字段类型描述
stdoutstring
format=markdown
时为Markdown报告:包含每轮对话的问题、Alexa的回答、推荐商品分组以及追问问题
dataarray
format=json
时为结构化对话轮次。每个条目包含
prompt
content
products[]
followUpQuestions[]
screenshot
resultsNuminteger已回应的对话轮次数量(0表示Alexa未回应)
code / errcodestring / integer成功时为
200
;非200表示业务错误
msg / errmsgstring成功时为
ok
;否则为错误描述
costTimeintegerAPI延迟(毫秒)
costTokeninteger消耗的Token数量(仅成功调用时计费)
taskIdstring用于追踪的上游任务标识符
typestring渲染提示:
markdown
对应
stdoutWorkbenches
json
对应
json

Structured
data[*]
shape (
format=json
)

结构化
data[*]
格式(
format=json

FieldTypeDescription
promptstringThe question or follow-up sent for this turn
contentstringAlexa's natural-language answer
products[].titlestringGroup title (e.g. "Top picks", "Best for running")
products[].items[].asinstringProduct ASIN
products[].items[].titlestringProduct title
products[].items[].urlstringProduct detail page URL
products[].items[].coverstringProduct cover image URL
products[].items[].pricestringCurrent price string (with currency)
products[].items[].originalPricestringList price / strikethrough price
products[].items[].scorestringStar rating
products[].items[].ratingsCountstringReview count
products[].items[].describestringShort product blurb
followUpQuestionsstring[]Questions Alexa offers to continue with
screenshotstringScreenshot URL for this turn
字段类型描述
promptstring本轮对话发送的问题或追问
contentstringAlexa的自然语言回答
products[].titlestring分组标题(例如:"Top picks"、"Best for running")
products[].items[].asinstring商品ASIN
products[].items[].titlestring商品标题
products[].items[].urlstring商品详情页URL
products[].items[].coverstring商品封面图URL
products[].items[].pricestring当前价格字符串(含货币单位)
products[].items[].originalPricestring标价/划线价
products[].items[].scorestring星级评分
products[].items[].ratingsCountstring评论数量
products[].items[].describestring商品简短介绍
followUpQuestionsstring[]Alexa提供的可继续追问的问题
screenshotstring本轮对话的截图URL

API Usage

API 使用方法

This skill calls the LinkFox tool gateway. See
references/api.md
for the calling convention, request/response shape, error codes, and a curl example. You can also run
scripts/amazon_alexa_search.py
directly to test it from the command line.
本技能调用LinkFox工具网关。调用规范、请求/响应格式、错误码及curl示例请查看
references/api.md
。你也可以直接运行
scripts/amazon_alexa_search.py
从命令行进行测试。

How to Build Queries

如何构造查询

  1. Front-load the user's intent in
    prompts[0]
    — include marketplace cue ("on Amazon US"), use case, and any hard constraints (budget, key feature). Alexa weights the opening question heavily.
  2. One question per call
    prompts
    only accepts 1 element. Do not pass multiple elements.
  3. For follow-ups, summarize and re-ask — when the user wants to continue the conversation, the agent must: (a) summarize the key points from the previous Alexa response (answer highlights, recommended ASINs, relevant context); (b) concatenate the summary with the new question; (c) send as
    prompts[0]
    in a new API call. Alexa has no memory of prior calls.
  4. Anchor with
    url
    only when there's a specific page
    — pass a category, search results, or product detail URL when the user is reasoning over that page. Skip
    url
    for general questions; do not pass a plain homepage like
    https://www.amazon.com/
    .
  5. Pick
    format
    deliberately
    markdown
    is best for showing the user a polished answer;
    json
    is better when downstream code needs to extract ASINs, prices, or follow-up questions programmatically.
  1. prompts[0]
    中优先体现用户意图
    ——包含商城提示(如"on Amazon US")、使用场景以及任何硬性限制(预算、核心功能)。Alexa会重点关注初始问题。
  2. 每次调用一个问题——
    prompts
    仅接受1个元素,请勿传入多个元素。
  3. 追问时需总结并重提问题——当用户希望继续对话时,Agent必须:(a)总结Alexa之前回复的关键点(回答要点、推荐ASIN、相关上下文);(b)将总结内容与新问题拼接;(c)作为新API调用中的
    prompts[0]
    发送。Alexa不保留之前调用的记忆。
  4. 仅当有特定页面时使用
    url
    锚定
    ——当用户针对某页面进行咨询时,传入分类页、搜索结果页或商品详情页URL。通用问题请跳过
    url
    参数;请勿传入
    https://www.amazon.com/
    这类普通首页。
  5. 谨慎选择
    format
    ——
    markdown
    最适合向用户展示排版精美的回答;当下游代码需要以编程方式提取ASIN、价格或追问问题时,
    json
    格式更合适。

Usage Examples

使用示例

1. Single-turn shopping question
json
{
  "prompts": ["best wireless earbuds for running on Amazon US under $100"]
}
2. Follow-up question (agent summarizes prior context and re-asks)
First call:
json
{
  "prompts": ["best electric kettle on Amazon US"]
}
Second call (agent summarizes the previous answer and appends the follow-up):
json
{
  "prompts": ["Previously Alexa recommended: 1) Cosori Electric Kettle (B07T1KY5TZ, $35.99, 4.7★), 2) Mueller Ultra Kettle (B09KC7D3HR, $29.97, 4.5★). Now compare these two on noise level and boil time."]
}
3. Question anchored to a category page
json
{
  "prompts": ["What are the most popular picks on this page?"],
  "url": "https://www.amazon.com/s?k=electric+kettle"
}
4. Structured output for downstream extraction
json
{
  "prompts": ["best gift ideas for a 10-year-old who likes science"],
  "format": "json"
}
1. 单轮购物问题
json
{
  "prompts": ["best wireless earbuds for running on Amazon US under $100"]
}
2. 追问问题(Agent总结之前的上下文并重提)
首次调用:
json
{
  "prompts": ["best electric kettle on Amazon US"]
}
第二次调用(Agent总结之前的回答并追加追问):
json
{
  "prompts": ["Previously Alexa recommended: 1) Cosori Electric Kettle (B07T1KY5TZ, $35.99, 4.7★), 2) Mueller Ultra Kettle (B09KC7D3HR, $29.97, 4.5★). Now compare these two on noise level and boil time."]
}
3. 锚定到分类页的问题
json
{
  "prompts": ["What are the most popular picks on this page?"],
  "url": "https://www.amazon.com/s?k=electric+kettle"
}
4. 面向下游提取的结构化输出
json
{
  "prompts": ["best gift ideas for a 10-year-old who likes science"],
  "format": "json"
}

Display Rules

展示规则

  1. Render the Markdown directly when
    format=markdown
    :
    stdout
    is already structured with turn headings, product cards, and follow-up questions — preserve that structure.
  2. Surface the recommended ASINs so the user can click through; show
    title
    ,
    price
    ,
    score
    /
    ratingsCount
    , and the product URL.
  3. Show the follow-up questions Alexa returned — they are usable prompts the user can pick to continue digging. When the user picks one, summarize the current answer and use the selected follow-up as
    prompts[0]
    in a new call.
  4. Don't reroute to a data-analysis sandbox: the answer body is conversational and the recommended products are nested groups, not a flat tabular dataset suitable for SQL-like aggregation.
  5. Flag empty results: if
    resultsNum
    is
    0
    or
    data
    is empty, tell the user Alexa did not produce a usable reply and suggest rephrasing or anchoring with a
    url
    .
  6. Indicate freshness: results reflect Alexa's live answer at call time; mention this when the user asks about timing.
  7. Handle business errors: if
    code
    /
    errcode
    is not
    200
    , surface
    msg
    /
    errmsg
    and suggest retrying with simpler prompts.
  1. format=markdown
    时直接渲染Markdown
    stdout
    已包含对话轮次标题、商品卡片和追问问题的结构化内容,请保留该结构。
  2. 展示推荐的ASIN以便用户点击跳转;需显示
    title
    price
    score
    /
    ratingsCount
    以及商品URL。
  3. 展示Alexa返回的追问问题——这些是用户可以选择继续深入咨询的可用提示词。当用户选择其中一个时,总结当前回答并将选中的追问作为新调用中的
    prompts[0]
  4. 请勿跳转至数据分析沙盒:回答内容为对话式,推荐商品为嵌套分组,并非适合类SQL聚合的扁平表格数据集。
  5. 标记空结果:若
    resultsNum
    0
    data
    为空,需告知用户Alexa未生成可用回复,并建议重新表述问题或使用
    url
    锚定页面。
  6. 说明结果时效性:结果反映调用时Alexa的实时回答;当用户询问时间相关问题时需提及这一点。
  7. 处理业务错误:若
    code
    /
    errcode
    不为
    200
    ,需展示
    msg
    /
    errmsg
    并建议使用更简单的提示词重试。

Important Limitations

重要限制

  • Alexa-driven, not deterministic: same prompts can yield different answers across calls — Alexa's response varies with time, traffic, and context.
  • No cross-call memory: each tool call is a fresh Alexa session; the agent must summarize prior context and embed it in the new question.
  • One prompt per call:
    prompts
    only accepts 1 element. For follow-ups, the agent must summarize context + new question into a single
    prompts[0]
    and make a new call.
  • Marketplace coverage: anchored on Amazon's storefront Alexa experience (primarily amazon.com); availability on non-US marketplaces depends on Alexa rollout.
  • Output mix: primary value is the conversational answer plus a curated handful of products; this is not a substitute for SERP-wide product extraction.
  • 由Alexa驱动,结果非确定性:相同的提示词在不同调用中可能产生不同的回答——Alexa的响应会随时间、流量和上下文变化。
  • 无跨调用记忆:每次工具调用都是一个全新的Alexa会话;Agent必须总结之前的上下文并将其嵌入新问题中。
  • 每次调用一个提示词
    prompts
    仅接受1个元素。如需追问,Agent必须将上下文总结+新问题合并为单个
    prompts[0]
    并发起新调用。
  • 商城覆盖范围:基于亚马逊前台的Alexa体验(主要是amazon.com);非美国商城的可用性取决于Alexa的部署情况。
  • 输出内容特点:核心价值是对话式回答加上精选的少量商品;无法替代全搜索结果页的商品提取功能。

User Expression & Scenario Quick Reference

用户表述与场景速查

Applicable — natural-language conversational shopping on Amazon:
User SaysScenario
"用 Alexa 帮我推荐...", "亚马逊 Alexa 问下..."Direct Alexa Q&A
"在亚马逊上聊聊给我推荐 ...", "对话式选品"Conversational discovery
"顺便再追问一下 / 接着问 ..."Follow-up (agent summarizes prior result and re-asks in new call)
"在这个页面 / 这个分类下推荐...", "基于这个页面再问一下"Page-anchored conversation (use
url
)
"best XX for YY under $Z on Amazon"Goal + constraint + budget Q&A
"对比 Alexa 给的前两个推荐"Compare within Alexa's reply
"Alexa 还能继续问什么 / 给我一些追问思路"Surface follow-up questions
Not applicable — better routed elsewhere:
  • Pulling the full SERP for a keyword with positions, sponsored flags, etc. (use the storefront search-simulation skill).
  • Historical search-term analytics or volume trends (use the ABA data explorer).
  • Detailed product detail / A+ / bullets for a known ASIN (use the Amazon product detail skill).
  • Review-level sentiment analysis (use the Amazon reviews skill).
  • Image-based similar product discovery (use the image search skill).
  • Aggregated statistics over a flat product list (no structured table here).
Boundary judgment: when the user wants a conversation — "ask Amazon, get a recommendation, then keep asking" — this skill applies. If they want raw search-result rows, structured analytics, or a specific ASIN's data, route to the matching specialized skill instead.
Feedback:
Auto-detect and report feedback via the Feedback API when any of the following apply:
  1. The functionality or purpose described in this skill does not match actual behavior
  2. The skill's results do not match the user's intent
  3. The user expresses dissatisfaction or praise about this skill
  4. Anything you believe could be improved
Call the feedback API as specified in
references/api.md
. Do not interrupt the user's flow.
<!-- LF_LARGE_RESPONSE_BLOCK -->
适用场景——亚马逊平台上的自然语言对话式购物:
用户表述场景
"用 Alexa 帮我推荐...", "亚马逊 Alexa 问下..."直接Alexa问答
"在亚马逊上聊聊给我推荐 ...", "对话式选品"对话式商品发现
"顺便再追问一下 / 接着问 ..."追问(Agent总结之前的结果并重提问题发起新调用)
"在这个页面 / 这个分类下推荐...", "基于这个页面再问一下"锚定页面的对话(使用
url
参数)
"best XX for YY under $Z on Amazon"目标+限制条件+预算类问答
"对比 Alexa 给的前两个推荐"在Alexa的回复内对比商品
"Alexa 还能继续问什么 / 给我一些追问思路"展示追问问题
不适用场景——建议转至其他技能:
  • 获取包含排名、赞助标记等信息的完整搜索结果页(使用前台搜索模拟技能)。
  • 历史搜索词分析或流量趋势(使用ABA数据探索技能)。
  • 已知ASIN的详细商品信息/A+页面/要点(使用亚马逊商品详情技能)。
  • 评论级情感分析(使用亚马逊评论技能)。
  • 基于图片的相似商品发现(使用图片搜索技能)。
  • 扁平商品列表的聚合统计(本技能无结构化表格)。
边界判断:当用户需要对话式交互——“询问亚马逊、获取推荐、继续追问”——时适用本技能。若用户需要原始搜索结果行、结构化分析或特定ASIN的数据,请转至对应的专业技能。
反馈:
当出现以下任一情况时,自动检测并通过Feedback API上报反馈:
  1. 本技能描述的功能或用途与实际行为不符
  2. 本技能的结果与用户意图不符
  3. 用户表达对本技能的不满或赞扬
  4. 任何你认为可以改进的内容
请按照
references/api.md
中的说明调用反馈API,请勿打断用户流程。
<!-- LF_LARGE_RESPONSE_BLOCK -->

Handling Large Responses

处理大响应内容

To avoid overflowing the agent context, persist the response to disk and extract only the fields you need:
python scripts/response_io.py run --script scripts/amazon_alexa_search.py --out-dir <DIR> '<params>'
python scripts/response_io.py read <file> --fields "<paths>"   # or --path "<JMESPath>"
Pick
--out-dir
outside any git working tree (e.g.
/tmp/...
on Unix,
%TEMP%/...
on Windows). Persisted responses may contain PII, pricing, or auth-sensitive data — do not commit them. Files are not auto-deleted; clean up when the task is done.
run
writes the full response to a file and emits only a schema preview + file path.
read
projects specific fields, with
--limit/--offset
for slicing and
--format json|jsonl|csv|table
for output.
When to prefer this pattern — apply your judgment based on the response characteristics, e.g.:
  • High field count per record, or fields you don't need
  • Batch/paginated results (multiple items per call)
  • Long-text fields (descriptions, reviews, HTML, time series)
  • Output reused across later steps rather than consumed immediately
For small, single-use responses, calling the main script directly is fine.
⚠️ The preview is a truncated schema + sample, not the full data. Any field-level decision must read from the persisted file via
read
.
<!-- /LF_LARGE_RESPONSE_BLOCK -->
For more high-quality, professional cross-border e-commerce skills, set LinkFox Skills.
为避免超出Agent上下文限制,请将响应保存到磁盘并仅提取所需字段:
python scripts/response_io.py run --script scripts/amazon_alexa_search.py --out-dir <DIR> '<params>'
python scripts/response_io.py read <file> --fields "<paths>"   # or --path "<JMESPath>"
请选择git工作区之外的
--out-dir
(例如Unix系统的
/tmp/...
,Windows系统的
%TEMP%/...
)。保存的响应可能包含个人身份信息(PII)、价格或敏感认证数据——请勿提交这些文件。文件不会自动删除,请在任务完成后清理。
run
命令将完整响应写入文件,仅输出 schema 预览+文件路径。
read
命令提取特定字段,支持使用
--limit/--offset
进行切片,以及
--format json|jsonl|csv|table
指定输出格式。
何时优先使用此模式——根据响应特点判断,例如:
  • 每条记录字段数量多,或包含不需要的字段
  • 批量/分页结果(每次调用返回多个条目)
  • 长文本字段(描述、评论、HTML、时间序列)
  • 输出需在后续步骤中复用,而非立即使用
对于小型、单次使用的响应,直接调用主脚本即可。
⚠️ 预览内容是截断的schema+示例,并非完整数据。任何字段级别的操作都必须通过
read
命令从保存的文件中读取。
<!-- /LF_LARGE_RESPONSE_BLOCK -->
如需更多高质量、专业的跨境电商技能,请访问 LinkFox Skills