| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- [
- {
- "name": "智能推荐播报",
- "category": "洗衣机推荐",
- "description": "结合天气/时段/城市/人群热度自动生成洗衣机播报文案",
- "output_description": "整洁的多段落播报语音脚本",
- "call_method": "POST /api/templates/render -> { template_id: 'wash_recommend', parameters: {...} }",
- "input_variables": [
- {
- "name": "hour",
- "label": "当前小时",
- "description": "0-23 小时数,用于问候与时段判断",
- "data_type": "number",
- "required": true,
- "default": "12"
- },
- {
- "name": "season",
- "label": "季节",
- "description": "如 春季/夏季/秋季/冬季",
- "data_type": "string",
- "required": true,
- "default": "夏季"
- },
- {
- "name": "city",
- "label": "城市",
- "description": "播报所在城市,用于地域化文案",
- "data_type": "string",
- "required": false,
- "default": "北京"
- },
- {
- "name": "program_name",
- "label": "洗衣程序",
- "description": "如 快速洗 / 强力洗 / 羊毛洗",
- "data_type": "string",
- "required": true,
- "default": "快速洗"
- },
- {
- "name": "feature_name",
- "label": "衣物特征",
- "description": "如 日常衣物 / 婴儿衣物 / 羽绒服",
- "data_type": "string",
- "required": false,
- "default": "日常衣物"
- },
- {
- "name": "temperature",
- "label": "气温",
- "description": "摄氏度,用于冷热判断",
- "data_type": "number",
- "required": false,
- "default": ""
- },
- {
- "name": "weather",
- "label": "天气",
- "description": "用于雨天等场景提示",
- "data_type": "string",
- "required": false,
- "default": ""
- },
- {
- "name": "user_count",
- "label": "使用用户数",
- "description": "用于展示热度,整数",
- "data_type": "number",
- "required": false,
- "default": ""
- },
- {
- "name": "user_proportion",
- "label": "用户占比",
- "description": "0-1 浮点数,转换百分比展示",
- "data_type": "number",
- "required": false,
- "default": ""
- }
- ],
- "template_body": "{%- set greeting = '亲爱的用户' if hour < 11 else '中午好' if hour < 14 else '下午好' if hour < 18 else '晚上好' -%}\n{%- set period = '早晨' if hour < 9 else '上午' if hour < 12 else '中午' if hour < 14 else '下午' if hour < 18 else '晚上' -%}\n\n{%- set is_hot = temperature is defined and temperature >= 30 -%}\n{%- set is_cold = temperature is defined and temperature <= 10 -%}\n{%- set has_rain = weather is defined and weather is string and '雨' in weather -%}\n{%- set condition = \n '炎热' if is_hot else \n '寒冷' if is_cold else \n '下雨' if has_rain else \n weather|default('美好') -%}\n\n{%- set proportion_pct = (user_proportion * 100)|round(1) if user_proportion is defined and user_proportion is not none else none -%}\n{%- set popularity_level = \n '最受欢迎' if proportion_pct is defined and proportion_pct is not none and proportion_pct >= 70 else \n '人气很高' if proportion_pct is defined and proportion_pct is not none and proportion_pct >= 50 else \n '很多人选择' if proportion_pct is defined and proportion_pct is not none and proportion_pct >= 30 else \n '值得一试' -%}\n\n{%- set user_desc = \n '超过' ~ user_count ~ '位用户' if user_count is defined and user_count is not none and user_count >= 10000 else \n user_count ~ '位用户' if user_count is defined and user_count is not none else \n '很多用户' -%}\n\n{# 第一段:基础推荐 + 数据支撑 #}\n{{ greeting }},为你推荐{{ feature_name|default('这类衣物') }}的{{ program_name }}程序,\n{%- if user_count is defined or user_proportion is defined %}\n这可是你的老朋友了,数据显示在{{ season }}{{ city|default('本地') }}{{ period }},\n{{ user_desc }}{% if proportion_pct is defined and proportion_pct is not none %},占比高达{{ proportion_pct }}%{% endif %}都爱用它洗呢。\n{%- else %}\n非常适合当前季节和衣物类型。\n{%- endif %}\n\n{# 第二段:季节场景化推荐 #}\n{%- if season in ['夏季', '冬天'] or is_hot or is_cold or has_rain %}\n{{ season }}洗衣时,\n{%- if is_hot %}高温天气下,{% elif is_cold %}寒冷天气下,{% elif has_rain %}雨天,{% endif %}\n{{ feature_name|default('这类衣物') }}的{{ program_name }}程序最懂你心意,\n{%- if proportion_pct is defined and proportion_pct is not none %}\n{{ city|default('本地') }}{{ period }}时段有{{ proportion_pct }}%用户选择它呢。\n{%- else %}\n很适合现在使用。\n{%- endif %}\n{%- endif %}\n\n{# 第三段:助手提醒(总是输出,增强亲切感) #}\n洗衣助手提醒你,{{ feature_name|default('这类衣物') }}的{{ program_name }}程序真不错,\n{%- if proportion_pct is defined and proportion_pct is not none %}\n{{ city|default('本地') }}{{ period }}时段人气也很旺,属于{{ popularity_level }}的洗衣方案。\n{%- else %}\n非常实用,值得一试。\n{%- endif %}\n\n{# 第四段:天气+时段氛围感推荐 #}\n又是一个{{ season }}{{ condition }}的{{ period }},\n为你推荐{{ feature_name|default('这类衣物') }}的{{ program_name }}程序,\n{%- if proportion_pct is defined and proportion_pct is not none %}\n这是{{ popularity_level }}的洗衣方案之一,{{ city|default('本地') }}{{ proportion_pct }}%用户都在用。\n{%- else %}\n这是当前最合适的洗涤方式。\n{%- endif %}\n\n{# 结尾温柔提醒 #}\n祝你洗衣愉快,衣物干净如新!",
- "id": "wash_recommend",
- "created_at": "2024-01-01T00:00:00Z",
- "updated_at": "2024-01-01T00:00:00Z"
- },
- {
- "name": "test",
- "category": "test",
- "description": "d",
- "output_description": "d",
- "call_method": "POST /api/templates/render\nContent-Type: application/json\n\n{\n \"template_id\": \"909602bd1c114ab3ae71d076920519bb\",\n \"parameters\": {\n \"tt\": \"tt\"\n }\n}",
- "input_variables": [
- {
- "name": "tt",
- "label": "tt",
- "description": "",
- "data_type": "string",
- "required": false,
- "default": "tt"
- }
- ],
- "template_body": "你好{{tt}}",
- "id": "909602bd1c114ab3ae71d076920519bb",
- "created_at": "2026-01-04T08:55:41.262950",
- "updated_at": "2026-01-04T08:55:43.871307"
- },
- {
- "name": "新模板",
- "category": "测试",
- "description": "d",
- "output_description": "d",
- "call_method": "POST /api/templates/render\nContent-Type: application/json\n\n{\n \"template_id\": \"<template-id>\",\n \"parameters\": {\n \"hello\": \"dd\"\n }\n}",
- "input_variables": [
- {
- "name": "hello",
- "label": "hello",
- "description": "",
- "data_type": "string",
- "required": false,
- "default": "hello"
- }
- ],
- "template_body": "你好{{hello}}",
- "id": "2fcf086c10eb4d43bdb9ae6c235e7a40",
- "created_at": "2026-01-04T09:00:24.557322",
- "updated_at": "2026-01-04T09:00:24.557325"
- }
- ]
|