sn-infographic
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesesn-infographic
sn-infographic
Info graphic generation scene skill (tier 1), relying on the , , and tools provided by (tier 0).
sn-image-generatesn-image-recognizesn-text-optimizesn-image-baseFeatures:
- Evaluation of prompt quality (auto mode)
- Prompt expansion (force/auto mode)
- Multiple rounds of image generation and VLM review
- Output the best result based on quality ranking
信息图生成场景技能(一级),依赖(零级)提供的、和工具。
sn-image-basesn-image-generatesn-image-recognizesn-text-optimize功能特性:
- 提示词质量评估(自动模式)
- 提示词扩展(强制/自动模式)
- 多轮图像生成与VLM审核
- 根据质量排名输出最优结果
Input Specification
输入规范
| Parameter | Type | Default Value | Description |
|---|---|---|---|
| string | Required | User original request |
| int | | Maximum number of generation rounds |
| string | | Output mode: friendly / verbose |
| string | | expand strategy: auto / force / disable |
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| string | 必填 | 用户原始请求 |
| int | | 最大生成轮次 |
| string | | 输出模式:friendly / verbose |
| string | | 扩展策略:auto / force / disable |
API Configuration
API配置
All API calls in this skill are executed through the of the skill, with authentication parameters using default values (CLI > environment variables > built-in defaults),无需显式传入。
sn_agent_runner.pysn-image-base| Call Type | Tool | Authentication Parameters | Description |
|---|---|---|---|
| LLM | sn-text-optimize (evaluation/expansion) | Default reads | Built-in default points to Sensenova internal network service |
| VLM | sn-image-recognize (image review) | Default reads | Built-in default points to Sensenova internal network service |
| Image Generation | sn-image-generate | Default reads | Default uses image generation configuration of |
When encountering or needing to specify a model: pass explicitly via CLI parameters, parameter reference .
MissingApiKeyError$SN_IMAGE_BASE/references/api_spec.md$SN_IMAGE_BASE$SN_IMAGE_BASEsn-image-baseSKILL.mdsn-image-base本技能中的所有API调用均通过技能的执行,认证参数采用默认值(CLI > 环境变量 > 内置默认值),无需显式传入。
sn-image-basesn_agent_runner.py| 调用类型 | 工具 | 认证参数 | 描述 |
|---|---|---|---|
| LLM | sn-text-optimize(评估/扩展) | 默认读取 | 内置默认指向商汤内部网络服务 |
| VLM | sn-image-recognize(图像审核) | 默认读取 | 内置默认指向商汤内部网络服务 |
| 图像生成 | sn-image-generate | 默认读取 | 默认使用 |
遇到或需要指定模型时:通过CLI参数显式传入,参数参考。
MissingApiKeyError$SN_IMAGE_BASE/references/api_spec.md$SN_IMAGE_BASE$SN_IMAGE_BASEsn-image-baseSKILL.mdsn-image-baseArchitecture: Main Agent + Worker Agent
架构:主Agent + 工作Agent
This skill uses a two-tier agent architecture:
| Role | Responsibility |
|---|---|
| Main Agent | Receive user request, normalize parameters, send preflight, start Worker, collect results, send text and images to user |
| Worker Agent | Execute orchestration loop (expand → multiple rounds of generation + review → sort), return structured JSON |
Responsibility Boundaries:
- Worker Agent does not send any messages to the user directly, only returns structured JSON
- Main Agent is responsible for sending all user-visible messages
- Worker Agent's last message must be and only be the JSON string defined in the Return Contract
- Worker Agent's internal VLM calls always execute directly, without spawning subagents
本技能采用双层Agent架构:
| 角色 | 职责 |
|---|---|
| 主Agent | 接收用户请求,标准化参数,发送预检消息,启动工作Agent,收集结果,向用户发送文本和图像 |
| 工作Agent | 执行编排循环(扩展→多轮生成+审核→排序),返回结构化JSON |
职责边界:
- 工作Agent不直接向用户发送任何消息,仅返回结构化JSON
- 主Agent负责发送所有用户可见的消息
- 工作Agent的最后一条消息必须且只能是返回契约中定义的JSON字符串
- 工作Agent内部的VLM调用始终直接执行,不生成子Agent
Workflow
工作流程
Main Agent Workflow
主Agent工作流程
- Extract ,
user_prompt(default 1),max_rounds(defaultoutput_mode), andfriendly(defaultprompts_expand_mode) from user requestauto - Send uniform preflight message:
"Using sn-infographic skill to generate infographic, please wait..." - Start Worker Agent (Sub-Agent), passing in complete parameters and working directory
- When Worker Agent returns and
status=ok:need_main_agent_send=true- max_rounds = 1: Send a one-sentence description of the image content, then send the rank=1 single image
- max_rounds > 1, friendly mode: Generate a one-sentence natural language description based on and
result, send the evaluation text, then send the rank=1 single imageviolations - max_rounds > 1, verbose mode: Send complete text summary message, then send all images in rank order to the user
- If Worker Agent returns , report the real
status=errorfield content to the usererror
- 从用户请求中提取、
user_prompt(默认1)、max_rounds(默认output_mode)和friendly(默认prompts_expand_mode)auto - 发送统一预检消息:
"使用sn-infographic技能生成信息图,请稍候..." - 启动工作Agent(子Agent),传入完整参数和工作目录
- 当工作Agent返回且
status=ok时:need_main_agent_send=true- max_rounds = 1:生成一句图像内容描述(不超过50字),然后发送排名第1的单张图像
- max_rounds > 1,friendly模式:基于和
result生成一句自然语言描述(不超过50字),发送评估文本,然后发送排名第1的单张图像violations - max_rounds > 1,verbose模式:发送完整文本摘要,然后按排名顺序向用户发送所有图像
- 如果工作Agent返回,将真实的
status=error字段内容告知用户error
Worker Agent Workflow
工作Agent工作流程
Worker Agent receives , , , , and the working directory of this skill ().
user_promptmax_roundsoutput_modeprompts_expand_modeSN_IMAGE_INFOG工作Agent接收、、、以及本技能的工作目录()。
user_promptmax_roundsoutput_modeprompts_expand_modeSN_IMAGE_INFOGStep 0 — Initialization
步骤0 — 初始化
- Generate (using timestamp, format
task_id)YYYYMMDD_HHMMSS - Create a uniform temporary directory: as
/tmp/openclaw/sn-infographic/<task_id>/TEMP_DIR - Initialize an empty list
rounds - Infer (default
aspect_ratio) and16:9(defaultimage_size) from2kbased on the rules inuser_prompt$SKILL_DIR/references/runtime-parameters.md
- 生成(使用时间戳,格式
task_id)YYYYMMDD_HHMMSS - 创建统一临时目录:作为
/tmp/openclaw/sn-infographic/<task_id>/TEMP_DIR - 初始化空列表
rounds - 根据中的规则,从
$SKILL_DIR/references/runtime-parameters.md推断user_prompt(默认aspect_ratio)和16:9(默认image_size)2k
Step 1 — prompts_expand_mode
Processing
prompts_expand_mode步骤1 — prompts_expand_mode
处理
prompts_expand_modedisable-
Skip expand, directly useas
user_promptexpanded_prompt -
Assign variable and write to temporary directory:bash
EXPANDED_PROMPT="$USER_PROMPT" echo "$EXPANDED_PROMPT" > "$TEMP_DIR/expanded-prompt.txt" -
Record
prompts_expand_skipped = true
force- Directly execute Step 2
auto-
Call sn-text-optimize for evaluation
-
Parse JSON, extractand
required_resultsoptional_results -
Determine logic:
- : All
required_passinanswerarerequired_results"yes" - : The number of
optional_passinanswer="yes"/ total ≥ 0.6optional_results should_expand = not (required_pass and optional_pass)
-
If JSON parsing fails, default(conservative strategy)
should_expand = true -
If: Skip Step 2, assign variable and write to temporary directory, record
should_expand = false:prompts_expand_skipped = truebashEXPANDED_PROMPT="$USER_PROMPT" echo "$EXPANDED_PROMPT" > "$TEMP_DIR/expanded-prompt.txt" -
If: Execute Step 2
should_expand = true
Evaluation Call (using 's tool):
sn-image-basesn-text-optimizebash
python "$SN_IMAGE_BASE/scripts/sn_agent_runner.py" sn-text-optimize \
--system-prompt-path "$SKILL_DIR/references/evaluation-standard.md" \
--user-prompt "$USER_PROMPT" \
--output-format jsondisable-
跳过扩展,直接使用作为
user_promptexpanded_prompt -
赋值变量并写入临时目录:bash
EXPANDED_PROMPT="$USER_PROMPT" echo "$EXPANDED_PROMPT" > "$TEMP_DIR/expanded-prompt.txt" -
记录
prompts_expand_skipped = true
force- 直接执行步骤2
auto-
调用sn-text-optimize进行评估
-
解析JSON,提取和
required_resultsoptional_results -
判断逻辑:
- :
required_pass中的所有required_results均为answer"yes" - :
optional_pass中optional_results的数量/总数 ≥ 0.6answer="yes" should_expand = not (required_pass and optional_pass)
-
如果JSON解析失败,默认(保守策略)
should_expand = true -
如果:跳过步骤2,赋值变量并写入临时目录,记录
should_expand = false:prompts_expand_skipped = truebashEXPANDED_PROMPT="$USER_PROMPT" echo "$EXPANDED_PROMPT" > "$TEMP_DIR/expanded-prompt.txt" -
如果:执行步骤2
should_expand = true
评估调用(使用的工具):
sn-image-basesn-text-optimizebash
python "$SN_IMAGE_BASE/scripts/sn_agent_runner.py" sn-text-optimize \\
--system-prompt-path "$SKILL_DIR/references/evaluation-standard.md" \\
--user-prompt "$USER_PROMPT" \\
--output-format jsonStep 2 — Content Analysis + Layout & Style Selection + Prompt Expansion
步骤2 — 内容分析 + 布局与风格选择 + 提示词扩展
2.0 Content Analysis (using 's tool):
sn-image-basesn-text-optimizebash
ANALYSIS=$(python "$SN_IMAGE_BASE/scripts/sn_agent_runner.py" sn-text-optimize \
--system-prompt-path "$SKILL_DIR/references/analysis-framework.md" \
--user-prompt "$USER_PROMPT" \
--output-format json)Save analysis result stdout to in temporary directory :
analysis.json$TEMP_DIR/analysis.jsonbash
echo "$ANALYSIS" > "$TEMP_DIR/analysis.json"2.1 Layout & Style Selection
- Read analysis result from temporary directory ;
$TEMP_DIR/analysis.json
bash
ANALYSIS=$(cat "$TEMP_DIR/analysis.json")- Based on ,
data_type,tone, selectaudienceandlayoutbased on the rules instyle;$SKILL_DIR/references/layout-style-selection.md - Read layout/style definition files:
bash
LAYOUT_DEF=$(cat "$SKILL_DIR/references/layouts/<layout>.md")
STYLE_DEF=$(cat "$SKILL_DIR/references/styles/<style>.md")If file does not exist, fallback to + .
hub-spokecorporate-memphis- Save selection result to temporary directory: ;
$TEMP_DIR/layout-style.json
Format of :
layout-style.jsonjson
{
"layout": "<layout>",
"style": "<style>"
}2.2 Structured Content Generation
Read analysis result and structured content template, convert into a design-ready structured content based on the template rules:
user_promptbash
ANALYSIS=$(cat "$TEMP_DIR/analysis.json")
LAYOUT_STYLE=$(cat "$TEMP_DIR/layout-style.json")
STRUCTURED_CONTENT_TEMPLATE=$(cat "$SKILL_DIR/references/structured-content-template.md")Follow the three phases defined in the template (High-Level Outline → Section Development → Data Integrity Check),
combine the learning objectives, visual opportunities, and key data in , generate structured content, and save it to the temporary directory:
analysis.jsonbash
cat > "$TEMP_DIR/structured-content.md" << 'EOF'
<Content generated based on structured-content-template.md format>
EOFRules: All data must be preserved exactly. Do not rewrite. Do not add information that is not in the source.
2.3 Prompt Expansion (using 's tool):
sn-image-basesn-text-optimizeRead structured content and layout/style selection from temporary directory, dynamically concatenate system prompt, and write to temporary file:
bash
STRUCTURED_CONTENT=$(cat "$TEMP_DIR/structured-content.md")
LAYOUT_STYLE=$(cat "$TEMP_DIR/layout-style.json")
LAYOUT=$(echo "$LAYOUT_STYLE" | jq -r '.layout')
STYLE=$(echo "$LAYOUT_STYLE" | jq -r '.style')
LAYOUT_DEF=$(cat "$SKILL_DIR/references/layouts/${LAYOUT}.md")
STYLE_DEF=$(cat "$SKILL_DIR/references/styles/${STYLE}.md")
cat > "$TEMP_DIR/expand-system-prompt.md" << EOF
$(cat "$SKILL_DIR/references/prompts-expand-system.md")
---2.0 内容分析(使用的工具):
sn-image-basesn-text-optimizebash
ANALYSIS=$(python "$SN_IMAGE_BASE/scripts/sn_agent_runner.py" sn-text-optimize \\
--system-prompt-path "$SKILL_DIR/references/analysis-framework.md" \\
--user-prompt "$USER_PROMPT" \\
--output-format json)将分析结果标准输出保存到临时目录的:
analysis.jsonbash
echo "$ANALYSIS" > "$TEMP_DIR/analysis.json"2.1 布局与风格选择
- 从临时目录读取分析结果;
$TEMP_DIR/analysis.json
bash
ANALYSIS=$(cat "$TEMP_DIR/analysis.json")- 根据、
data_type、tone,按照audience中的规则选择$SKILL_DIR/references/layout-style-selection.md和layout;style - 读取布局/风格定义文件:
bash
LAYOUT_DEF=$(cat "$SKILL_DIR/references/layouts/<layout>.md")
STYLE_DEF=$(cat "$SKILL_DIR/references/styles/<style>.md")如果文件不存在, fallback到 + 。
hub-spokecorporate-memphis- 将选择结果保存到临时目录:;
$TEMP_DIR/layout-style.json
layout-style.jsonjson
{
"layout": "<layout>",
"style": "<style>"
}2.2 结构化内容生成
读取分析结果和结构化内容模板,根据模板规则将转换为可用于设计的结构化内容:
user_promptbash
ANALYSIS=$(cat "$TEMP_DIR/analysis.json")
LAYOUT_STYLE=$(cat "$TEMP_DIR/layout-style.json")
STRUCTURED_CONTENT_TEMPLATE=$(cat "$SKILL_DIR/references/structured-content-template.md")遵循模板中定义的三个阶段(高层大纲→章节展开→数据完整性检查),结合中的学习目标、视觉机会和关键数据,生成结构化内容并保存到临时目录:
analysis.jsonbash
cat > "$TEMP_DIR/structured-content.md" << 'EOF'
<基于structured-content-template.md格式生成的内容>
EOF规则:所有数据必须完整保留,不得重写,不得添加源内容中没有的信息。
2.3 提示词扩展(使用的工具):
sn-image-basesn-text-optimize从临时目录读取结构化内容和布局/风格选择,动态拼接系统提示词并写入临时文件:
bash
STRUCTURED_CONTENT=$(cat "$TEMP_DIR/structured-content.md")
LAYOUT_STYLE=$(cat "$TEMP_DIR/layout-style.json")
LAYOUT=$(echo "$LAYOUT_STYLE" | jq -r '.layout')
STYLE=$(echo "$LAYOUT_STYLE" | jq -r '.style')
LAYOUT_DEF=$(cat "$SKILL_DIR/references/layouts/${LAYOUT}.md")
STYLE_DEF=$(cat "$SKILL_DIR/references/styles/${STYLE}.md")
cat > "$TEMP_DIR/expand-system-prompt.md" << EOF
$(cat "$SKILL_DIR/references/prompts-expand-system.md")
---Selected Layout: $LAYOUT
选中的布局: $LAYOUT
$LAYOUT_DEF
$LAYOUT_DEF
Selected Style: $STYLE
选中的风格: $STYLE
$STYLE_DEF
$STYLE_DEF
Output Template Reference
输出模板参考
$(cat "$SKILL_DIR/references/base-prompt.md")
EOF
Use the content of `structured-content.md` as user-prompt, read system prompt from temporary file and call sn-text-optimize:
```bash
python "$SN_IMAGE_BASE/scripts/sn_agent_runner.py" sn-text-optimize \
--system-prompt-path "$TEMP_DIR/expand-system-prompt.md" \
--user-prompt "$STRUCTURED_CONTENT" \
--output-format jsonParse JSON stdout, extract field as , and write to temporary directory:
resultexpanded_promptbash
echo "$EXPANDED_PROMPT" > "$TEMP_DIR/expanded-prompt.txt"If parsing fails or truncation is suspected (the returned content is incomplete), notify the user and terminate the workflow.
$(cat "$SKILL_DIR/references/base-prompt.md")
EOF
使用`structured-content.md`的内容作为用户提示词,从临时文件读取系统提示词并调用sn-text-optimize:
```bash
python "$SN_IMAGE_BASE/scripts/sn_agent_runner.py" sn-text-optimize \\
--system-prompt-path "$TEMP_DIR/expand-system-prompt.md" \\
--user-prompt "$STRUCTURED_CONTENT" \\
--output-format json解析JSON标准输出,提取字段作为并写入临时目录:
resultexpanded_promptbash
echo "$EXPANDED_PROMPT" > "$TEMP_DIR/expanded-prompt.txt"如果解析失败或怀疑内容截断(返回内容不完整),则通知用户并终止工作流程。
Step 3 — Image Generation Loop
步骤3 — 图像生成循环
Execute from to sequentially:
round1max_roundsGenerate Image (using 's tool):
sn-image-basesn-image-generatebash
python "$SN_IMAGE_BASE/scripts/sn_agent_runner.py" sn-image-generate \
--prompt "$EXPANDED_PROMPT" \
--image-size "$IMAGE_SIZE" \
--aspect-ratio "$ASPECT_RATIO" \
--save-path "$TEMP_DIR/round_<N>.png" \
-o jsonReview Image (only executed when ):
max_rounds > 1VLM configuration requirements:
- When , call VLM for review
max_rounds > 1 - Select VLM model from OpenClaw configuration as parameter for image recognition
- If no suitable VLM model exists in OpenClaw configuration:
- Notify user that current parameter combination cannot be executed
- Suggest adding VLM configuration or changing max_rounds to 1 to avoid VLM calls
- If VLM call times out or fails: do not fallback, report the real error directly
bash
python "$SN_IMAGE_BASE/scripts/sn_agent_runner.py" sn-image-recognize \
--system-prompt-path "$SN_IMAGE_INFOG/references/prompts-critic-system.md" \
--user-prompt "Evaluate the diagram in the image against the rules. Output your assessment." \
--images "$TEMP_DIR/round_<N>.png" \
--output-format jsonSystem prompt comes from , user prompt is provided directly.
references/prompts-critic-system.mdSave Round Result:
json
{
"round": 1,
"image": "$TEMP_DIR/round_1.png",
"result": "PASS|FAIL",
"violations_count": 0,
"violations": [],
"reasoning": "<Reasoning process, empty string when max_rounds=1>",
"timing": {
"image_generation": { "elapsed_seconds": 12.34, "model": "sn_image_model" },
"vlm_review": { "elapsed_seconds": 5.67, "model": "sensenova-6.7-flash-lite" }
}
}Note: is read from the return of each CLI call; is fixed to the hardcoded placeholder (sn-image-generate does not return the model field); is read from the JSON return of sn-image-recognize. is omitted when .
elapsed_seconds--output-format jsonimage_generation.model"sn_image_model"vlm_review.modeltiming.vlm_reviewmax_rounds=1Early Termination Check (only executed when ):
max_rounds > 1- If , immediately exit the loop, do not continue generating
result=PASS - If , continue to the next round (if there are remaining rounds)
result=FAIL
依次执行从到的:
1max_roundsround生成图像(使用的工具):
sn-image-basesn-image-generatebash
python "$SN_IMAGE_BASE/scripts/sn_agent_runner.py" sn-image-generate \\
--prompt "$EXPANDED_PROMPT" \\
--image-size "$IMAGE_SIZE" \\
--aspect-ratio "$ASPECT_RATIO" \\
--save-path "$TEMP_DIR/round_<N>.png" \\
-o json审核图像(仅在时执行):
max_rounds > 1VLM配置要求:
- 当时,调用VLM进行审核
max_rounds > 1 - 从OpenClaw配置中选择VLM模型作为图像识别参数
- 如果OpenClaw配置中没有合适的VLM模型:
- 通知用户当前参数组合无法执行
- 建议添加VLM配置或将max_rounds改为1以避免VLM调用
- 如果VLM调用超时或失败:不进行降级处理,直接上报真实错误
bash
python "$SN_IMAGE_BASE/scripts/sn_agent_runner.py" sn-image-recognize \\
--system-prompt-path "$SN_IMAGE_INFOG/references/prompts-critic-system.md" \\
--user-prompt "Evaluate the diagram in the image against the rules. Output your assessment." \\
--images "$TEMP_DIR/round_<N>.png" \\
--output-format json系统提示词来自,用户提示词直接提供。
references/prompts-critic-system.md保存轮次结果:
json
{
"round": 1,
"image": "$TEMP_DIR/round_1.png",
"result": "PASS|FAIL",
"violations_count": 0,
"violations": [],
"reasoning": "<推理过程,max_rounds=1时为空字符串>",
"timing": {
"image_generation": { "elapsed_seconds": 12.34, "model": "sn_image_model" },
"vlm_review": { "elapsed_seconds": 5.67, "model": "sensenova-6.7-flash-lite" }
}
}注意:从每个CLI调用的返回值中读取;固定为硬编码占位符(sn-image-generate不返回模型字段);从sn-image-recognize的JSON返回值中读取。当时,省略。
elapsed_seconds--output-format jsonimage_generation.model"sn_image_model"vlm_review.modelmax_rounds=1timing.vlm_review提前终止检查(仅在时执行):
max_rounds > 1- 如果,立即退出循环,不再继续生成
result=PASS - 如果,继续下一轮(如果还有剩余轮次)
result=FAIL
Step 4 — Image Quality Ranking
步骤4 — 图像质量排名
Sort images by ascending + ascending, return structured JSON to Main Agent.
violations_countround按照升序 + 升序对图像排序,向主Agent返回结构化JSON。
violations_countroundReturn Contract
返回契约
After Worker Agent completes, its last message must be and only be the following JSON string (bare JSON, no code fences, no preceding or trailing text).
Normal Flow:
json
{
"status": "ok",
"need_main_agent_send": true,
"output_mode": "friendly|verbose",
"expanded_prompt": "<always contains when output_mode=verbose; value is original user_prompt when prompts_expand_skipped=true, otherwise is expanded result>",
"prompts_expand_skipped": true,
"early_terminated": true,
"timing": {
"total_elapsed_seconds": 35.12,
"prompt_detection": { "elapsed_seconds": 2.11, "model": "sensenova-6.7-flash-lite" },
"content_analysis": { "elapsed_seconds": 3.22, "model": "sensenova-6.7-flash-lite" },
"prompt_expand": { "elapsed_seconds": 8.45, "model": "sensenova-6.7-flash-lite" }
},
"rounds": [
{
"round": 1,
"image": "$TEMP_DIR/round_1.png",
"result": "PASS|FAIL",
"violations_count": 0,
"violations": [],
"reasoning": "<Reasoning process, empty string when max_rounds=1>",
"timing": {
"image_generation": { "elapsed_seconds": 12.34, "model": "sn_image_model" },
"vlm_review": { "elapsed_seconds": 5.67, "model": "sensenova-6.7-flash-lite" }
}
}
]
}Error Flow:
json
{
"status": "error",
"error": "<Actual error information>"
}Rules:
- must contain
status=okneed_main_agent_send: true - must contain when
expanded_prompt; value is originaloutput_mode=verbosewhenuser_promptprompts_expand_skipped=true - must contain when expand is not executed (value is
prompts_expand_skipped), covering two cases:trueandprompts_expand_mode=disableand evaluation passes and skip expandprompts_expand_mode=auto - must contain when early termination (value is
early_terminated), omitted when normal execution completestrue - is an array of strings, from review results
violations - is an empty string when
reasoningmax_rounds=1 - Top-level contains:
timing- : Worker Agent's wall time from Step 0 to returning JSON, calculated by Worker Agent itself
total_elapsed_seconds - : Step 1 evaluation call, containing
prompt_detectionandelapsed_seconds(read from sn-text-optimize JSON return); omitted whenmodelprompts_expand_mode=disable - : Step 2.0 content analysis call, containing
content_analysisandelapsed_seconds(read from sn-text-optimize JSON return); omitted when expand is skippedmodel - : Step 2.3 prompt expansion call, containing
prompt_expandandelapsed_seconds(read from sn-text-optimize JSON return); omitted when expand is skippedmodel
- is fixed to the hardcoded placeholder
rounds[].timing.image_generation.model"sn_image_model" - is omitted when
rounds[].timing.vlm_reviewmax_rounds=1
工作Agent完成后,其最后一条消息必须且只能是以下JSON字符串(纯JSON,无代码围栏,无前后文本)。
正常流程:
json
{
"status": "ok",
"need_main_agent_send": true,
"output_mode": "friendly|verbose",
"expanded_prompt": "<output_mode=verbose时必须包含;prompts_expand_skipped=true时为原始user_prompt,否则为扩展结果>",
"prompts_expand_skipped": true,
"early_terminated": true,
"timing": {
"total_elapsed_seconds": 35.12,
"prompt_detection": { "elapsed_seconds": 2.11, "model": "sensenova-6.7-flash-lite" },
"content_analysis": { "elapsed_seconds": 3.22, "model": "sensenova-6.7-flash-lite" },
"prompt_expand": { "elapsed_seconds": 8.45, "model": "sensenova-6.7-flash-lite" }
},
"rounds": [
{
"round": 1,
"image": "$TEMP_DIR/round_1.png",
"result": "PASS|FAIL",
"violations_count": 0,
"violations": [],
"reasoning": "<推理过程,max_rounds=1时为空字符串>",
"timing": {
"image_generation": { "elapsed_seconds": 12.34, "model": "sn_image_model" },
"vlm_review": { "elapsed_seconds": 5.67, "model": "sensenova-6.7-flash-lite" }
}
}
]
}错误流程:
json
{
"status": "error",
"error": "<真实错误信息>"
}规则:
- 必须包含
status=okneed_main_agent_send: true - 在
expanded_prompt时必须包含;output_mode=verbose时为原始prompts_expand_skipped=trueuser_prompt - 当未执行扩展时,必须包含(值为
prompts_expand_skipped),覆盖两种情况:true和prompts_expand_mode=disable且评估通过并跳过扩展prompts_expand_mode=auto - 当提前终止时,必须包含(值为
early_terminated),正常执行完成时省略true - 是字符串数组,来自审核结果
violations - 当时,
max_rounds=1为空字符串reasoning - 顶层包含:
timing- :工作Agent从步骤0到返回JSON的实际耗时,由工作Agent自行计算
total_elapsed_seconds - :步骤1的评估调用,包含
prompt_detection和elapsed_seconds(从sn-text-optimize的JSON返回值读取);model时省略prompts_expand_mode=disable - :步骤2.0的内容分析调用,包含
content_analysis和elapsed_seconds(从sn-text-optimize的JSON返回值读取);跳过扩展时省略model - :步骤2.3的提示词扩展调用,包含
prompt_expand和elapsed_seconds(从sn-text-optimize的JSON返回值读取);跳过扩展时省略model
- 固定为硬编码占位符
rounds[].timing.image_generation.model"sn_image_model" - 当时,省略
max_rounds=1rounds[].timing.vlm_review
Output Format
输出格式
friendly mode (default)
friendly模式(默认)
Text Summary:
- when : Generate a one-sentence description of the image content based on
max_rounds = 1,不超过50字expanded_prompt - when : Generate a one-sentence description of the image content based on
max_rounds > 1andresult,不超过50字:violations- : Describe in a positive tone
result=PASS - (1-2 violations): Gently point out specific issues
result=FAIL - (3 or more): Objectively summarize the main issues
result=FAIL
Image: rank=1 best single image
文本摘要:
- 当时:基于
max_rounds = 1生成一句图像内容描述,不超过50字expanded_prompt - 当时:基于
max_rounds > 1和result生成一句图像内容描述,不超过50字:violations- :采用积极语气描述
result=PASS - (1-2个问题):温和指出具体问题
result=FAIL - (3个及以上问题):客观总结主要问题
result=FAIL
图像:排名第1的最优单张图像
verbose mode
verbose模式
Quality ranking result (high -> low)
---
Expanded prompt: [expanded | not expanded, using original prompt]
<expanded_prompt>
---
#1 round=<n> result=<PASS|FAIL> violations=<n> [early terminated]
#2 round=<n> result=<PASS|FAIL> violations=<n>
...
---
Time statistics: Total <total>s | Prompt evaluation <t>s | Content analysis <t>s | Prompt expansion <t>s | Image generation <t>s×<n> rounds | VLM review <t>s×<n> rounds
---
Images (sent in rank order)质量排名结果(高→低)
---
扩展提示词:[已扩展 | 未扩展,使用原始提示词]
<expanded_prompt>
---
#1 round=<n> result=<PASS|FAIL> violations=<n> [提前终止]
#2 round=<n> result=<PASS|FAIL> violations=<n>
...
---
时间统计:总耗时 <total>s | 提示词评估 <t>s | 内容分析 <t>s | 提示词扩展 <t>s | 图像生成 <t>s×<n>轮 | VLM审核 <t>s×<n>轮
---
图像(按排名顺序发送)Call Relationship
调用关系
- Bottom-level dependency: →
sn-image-base,sn-image-generate,sn-image-recognizesn-text-optimize
- 底层依赖:→
sn-image-base,sn-image-generate,sn-image-recognizesn-text-optimize
References
参考文档
- - Analysis methodology
references/analysis-framework.md - - Prompt template
references/base-prompt.md - - Evaluation standard
references/evaluation-standard.md - - Layout and style selection rules
references/layout-style-selection.md - - Prompt expansion system prompt
references/prompts-expand-system.md - - Prompt critic system prompt
references/prompts-critic-system.md - - Runtime parameters
references/runtime-parameters.md - - Structured content template
references/structured-content-template.md - - Layout definitions (87 layouts)
references/layouts/<layout>.md - - Style definitions (66 styles)
references/styles/<style>.md
- - 分析方法论
references/analysis-framework.md - - 提示词模板
references/base-prompt.md - - 评估标准
references/evaluation-standard.md - - 布局与风格选择规则
references/layout-style-selection.md - - 提示词扩展系统提示词
references/prompts-expand-system.md - - 提示词审核系统提示词
references/prompts-critic-system.md - - 运行时参数
references/runtime-parameters.md - - 结构化内容模板
references/structured-content-template.md - - 布局定义(87种布局)
references/layouts/<layout>.md - - 风格定义(66种风格) ",
references/styles/<style>.md