feat(图像生成): 修改提示词模板以支持主题和详情参数
将图像生成的提示词模板从单一prompt参数改为支持topic和detail两个参数 更新中英文语言文件中的提示词模板,改为写实摄影风格要求
This commit is contained in:
@@ -655,6 +655,8 @@ export function useThinkFlow({ t, locale }: { t: Translate; locale: Ref<string>
|
||||
const finalApiKey = apiConfig.mode === 'default' ? useConfig.apiKey || API_KEY : useConfig.apiKey
|
||||
|
||||
try {
|
||||
const topic = node.data.label || prompt
|
||||
const detail = node.data.description || ''
|
||||
const response = await fetch(useConfig.baseUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -663,7 +665,7 @@ export function useThinkFlow({ t, locale }: { t: Translate; locale: Ref<string>
|
||||
},
|
||||
body: JSON.stringify({
|
||||
model: useConfig.model,
|
||||
prompt: t('prompts.image', { prompt })
|
||||
prompt: t('prompts.image', { topic, detail })
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
},
|
||||
"prompts": {
|
||||
"system": "You are a mind-mapping assistant that helps users expand their ideas layer by layer into a thinking tree.\n\nWorkflow:\n1. User provides an initial idea (or selects an existing node).\n2. Understand user intent based on the [Thinking Context Path] (trace from root to current node).\n3. Generate 3-5 deeper or related sub-ideas.\n4. Each sub-idea includes a short name and a minimal description.\n\nResponse format must be strict JSON:\n{'{'}\n \"nodes\": [\n {'{'} \"text\": \"Sub-idea 1 Name\", \"description\": \"One-sentence description\" {'}'},\n {'{'} \"text\": \"Sub-idea 2 Name\", \"description\": \"One-sentence description\" {'}'}\n ]\n{'}'}\n\nNote: Return ONLY JSON, no explanation.",
|
||||
"image": "A beautiful book art illustration, theme: {prompt}. Style: Exquisite picture book aesthetic, warm tones, soft lighting, elegant and poetic composition that tells a story. Details: High-quality brushwork, minimalist yet decorative, suitable as a visual centerpiece for a mind map. STRICT REQUIREMENT: No text, letters, or characters in the image.",
|
||||
"image": "A high-quality photorealistic, camera-like image. Subject/Concept: {topic}. Details/Traits: {detail}. Requirements: realistic materials and fine details, correct perspective and proportions, natural or cinematic lighting, clean background, premium composition, restrained color palette—suitable as a visual centerpiece for a mind map. Quality: ultra sharp, high resolution, natural depth of field. STRICTLY FORBIDDEN: any text/watermark/logo; cartoon/illustration/picture-book style, hand-drawn, anime, 3D render look, heavy filters, distortion, blur, low-res.",
|
||||
"continue": "Please continue exploring",
|
||||
"coreIdeaPrefix": "Core Idea",
|
||||
"contextPath": "Thinking Context Path",
|
||||
@@ -89,4 +89,4 @@
|
||||
"deepDivePrompt": "Please provide a deep and detailed analysis of 【{topic}】. Requirements:\n1. Clear structure, including background, core principles, key elements, and practical applications.\n2. Professional yet easy-to-understand language.\n3. Total length around 300-500 words.\n4. Output the body text directly, do not use JSON format, and do not include any opening or closing remarks.",
|
||||
"summaryPrompt": "You are a thinking summary expert. Please generate a structured summary based on the provided mind map node information (including the core idea and all branched sub-ideas).\n\nNode data:\n{nodes}\n\nRequirements:\n1. Extract the core theme and its underlying logic.\n2. Summarize several main dimensions or branch directions.\n3. Conclude with final insights or conclusions.\n4. Language should be concise, professional, and inspiring.\n5. Output the summary content directly, do not use JSON format, and do not include any opening remarks."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
},
|
||||
"prompts": {
|
||||
"system": "你是一个思维发散助手,帮助用户将想法逐层展开,构建思维树。\n\n工作流程:\n1. 用户给出一个初始想法(或选择一个已有节点继续追问)。\n2. 你需要根据【思考上下文路径】(即从根节点到当前节点的思考链路)来理解用户的意图。\n3. 生成 3-5 个更深层或相关维度的子想法。\n4. 每个子想法包含简短名称和极简描述。\n\n返回格式必须为严格 JSON:\n{'{'}\n \"nodes\": [\n {'{'} \"text\": \"子想法1名称\", \"description\": \"一句话描述\" {'}'},\n {'{'} \"text\": \"子想法2名称\", \"description\": \"一句话描述\" {'}'}\n ]\n{'}'}\n\n注意:只返回 JSON,不附加解释。",
|
||||
"image": "这是一张精美的艺术插画,主题是:{prompt}。风格要求:具有精致的绘本感,构图优美且富有诗意,像是在讲述一个故事。细节要求:高质量的笔触,极简主义与装饰艺术结合,适合作为思维导图的视觉核心。严禁:图片中不得出现任何文字、字母或字符。",
|
||||
"image": "这是一张高质量写实摄影风格的图片。主体/概念:{topic}。详情/特征:{detail}。画面要求:真实材质与细节、准确透视与比例、自然光或电影级布光、干净背景与高级构图、色彩克制,适合作为思维导图的视觉核心。质量:超清、锐利、噪点控制自然、层次分明的景深。严禁:任何文字/水印/Logo;卡通、插画、绘本、手绘、漫画、动漫、3D 渲染感、过度滤镜、变形、模糊、低清。",
|
||||
"continue": "请继续深入发散",
|
||||
"coreIdeaPrefix": "核心想法",
|
||||
"contextPath": "思考上下文路径",
|
||||
@@ -89,4 +89,4 @@
|
||||
"deepDivePrompt": "请针对【{topic}】提供一个深度且详细的解析。要求:\n1. 结构清晰,包含背景、核心原理、关键要素和实际应用。\n2. 语言专业且易懂。\n3. 总字数控制在 300-500 字左右。\n4. 直接输出正文内容,不要包含 JSON 格式,也不要包含任何开场白或结束语。",
|
||||
"summaryPrompt": "你是一个思维总结专家。请根据以下提供的思维导图节点信息(包含核心想法及其发散出的所有子想法),生成一份结构化的全篇总结。\n\n节点数据如下:\n{nodes}\n\n要求:\n1. 提炼出核心主题及其背后的核心逻辑。\n2. 归纳出几个主要的维度或分支方向。\n3. 总结最终达成的洞察或结论。\n4. 语言要精炼、专业,富有启发性。\n5. 直接输出总结内容,不要包含 JSON 格式,不要有任何开场白。"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user