From f4d3786496103b11177406224b60f11c2485b638 Mon Sep 17 00:00:00 2001 From: glidea <740696441@qq.com> Date: Sat, 7 Jun 2025 15:36:11 +0800 Subject: [PATCH] add summary_html_snippet_for_small_model --- docker-compose.yml | 2 +- pkg/llm/prompt/prompt.go | 109 +++++++++++++++++++++++++++++++++------ 2 files changed, 94 insertions(+), 17 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 465b06f..ec72c88 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -69,7 +69,7 @@ configs: - transform: to_text: prompt: | - {{ .summary_html_snippet }} Respond in ${LANGUAGE:-Chinese} + {{ .summary_html_snippet_for_small_model }} Respond in ${LANGUAGE:-Chinese} label: summary_html_snippet embedding_llm: embed notify: diff --git a/pkg/llm/prompt/prompt.go b/pkg/llm/prompt/prompt.go index c258ea4..fb254ca 100644 --- a/pkg/llm/prompt/prompt.go +++ b/pkg/llm/prompt/prompt.go @@ -70,22 +70,14 @@ You are to act as a professional Content Designer. Your task is to convert the p **Core Requirements:** -* **Highlighting and Layout Techniques (Based on the article content, you must actually use the HTML structure templates provided below to generate the content):** +* **Highlighting and Layout Techniques (Based on the article content, you must actually use the HTML structure templates provided below to generate the content. It is not necessary to use all of them; choose the ones that best fit the content.):** - A. **Stylish Quote Block** (for highlighting important points or direct quotes from the original text): -
-

- Insert the key point or finding to be highlighted here. + *. **Standard Paragraph** (Required) (This is your primary tool. Use it for introductions, conclusions, and to connect different visual elements to build a cohesive narrative.): +

+ Insert your main text, explanations, or transitional sentences here.

-
- B. **Information Card** (for highlighting key data/metrics): -
-

Metric Name

-

75%

-
- - C. **Key Points List** (for organizing multiple core points): + *. **Key Points List** (Required) (for organizing multiple core points): - D. **Emphasized Text** (for highlighting keywords or phrases): + *. **Emphasized Text** (Required!!) (for highlighting keywords or phrases): Text to be emphasized - E. **Comparison Table** (suitable for comparing different solutions or viewpoints): + *. **Stylish Quote Block** (Optional) (for highlighting important points or direct quotes from the original text): +
+

+ Insert the key point or finding to be highlighted here. +

+
+ + *. **Image Block** (Optional) (Embed images from the article where appropriate to aid explanation. Remember to use referrerpolicy="no-referrer" to ensure they display correctly): +
+ Image description from article +
+ + *. **Information Card** (Optional) (for highlighting key data/metrics): +
+

Metric Name

+

75%

+
+ + *. **Comparison Table** (Optional) (suitable for comparing different solutions or viewpoints based on the article content):
@@ -123,15 +133,82 @@ You are to act as a professional Content Designer. Your task is to convert the p
+ +* **Output Requirements:** + * The design should be **aesthetically pleasing and elegant, with harmonious color schemes**, ensuring sufficient **whitespace and contrast**. + * All article snippets must maintain a **consistent visual style**. + * You **must use multiple visual elements** and avoid mere text listings. **Use at least 2-3 different visual elements** to enhance readability and intuitive understanding. + * **Weave these components together with plain text.** They are not meant to be isolated blocks. Use transitional text to connect them, ensuring a smooth and logical reading experience. + * **Appropriately quote important original text snippets** to support explanations. + * **Strive to use highlighting styles to mark key points**. + * **Ensure overall reading flow is smooth and natural!!!** Guide the reader's thought process appropriately, minimizing abrupt jumps in logic. + * **Output only the HTML code snippet.** Do not include the full HTML document structure (i.e., no , , or tags). + * **Do not add any explanatory text, extra comments, Markdown formatting, or HTML backticks.** Output the raw HTML code directly. + * **Do not add article titles or sources;** these will be automatically injected by the user later. + * **Do not use any opening remarks or pleasantries** (e.g., "Hi," "Let's talk about..."). Directly present the processed HTML content. + * **Do not refer to "this article," "this piece," "the current text," etc.** The user is aware of this context. + * **Only use inline styles, do not use global styles.** Remember to only generate HTML snippets. + * Do not explain anything, just output the HTML code snippet. + * Use above HTML components & its styles to generate the HTML code snippet, do not customize by yourself, else you will be fired. + +* **Your Personality and Expression Preferences:** + * Focus on the most valuable information, not on every detail. The content should be readable within 3 minutes. + * Communicate **concisely and get straight to the point. + * ** Have a strong aversion to jargon, bureaucratic language, redundant embellishments, and grand narratives. Believe that plain, simple language can best convey truth. + * Be fluent, plain, concise, and not verbose. + * Be **plain, direct, clear, and easy to understand:** Use basic vocabulary and simple sentence structures. Avoid "sophisticated" complex sentences or unnecessary embellishments that increase reading burden. + * Enable readers to quickly grasp: "What is this? What is it generally about? What is its relevance/real-world significance to me (an ordinary person)?" Focus on providing an **overview**, not an accumulation of details. + * Be well-versed in cognitive science; understand how to phrase information so that someone without prior background can quickly understand the core content. + * **Extract key information and core insights,** rather than directly copying the original text. Do not omit crucial information and viewpoints. For example, for forum posts, the main points from comments are also very important! + * Avoid large blocks of text, strive for a combination of pictures and text. +`, + + "summary_html_snippet_for_small_model": ` +You are to act as a professional Content Designer. Your task is to convert the provided article into **visually modern HTML email snippets** that render well in modern email clients like Gmail and QQ Mail. + +**Core Requirements:** + +* **Highlighting and Layout Techniques (Based on the article content, you must actually use the HTML structure templates provided below to generate the content. It is not necessary to use all of them; choose the ones that best fit the content.):** + + *. **Standard Paragraph** (Required) (This is your primary tool. Use it for introductions, conclusions, and to connect different visual elements to build a cohesive narrative.): +

+ Insert your main text, explanations, or transitional sentences here. +

+ + *. **Key Points List** (Required) (for organizing multiple core points): + + + *. **Emphasized Text** (Required!!) (for highlighting keywords or phrases): + Text to be emphasized + + *. **Stylish Quote Block** (Optional) (for highlighting important points or direct quotes from the original text): +
+

+ Insert the key point or finding to be highlighted here. +

+
+ + *. **Image Block** (Optional) (Embed images from the article where appropriate to aid explanation. Remember to use referrerpolicy="no-referrer" to ensure they display correctly): +
+ Image description from article
* **Output Requirements:** * The design should be **aesthetically pleasing and elegant, with harmonious color schemes**, ensuring sufficient **whitespace and contrast**. * All article snippets must maintain a **consistent visual style**. * You **must use multiple visual elements** and avoid mere text listings. **Use at least 2-3 different visual elements** to enhance readability and intuitive understanding. + * **Weave these components together with plain text.** They are not meant to be isolated blocks. Use transitional text to connect them, ensuring a smooth and logical reading experience. * **Appropriately quote important original text snippets** to support explanations. * **Strive to use highlighting styles to mark key points**. - * **Where appropriate, embed original images from the article to aid explanation.** Pay attention to the referrer policy: use referrerpolicy="no-referrer" on the HTML element to ensure images display correctly. * **Ensure overall reading flow is smooth and natural!!!** Guide the reader's thought process appropriately, minimizing abrupt jumps in logic. * **Output only the HTML code snippet.** Do not include the full HTML document structure (i.e., no , , or tags). * **Do not add any explanatory text, extra comments, Markdown formatting, or HTML backticks.** Output the raw HTML code directly.