diff --git a/en/guides/workflow/node/template.md b/en/guides/workflow/node/template.md index c97e4aa42..696b12d13 100644 --- a/en/guides/workflow/node/template.md +++ b/en/guides/workflow/node/template.md @@ -28,7 +28,7 @@ This template node can then be used within a Chatflow to return intermediate out > The `Answer` node in a Chatflow is non-terminal. It can be inserted anywhere to output responses at multiple points within the flow. -Support for rendering HTML forms +Example: Support for rendering HTML forms: ```html
// Default to text diff --git a/jp/guides/workflow/node/template.md b/jp/guides/workflow/node/template.md index ffb546335..96f003d7d 100644 --- a/jp/guides/workflow/node/template.md +++ b/jp/guides/workflow/node/template.md @@ -42,7 +42,6 @@ Jinja2のPythonテンプレート言語を使って、データ変換やテキ Jinjaの[公式ドキュメント](https://jinja.palletsprojects.com/en/3.1.x/templates/)を参考にして、さまざまなタスクを実行するためのより複雑なテンプレートを作成することができます。 - **例3:** HTMLフォームのレンダリングをサポート ```html diff --git a/zh_CN/guides/workflow/node/template.md b/zh_CN/guides/workflow/node/template.md index fc80bc81d..6e409c015 100644 --- a/zh_CN/guides/workflow/node/template.md +++ b/zh_CN/guides/workflow/node/template.md @@ -16,33 +16,34 @@ 模板节点允许你借助 Jinja2 这一强大的 Python 模板语言,在工作流内实现轻量、灵活的数据转换,适用于文本处理、JSON 转换等情景。例如灵活地格式化并合并来自前面步骤的变量,创建出单一的文本输出。这非常适合于将多个数据源的信息汇总成一个特定格式,满足后续步骤的需求。 -**示例1:** 将多个输入(文章标题、介绍、内容)拼接为完整文本 +**示例 1:** 将多个输入(文章标题、介绍、内容)拼接为完整文本 -

拼接文本

+

拼接文本

-**示例2:** 将知识检索节点获取的信息及其相关的元数据,整理成一个结构化的 Markdown 格式 +**示例 2:** 将知识检索节点获取的信息及其相关的元数据,整理成一个结构化的 Markdown 格式 ```Plain {% raw %} {% for item in chunks %} ### Chunk {{ loop.index }}. -### Similarity: {{ item.metadata.score | default('N/A') }} +### Similarity: {{ item.metadata.score | default ('N/A') }} #### {{ item.title }} ##### Content -{{ item.content | replace('\n', '\n\n') }} +{{ item.content | replace ('\n', '\n\n') }} --- {% endfor %} {% endraw %} ``` -

知识检索节点输出转换为 Markdown

+

知识检索节点输出转换为 Markdown

-你可以参考 Jinja 的[官方文档](https://jinja.palletsprojects.com/en/3.1.x/templates/),创建更为复杂的模板来执行各种任务。 +你可以参考 Jinja 的 [官方文档](https://jinja.palletsprojects.com/en/3.1.x/templates/),创建更为复杂的模板来执行各种任务。 + +**示例 3:** 支持渲染 HTML 的表单 -**示例3:** 支持渲染HTML的表单 ```html // Default to text @@ -64,4 +65,4 @@
``` -
\ No newline at end of file +
\ No newline at end of file