Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
43 lines
29 KiB
JSON
43 lines
29 KiB
JSON
{
|
||
"schema_version": 1,
|
||
"credential_free": true,
|
||
"attempts": [
|
||
{
|
||
"attempt": 1,
|
||
"request": {
|
||
"model": "doubao-seed-1-6-250615",
|
||
"messages": [
|
||
{
|
||
"role": "user",
|
||
"content": "You are an exacting bilingual technical-book translation evaluator. Compare two anonymous Chinese translations against the complete English Markdown source. Score both X and Y from 1 to 5 on exactly: accuracy (no omissions, inventions, or changed claims); fluency; terminology (consistent and technically correct); markdown_code_fidelity (figures, links, headings, equations, and fenced code preserved). Each score needs concrete quoted or located evidence. Prefer one only when evidence supports it. Return JSON only: {\"variants\":{\"X\":{\"accuracy\":{\"score\":1,\"evidence\":\"...\"},\"fluency\":{\"score\":1,\"evidence\":\"...\"},\"terminology\":{\"score\":1,\"evidence\":\"...\"},\"markdown_code_fidelity\":{\"score\":1,\"evidence\":\"...\"}},\"Y\":{\"accuracy\":{\"score\":1,\"evidence\":\"...\"},\"fluency\":{\"score\":1,\"evidence\":\"...\"},\"terminology\":{\"score\":1,\"evidence\":\"...\"},\"markdown_code_fidelity\":{\"score\":1,\"evidence\":\"...\"}}},\"preferred\":\"X|Y|tie\",\"preference_evidence\":\"...\"}.\n\nCOMPLETE ENGLISH SOURCE:\n**After the first call (model returns tool calls):**\n```\nmessages = [\n { role: \"system\", content: \"...\" },\n { role: \"user\", content: \"What's the current time...\" },\n { role: \"assistant\", tool_calls: [get_current_time, get_weather] }, # + Generated by model\n { role: \"tool\", tool_call_id: \"call_abc\", content: \"{time...}\" }, # + Executed by framework\n { role: \"tool\", tool_call_id: \"call_def\", content: \"{weather...}\" }, # + Executed by framework\n]\n```\n\n**After the second call (model returns final reply, loop ends):**\n```\nmessages = [\n { role: \"system\", content: \"...\" },\n { role: \"user\", content: \"What's the current time...\" },\n { role: \"assistant\", tool_calls: [get_current_time, get_weather] },\n { role: \"tool\", tool_call_id: \"call_abc\", content: \"{time...}\" },\n { role: \"tool\", tool_call_id: \"call_def\", content: \"{weather...}\" },\n { role: \"assistant\", content: \"It's currently Saturday, Sep 13, 2025 in Vancouver...\" }, # + Final reply\n]\n```\n\nThis process shows that **one central responsibility of an Agent framework is maintaining the message list**: appending messages at the right time and sending the relevant history to the model. The context engineering techniques in this chapter are largely about improving the content and structure of that list.\n\n### How Context Is Composed at the API Level\n\nThe example above shows the complete composition of context each time the Agent calls the model:\n\n\n\nThe upper part (System Prompt + Tool Definitions) remains unchanged throughout the conversation, while the lower part (conversation history, i.e., the **trajectory** defined in Chapter 1) grows with each interaction. This is how the five context components from Chapter 1 appear at the API level: the system prompt and tool definitions form a static prefix, while user messages, model replies, and tool execution results form a dynamically growing message history. This \"static prefix + trajectory\" structure is the foundation for later discussions of KV Cache optimization, context compression, and related techniques: the prefix should remain stable, while later trajectory segments can be summarized or replaced when the trade-off is worthwhile.\n\nThe rest of this chapter examines each layer of this structure: how to use a stable static prefix to accelerate inference (KV Cache), how to design an effective System Prompt (prompt engineering), how to prevent external content from hijacking the context (prompt injection defense), how to load specialized knowledge on demand (Agent Skills), how to inject dynamic state at the end of the conversation (Agent Status Bar), and how to compress conversation history when it grows too large (compression strategies).\n\n> **Experiment 2-1 ★: Local LLM Service Deployment and Tool Calling**\n>\n>\n> \n>\n>\n> This experiment has two goals: first, to observe the tool-calling capability of a small model, and second, to inspect the raw token stream (chain-of-thought, special tokens, and tool call format) that is hidden at the API level. Along the way, you can also observe the impact of KV Cache on time to first token (TTFT), building intuition for the next section.\n>\n> Before the chapter turns to the deeper mechanics of Agent context, this project demonstrates what a small model can do. The `local_llm_serving` project illustrates an important point: models capable of Chain of Thought (CoT) reasoning and tool calling do not necessarily require a large number of parameters. Even a 0.6B-parameter model can perform tool calling reliably when paired with sensible prompt design and system architecture.\n>\n> Through this experiment, readers should be able to observe:\n>\n> 1. **Capabilities of Small Models**: Even a 0.6B model can accurately understand and execute tool calls with appropriate prompt engineering (the technique of carefully designing input prompts to guide model behavior).\n> 2. **Performance**: On an Apple M2 chip, the model can generate responses at more than 100 tokens per second, which is sufficient for real-time interactive applications. A token is the basic unit of text processing for models; one Chinese character typically corresponds to 1–2 tokens, and one English word typically corresponds to 1–3 tokens.\n> 3. **ReAct Loop**: Observe how the model solves complex problems through multiple rounds of reasoning and tool calling.\n> 4. **Advantages of Streaming Responses**: Streaming output allows users to see the model's reasoning process in real time, including decisions about tool calls and the processing of results.\n> 5. **Impact of KV Cache (incidental observation)**: Keep the system prompt unchanged, start two consecutive conversations, and record the TTFT for the second one. Then change a few characters at the beginning of the system prompt, start another conversation, and compare the TTFT. The unchanged-prefix case will be significantly faster because it can hit the prefix cache, while the modified-prefix case must recompute the entire prefix. This phenomenon is the subject of the next section.\n>\n> **The ReAct Loop in Practice.**\n>\n> The multi-round tool calling in this project follows the ReAct (Think-Act-Observe) loop introduced in Chapter 1, so its principles will not be repeated here. The previous section already showed the complete message structure of this process using the JSON format of the OpenAI API. In a local deployment, the server (e.g., vLLM or Ollama) converts these API messages into the model's internal token format. The `local_llm_serving` project lets readers inspect the model's raw input and output token stream, including the following details that are normally hidden at the API level:\n>\n> **Model's Internal Reasoning Process**: Models that support chain-of-thought (e.g., Qwen3) will first reason inside `<think>` tags before generating tool calls—analyzing user intent, evaluating which tools are suitable, and planning the call order. This reasoning process is valuable for debugging Agent behavior.\n>\n> **Output Sequence Structure**: The model's output tokens are generated in a fixed order—first internal reasoning (inside `<think>` tags), then the text reply to the user, and finally the tool call request. Understanding this order is crucial for implementing streaming responses: when the `<think>` tag appears, the interface can switch to a \"reasoning\" state; as soon as the parameters for the first tool call are fully generated and validated, execution can begin immediately, without waiting for the model to generate subsequent tool calls.\n>\n> **Parallel Tool Calls**: In the Vancouver time and weather example from this section, the model found no dependency between the two sub-problems, so it generated two tool call requests in one output. The Agent framework can detect this and execute both tools in parallel, reducing total latency.\n>\n> **Model's Termination Judgment**: When the Agent framework sends back the tool results, the model determines whether it has enough information to answer the user. If so, it outputs the final reply without requesting another tool call; otherwise, it issues additional tool calls and begins another ReAct round.\n>\n> **Experiment Summary.**\n>\n> The most important takeaway from this experiment is that a 0.6B model, with reasonable prompt design, can complete tool calls reliably. Model size matters, but it is not the only determining factor. Some high-end mobile devices can already run 0.6B-level models, and the practical capabilities of on-device models continue to improve. On-device Agents are closer than many people expect.\n>\n> You may have noticed that the model's first response slows down after the system prompt is modified. This slowdown is caused by the KV Cache behavior explained in the next section: changing the prefix invalidates the cache and forces recomputation.\n>\n\n## KV Cache-Friendly Context Design\n\nBefore examining the example, consider the intuition behind **KV Cache**. Every time the model generates a token, it must refer back to the intermediate computation results of the preceding tokens. Recomputing those results from scratch on every round would become increasingly expensive as the context grows. KV Cache stores the intermediate key-value states so later computation can reuse them. **The prerequisite is that the prefix stays completely unchanged**: alter a single character in it, and the cache for that prefix can no longer be reused; the model must recompute from the changed point onward. A note on terminology: when this section discusses \"cache hits\" across requests, API providers usually call this Prompt Cache—a cross-request cache built on top of the inference engine's KV Cache. The two levels are distinguished at the end of this section.\n\nWith that intuition in mind, consider a production incident. A team's customer service Agent handled 100,000 conversations a day, and the system was running normally. Then an engineer, wanting the Agent to have access to the current time, added a line `Current time: {{now}}` to the system prompt, injecting the timestamp in real time. The next day, monitoring alerts fired: TTFT for every conversation increased from 0.5 seconds to 3–5 seconds, and the monthly inference bill nearly doubled. The code looked correct and the model had not changed. The issue was in the context.\n\n\n\nANONYMOUS CHINESE X:\n### 上下文工程[第3/17部分]\n**第一次调用后(模型返回工具调用):**\n```\nmessages = [\n { role: \"system\", content: \"...\" },\n { role: \"user\", content: \"What's the current time...\" },\n { role: \"assistant\", tool_calls: [get_current_time, get_weather] }, # + 由模型生成\n { role: \"tool\", tool_call_id: \"call_abc\", content: \"{time...}\" }, # + 由框架执行\n { role: \"tool\", tool_call_id: \"call_def\", content: \"{weather...}\" }, # + 由框架执行\n]\n```\n\n**第二次调用后(模型返回最终回复,循环结束):**\n```\nmessages = [\n { role: \"system\", content: \"...\" },\n { role: \"user\", content: \"What's the current time...\" },\n { role: \"assistant\", tool_calls: [get_current_time, get_weather] },\n { role: \"tool\", tool_call_id: \"call_abc\", content: \"{time...}\" },\n { role: \"tool\", tool_call_id: \"call_def\", content: \"{weather...}\" },\n { role: \"assistant\", content: \"It's currently Saturday, Sep 13, 2025 in Vancouver...\" }, # + 最终回复\n]\n```\n\n这个过程表明**代理框架的一个核心职责是维护消息列表**:在正确的时间追加消息并将相关历史发送给模型。本章的上下文工程技术很大程度上是关于改进该列表的内容和结构。\n\n### API级上下文的组成方式\n上面的示例展示了代理每次调用模型时上下文的完整组成:\n\n\n\n上半部分(系统提示+工具定义)在整个对话中保持不变,而下半部分(对话历史,即第1章定义的**轨迹**)随着每次交互增长。这就是第1章的五个上下文组件在API级别的呈现方式:系统提示和工具定义形成静态前缀,而用户消息、模型回复和工具执行结果形成动态增长的消息历史。这种“静态前缀+轨迹”结构是后续讨论KV缓存优化、上下文压缩等技术的基础:前缀应保持稳定,而后续轨迹片段在权衡值得时可以被总结或替换。\n\n本章其余部分将检查该结构的每个层:如何使用稳定的静态前缀加速推理(KV缓存)、如何设计有效的系统提示(提示工程)、如何防止外部内容劫持上下文(提示注入防御)、如何按需加载专门知识(代理技能)、如何在对话末尾注入动态状态(代理状态栏)以及如何在对话历史过大时进行压缩(压缩策略)。\n\n> **实验2-1 ★:本地大语言模型服务部署和工具调用**\n>\n>\n> \n>\n>\n> 这个实验有两个目标:首先,观察小模型的工具调用能力;其次,检查API级别隐藏的原始标记流(思维链、特殊标记和工具调用格式)。在此过程中,你还可以观察KV缓存对首字节时间(TTFT)的影响,为下一节建立直觉。\n>\n> 在本章转向代理上下文的深层机制之前,这个项目展示了小模型能做什么。`local_llm_serving`项目阐明了一个重要点:能够进行思维链(CoT)推理和工具调用的模型不一定需要大量参数。即使是0.6B参数的模型,只要搭配合理的提示设计和系统架构,也能可靠地进行工具调用。\n>\n> 通过这个实验,读者应该能够观察到:\n>\n> 1. **小模型的能力**:即使是0.6B模型,通过适当的提示工程(精心设计输入提示以引导模型行为的技术)也能准确理解和执行工具调用。\n> 2. **性能**:在苹果M2芯片上,模型可以以每秒超过100个标记的速度生成响应,足以满足实时交互应用。一个标记是模型文本处理的基本单位;一个汉字通常对应1-2个标记,一个英文单词通常对应1-3个标记。\n> 3. **ReAct循环**:观察模型如何通过多轮推理和工具调用解决复杂问题。\n> 4. **流式响应的优势**:流式输出允许用户实时看到模型的推理过程,包括工具调用决策和结果处理。\n> 5. **KV缓存的影响(附带观察)**:保持系统提示不变,开始两次连续对话,记录第二次对话的TTFT。然后更改系统提示开头的几个字符,开始另一个对话,比较TTFT。未更改前缀的情况会快得多,因为它可以命中前缀缓存,而更改前缀的情况必须重新计算整个前缀。这种现象是下一节的主题。\n>\n> **实践中的ReAct循环。**\n>\n> 这个项目中的多轮工具调用遵循第1章介绍的ReAct(思考-行动-观察)循环,因此此处不再重复其原理。上一节已经使用OpenAI API的JSON格式展示了该过程的完整消息结构。在本地部署中,服务器(例如vLLM或Ollama)将这些API消息转换为模型的内部标记格式。`local_llm_serving`项目让读者检查模型的原始输入和输出标记流,包括以下通常在API级别隐藏的细节:\n>\n> **模型的内部推理过程**:支持思维链(例如Qwen3)的模型会在生成工具调用之前先在`<think>`标签内进行推理——分析用户意图、评估哪些工具合适、规划调用顺序。这个推理过程对调试代理行为很有价值。\n>\n> **输出序列结构**:模型的输出标记按固定顺序生成——首先是内部推理(在`<think>`标签内),然后是对用户的文本回复,最后是工具调用请求。理解这个顺序对于实现流式响应至关重要:当`<think>`标签出现时,界面可以切换到“推理”状态;一旦第一个工具调用的参数完全生成并验证,就可以立即开始执行,无需等待模型生成后续工具调用。\n>\n> **并行工具调用**:在本节的温哥华时间和天气示例中,模型发现两个子问题之间没有依赖关系,因此在一个输出中生成了两个工具调用请求。代理框架可以检测到这一点并并行执行两个工具,减少总延迟。\n>\n> **模型的终止判断**:当代理框架发送回工具结果时,模型判断是否有足够的信息回答用户。如果有,它输出最终回复而不请求另一个工具调用;否则,它发出额外的工具调用并开始另一轮ReAct。\n>\n> **实验总结。**\n>\n> 这个实验最重要的收获是,0.6B模型在合理的提示设计下可以可靠地完成工具调用。模型大小很重要,但不是唯一的决定因素。一些高端移动设备已经能够运行0.6B级别的模型,设备端模型的实际能力持续提高。设备端代理比许多人预期的更近。\n>\n> 你可能已经注意到,修改系统提示后模型的第一个响应变慢了。这种变慢是由下一节解释的KV缓存行为引起的:更改前缀会使缓存失效并强制重新计算。\n>\n\n## 对KV缓存友好的上下文设计\n\n在检查示例之前,考虑**KV缓存**背后的直觉。每次模型生成一个标记,它都必须参考前面标记的中间计算结果。随着上下文增长,每次从头重新计算这些结果会变得越来越昂贵。KV缓存存储中间键值状态,以便后续计算可以重复使用。**前提是前缀完全保持不变**:对其进行单个字符的修改,该前缀的缓存就无法再被重用;模型必须从更改的点开始重新计算。术语说明:当本节讨论请求之间的“缓存命中”时,API提供商通常称之为提示缓存——构建在推理引擎KV缓存之上的跨请求缓存。本节末尾将区分这两个层次。\n\n有了这种直觉,考虑一个生产事件。一个团队的客户服务代理每天处理10万次对话,系统运行正常。然后一位工程师希望代理能够访问当前时间,在系统提示中添加了一行`Current time: {{now}}`,实时注入时间戳。第二天,监控警报触发:每次对话的TTFT从0.5秒增加到3-5秒,每月推理账单几乎翻倍。代码看起来正确,模型也没有改变。问题出在上下文中。\n\nANONYMOUS CHINESE Y:\n### 上下文工程[第3/17部分]\n\n**第一次调用后(模型返回工具调用):**\n```\nmessages = [\n { role: \"system\", content: \"...\" },\n { role: \"user\", content: \"What's the current time...\" },\n { role: \"assistant\", tool_calls: [get_current_time, get_weather] }, # + 由模型生成\n { role: \"tool\", tool_call_id: \"call_abc\", content: \"{time...}\" }, # + 由框架执行\n { role: \"tool\", tool_call_id: \"call_def\", content: \"{weather...}\" }, # + 由框架执行\n]\n```\n\n**第二次调用后(模型返回最终回复,循环结束):**\n```\nmessages = [\n { role: \"system\", content: \"...\" },\n { role: \"user\", content: \"What's the current time...\" },\n { role: \"assistant\", tool_calls: [get_current_time, get_weather] },\n { role: \"tool\", tool_call_id: \"call_abc\", content: \"{time...}\" },\n { role: \"tool\", tool_call_id: \"call_def\", content: \"{weather...}\" },\n { role: \"assistant\", content: \"It's currently Saturday, Sep 13, 2025 in Vancouver...\" }, # + 最终回复\n]\n```\n\n这个过程表明**代理框架的一个核心职责是维护消息列表**:在正确的时间追加消息,并将相关历史发送给模型。本章中的上下文工程技术主要是关于改进该列表的内容和结构。\n\n### API级别上下文的组成方式\n\n上面的示例展示了代理每次调用模型时上下文的完整组成:\n\n\n\n上半部分(系统提示 + 工具定义)在整个对话过程中保持不变,而下半部分(对话历史,即第1章中定义的**轨迹**)随着每次交互而增长。这就是第1章中的五个上下文组件在API级别上的呈现方式:系统提示和工具定义形成静态前缀,而用户消息、模型回复和工具执行结果形成动态增长的消息历史。这种“静态前缀 + 轨迹”结构是后续讨论KV缓存优化、上下文压缩等技术的基础:前缀应保持稳定,而后续的轨迹部分在权衡值得时可以进行总结或替换。\n\n本章其余部分将检查该结构的每个层:如何使用稳定的静态前缀来加速推理(KV缓存)、如何设计有效的系统提示(提示工程)、如何防止外部内容劫持上下文(提示注入防御)、如何按需加载专业知识(代理技能)、如何在对话末尾注入动态状态(代理状态栏)以及如何在对话历史过大时进行压缩(压缩策略)。\n\n> **实验2-1 ★:本地大语言模型服务部署和工具调用**\n>\n>\n> \n>\n>\n> 这个实验有两个目标:首先,观察小型模型的工具调用能力;其次,检查API级别隐藏的原始词元流(思维链、特殊词元和工具调用格式)。在此过程中,您还可以观察KV缓存对首词元时延(TTFT)的影响,为下一节建立直觉。\n>\n> 在本章深入探讨代理上下文的机制之前,这个项目展示了小型模型能做什么。`local_llm_serving`项目说明了一个重要点:能够进行思维链(CoT)推理和工具调用的模型不一定需要大量参数。即使是一个0.6B参数的模型,只要搭配合理的提示设计和系统架构,也能可靠地执行工具调用。\n>\n> 通过这个实验,读者应该能够观察到:\n>\n> 1. **小型模型的能力**:即使是0.6B的模型,通过适当的提示工程(精心设计输入提示以引导模型行为的技术)也能准确理解和执行工具调用。\n> 2. **性能**:在Apple M2芯片上,模型可以以每秒超过100词元的速度生成响应,足以满足实时交互应用的需求。词元是模型文本处理的基本单位;一个汉字通常对应1-2个词元,一个英文单词通常对应1-3个词元。\n> 3. **ReAct循环**:观察模型如何通过多轮推理和工具调用解决复杂问题。\n> 4. **流式响应的优势**:流式输出允许用户实时看到模型的推理过程,包括工具调用的决策和结果的处理。\n> 5. **KV缓存的影响(附带观察)**:保持系统提示不变,开始两次连续对话,记录第二次的首词元时延(TTFT)。然后修改系统提示开头的几个字符,开始另一次对话,比较TTFT。未修改前缀的情况会快得多,因为它可以命中前缀缓存,而修改前缀的情况必须重新计算整个前缀。这种现象是下一节的主题。\n>\n> **实践中的ReAct循环。**\n>\n> 这个项目中的多轮工具调用遵循第1章介绍的ReAct(思考-行动-观察)循环,因此其原理在此不再重复。上一节已经用OpenAI API的JSON格式展示了这个过程的完整消息结构。在本地部署中,服务器(例如vLLM或Ollama)将这些API消息转换为模型的内部词元格式。`local_llm_serving`项目让读者检查模型的原始输入和输出词元流,包括通常在API级别隐藏的以下细节:\n>\n> **模型的内部推理过程**:支持思维链的模型(例如Qwen3)会在`<think>`标签内首先进行推理——分析用户意图、评估哪些工具合适、规划调用顺序。这个推理过程对调试代理行为很有价值。\n>\n> **输出序列结构**:模型的输出词元按固定顺序生成——首先是内部推理(在`<think>`标签内),然后是对用户的文本回复,最后是工具调用请求。理解这个顺序对于实现流式响应至关重要:当出现`<think>`标签时,界面可以切换到“推理”状态;一旦第一个工具调用的参数完全生成并验证,就可以立即执行,无需等待模型生成后续工具调用。\n>\n> **并行工具调用**:在本节的温哥华时间和天气示例中,模型发现两个子问题之间没有依赖关系,因此在一个输出中生成了两个工具调用请求。代理框架可以检测到这一点,并并行执行两个工具,减少总时延。\n>\n> **模型的终止判断**:当代理框架返回工具结果时,模型判断是否有足够的信息回答用户。如果有,它就输出最终回复,不再请求其他工具调用;否则,它会发出额外的工具调用,开始另一个ReAct循环。\n>\n> **实验总结。**\n>\n> 这个实验最重要的收获是,一个0.6B的模型,只要有合理的提示设计,就能可靠地完成工具调用。模型大小很重要,但不是唯一的决定因素。一些高端移动设备已经能够运行0.6B级别的模型,设备端模型的实际能力正在不断提高。设备端代理比许多人预期的更近。\n>\n> 您可能已经注意到,修改系统提示后模型的第一个响应变慢了。这种变慢是由下一节解释的KV缓存行为引起的:修改前缀会使缓存失效,强制重新计算。\n>\n\n## 对KV缓存友好的上下文设计\n\n在查看示例之前,考虑一下**KV缓存**背后的直觉。每次模型生成一个词元,都必须参考前面词元的中间计算结果。随着上下文的增长,每次都从头重新计算这些结果会变得越来越昂贵。KV缓存存储中间键值状态,以便后续计算可以重复使用。**前提是前缀完全保持不变**:如果前缀中改变一个字符,该前缀的缓存就无法再使用;模型必须从改变的点开始重新计算。术语说明:当本节讨论请求之间的“缓存命中”时,API提供商通常称之为提示缓存——构建在推理引擎KV缓存之上的跨请求缓存。本节末尾将区分这两个层次。\n\n有了这个直觉,考虑一个生产事故。一个团队的客服代理每天处理10万次对话,系统运行正常。然后一位工程师想让代理能够获取当前时间,在系统提示中添加了一行`Current time: {{now}}`,实时注入时间戳。第二天,监控警报触发:每次对话的首词元时延从0.5秒增加到3-5秒,每月推理账单几乎翻倍。代码看起来正确,模型也没有改变。问题出在上下文中。"
|
||
}
|
||
],
|
||
"temperature": 0,
|
||
"response_format": {
|
||
"type": "json_object"
|
||
},
|
||
"extra_body": {
|
||
"thinking": {
|
||
"type": "disabled"
|
||
}
|
||
}
|
||
},
|
||
"response": {
|
||
"id": "0217853907185093ea4fa82759f0cae4f2ffa723d4f9dd6f2fb75",
|
||
"model": "doubao-seed-1-6-250615",
|
||
"created": 1785390729,
|
||
"content": "{\"variants\":{\"X\":{\"accuracy\":{\"score\":5,\"evidence\":\"No omissions, inventions, or changed claims. For example, '首字节时间' (TTFT) is accurately translated, and technical details like '0.6B参数模型' are preserved.\"},\"fluency\":{\"score\":4,\"evidence\":\"Mostly fluent, but '首字节时间' (TTFT) is slightly awkward; '首词元时延' in Y is more natural for technical context.\"},\"terminology\":{\"score\":4,\"evidence\":\"Consistent but '标记' (token) is less precise than '词元' in Y, which is the standard technical term for 'token' in LLM contexts.\"},\"markdown_code_fidelity\":{\"score\":5,\"evidence\":\"Headings, figures (e.g., ![图2-4...]), code blocks, and equations are preserved exactly.\"}},\"Y\":{\"accuracy\":{\"score\":5,\"evidence\":\"No omissions, inventions, or changed claims. All technical details like '0.6B参数模型' and 'TTFT' impact are accurately translated.\"},\"fluency\":{\"score\":5,\"evidence\":\"More natural phrasing, e.g., '首词元时延' (TTFT) instead of '首字节时间' in X, and '您' for formal address in instructions.\"},\"terminology\":{\"score\":5,\"evidence\":\"Consistent and precise technical terms: '词元' (token), '首词元时延' (TTFT), and '专业知识' (specialized knowledge) align with LLM technical standards.\"},\"markdown_code_fidelity\":{\"score\":5,\"evidence\":\"Headings, figures (e.g., ![图2-5...]), code blocks, and formatting are preserved exactly.\"}}},\"preferred\":\"Y\",\"preference_evidence\":\"Y has superior fluency ('首词元时延' vs. '首字节时间') and more precise terminology ('词元' for 'token' vs. '标记'), which are critical for technical documentation. Both X and Y are accurate and preserve markdown, but Y's terminology and fluency better serve technical readers.\"}",
|
||
"usage": {
|
||
"prompt_tokens": 6197,
|
||
"completion_tokens": 441,
|
||
"total_tokens": 6638
|
||
}
|
||
},
|
||
"latency_milliseconds": 11053,
|
||
"validation": {
|
||
"valid": true
|
||
}
|
||
}
|
||
]
|
||
}
|