AWS 文章把 Luna 定位为高吞吐、低延迟的分类、摘要和路由模型,并通过 Responses API 示例说明如何设置 reasoning effort、调用工具、把模型输出完整带回下一轮,以及使用 prompt cache key 和 cache breakpoint 缓存稳定前缀。
任务简单、数量大时从 none 或 low reasoning 开始;复杂多步任务再提升到 medium、high、xhigh 或 max。
工具调用后,把模型上一轮的 response.output(包括 reasoning items)追加回下一轮输入。
把稳定的系统指令、工具定义和参考资料放在 prompt 前部,把变化的用户问题放在后部。
需要精确控制时使用显式缓存断点;不设置 prompt_cache_options 时使用隐式缓存。
示例中的缓存前缀至少需要 1,024 token,缓存 key 应在相关请求之间保持一致。
response = client.responses.create(
model="openai.gpt-5.6-luna",
input="Classify these support tickets by urgency and route them to the right team.",
reasoning={"effort": "low"},
max_output_tokens=512,
store=False,
)
print(response.output_text)工具调用循环的关键结构:
input_list += response.output
for item in response.output:
if item.type == "function_call":
result = run_tool(item.arguments)
input_list.append({
"type": "function_call_output",
"call_id": item.call_id,
"output": json.dumps(result),
})
final_response = client.responses.create(
model="openai.gpt-5.6-luna",
input=input_list,
tools=tools,
)本站仅展示 Tabbit 编辑摘要和必要节选;完整内容、上下文与最新版本请查看原始来源。
GPT-5.6 Luna