自动化教程生成-演示版
可以自动化生成全套教程。 开始时输入想要生成的教程名称。
工作流图谱
YAML 源码
app:
description: '可以自动化生成全套教程。
开始时输入想要生成的教程名称。'
icon: 🤖
icon_background: '#FFEAD5'
mode: workflow
name: 自动化教程生成-演示版
use_icon_as_answer_icon: false
kind: app
version: 0.1.2
workflow:
conversation_variables: []
environment_variables: []
features:
file_upload:
image:
enabled: false
number_limits: 3
transfer_methods:
- local_file
- remote_url
opening_statement: ''
retriever_resource:
enabled: false
sensitive_word_avoidance:
enabled: false
speech_to_text:
enabled: false
suggested_questions: []
suggested_questions_after_answer:
enabled: false
text_to_speech:
enabled: false
language: ''
voice: ''
graph:
edges:
- data:
isInIteration: false
sourceType: llm
targetType: code
id: 1728198088794-source-1728203511475-target
selected: false
source: '1728198088794'
sourceHandle: source
target: '1728203511475'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: true
iteration_id: '1728217105363'
sourceType: code
targetType: llm
id: 1728218846720-source-1728218323079-target
selected: false
source: '1728218846720'
sourceHandle: source
target: '1728218323079'
targetHandle: target
type: custom
zIndex: 1002
- data:
isInIteration: false
sourceType: start
targetType: llm
id: 1728198077941-source-1728198088794-target
selected: false
source: '1728198077941'
sourceHandle: source
target: '1728198088794'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: true
iteration_id: '1728217105363'
sourceType: iteration-start
targetType: code
id: 1728217105363start-source-1728218846720-target
selected: false
source: 1728217105363start
sourceHandle: source
target: '1728218846720'
targetHandle: target
type: custom
zIndex: 1002
- data:
isInIteration: true
iteration_id: '1728217105363'
sourceType: llm
targetType: code
id: 1728218323079-source-1728463823248-target
selected: false
source: '1728218323079'
sourceHandle: source
target: '1728463823248'
targetHandle: target
type: custom
zIndex: 1002
- data:
isInIteration: false
sourceType: code
targetType: iteration
id: 1728203511475-source-1728217105363-target
source: '1728203511475'
sourceHandle: source
target: '1728217105363'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: iteration
targetType: end
id: 1728217105363-source-1728198201864-target
source: '1728217105363'
sourceHandle: source
target: '1728198201864'
targetHandle: target
type: custom
zIndex: 0
nodes:
- data:
desc: '👨💼作者:北平牧哥
💚微信:mugeleey
🗨微信公众号:pekingmuge
🌍Twitter: https://x.com/pekingmuge'
selected: true
title: 开始
type: start
variables:
- label: 教程名称
max_length: 48
options: []
required: true
type: text-input
variable: course_name
height: 180
id: '1728198077941'
position:
x: 30
y: 295
positionAbsolute:
x: 30
y: 295
selected: true
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
context:
enabled: false
variable_selector: []
desc: 生成教程大纲,课程目录
model:
completion_params:
temperature: 0
mode: chat
name: o1-mini-2024-09-12
provider: openai
prompt_template:
- id: fa51a950-08a7-45bf-936c-14aa386a2ec6
role: system
text: 你是一个{{#1728198077941.course_name#}}方面的专家,编写一个{{#1728198077941.course_name#}}教程的课程大纲,并仅以JSON列表的形式输出。
- id: 4a06912a-7141-497b-a68c-b425d459a97c
role: user
text: '编写一个{{#1728198077941.course_name#}}教程大纲,要求从入门到精通。
整理成列表,并以JSON方式输出结果。'
- id: 01f88599-5ae2-4978-a69b-1a13cc9b34be
role: assistant
text: "输出格式如下(每一章至少5-12篇内容)\n[\n {\n \"chapter\": \"第1章\",\n \"\
title\": \"xxxx\",\n \"contents\":\n [\n \"1.1 xxx\"\
,\n ...\n ]\n },\n ...\n]"
selected: false
title: LLM 生成课程大纲
type: llm
variables: []
vision:
enabled: false
height: 124
id: '1728198088794'
position:
x: 333
y: 295
positionAbsolute:
x: 333
y: 295
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
desc: ''
outputs:
- value_selector:
- '1728198077941'
- course_name
variable: course_name
- value_selector:
- '1728217105363'
- output
variable: course
selected: false
title: 结束
type: end
height: 114
id: '1728198201864'
position:
x: 2079
y: 295
positionAbsolute:
x: 2079
y: 295
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
code: "\ndef main(text: str) -> dict:\n import re, json\n\n pattern\
\ = r\"^```json\\n([\\s\\S]*)\\n```\"\n matched = re.match(pattern, text,\
\ re.MULTILINE)\n if not matched:\n return {\"result\": \"None\"\
}\n jsonstr = matched.group(1)\n obj = json.loads(jsonstr)\n contents\
\ = []\n for chapter in obj:\n for subtitle in chapter['contents']:\n\
\ contents += [\n {\n \"chapter\"\
: chapter[\"chapter\"],\n \"title\": chapter[\"title\"\
],\n \"subtitle\": subtitle,\n }\n \
\ ]\n return {\n \"result\": contents,\n }"
code_language: python3
desc: ''
outputs:
result:
children: null
type: array[object]
selected: false
title: 转换成JSON
type: code
variables:
- value_selector:
- '1728198088794'
- text
variable: text
height: 52
id: '1728203511475'
position:
x: 636
y: 295
positionAbsolute:
x: 636
y: 295
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
desc: ''
height: 190
iterator_selector:
- '1728203511475'
- result
output_selector:
- '1728463823248'
- result
output_type: array[object]
selected: false
start_node_id: 1728217105363start
title: 迭代生成课程
type: iteration
width: 1080
height: 190
id: '1728217105363'
position:
x: 939
y: 295
positionAbsolute:
x: 939
y: 295
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 1080
zIndex: 1
- data:
desc: ''
isInIteration: true
selected: false
title: ''
type: iteration-start
draggable: false
height: 48
id: 1728217105363start
parentId: '1728217105363'
position:
x: 24
y: 68
positionAbsolute:
x: 963
y: 363
selectable: false
sourcePosition: right
targetPosition: left
type: custom-iteration-start
width: 44
zIndex: 1002
- data:
context:
enabled: false
variable_selector: []
desc: ''
isInIteration: true
iteration_id: '1728217105363'
model:
completion_params:
temperature: 0
mode: chat
name: gpt-4o-mini
provider: openai
prompt_template:
- id: 42d3ce21-8fa0-4fe3-b28b-3c6807fe8575
role: system
text: 你是一个 {{#1728198077941.course_name#}} 专家,正在写一篇关于 {{#1728198077941.course_name#}}
的教程,每一个知识点要尽可能详尽,字数多一点。
- id: a40f0999-e68c-4f9a-add9-46ab3cb7bb38
role: user
text: 写一篇关于{{#1728218846720.title#}} {{#1728218846720.subtitle#}} 的教程文章,内容要严谨,要有丰富的示例代码。教程还要很详细,到达专家级别,并且要有每一个内容的优点、缺点、注意事项。
selected: false
title: LLM生成课程
type: llm
variables: []
vision:
configs:
detail: high
enabled: true
height: 96
id: '1728218323079'
parentId: '1728217105363'
position:
x: 427.82204039715634
y: 65
positionAbsolute:
x: 1366.8220403971563
y: 360
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
zIndex: 1002
- data:
code: "def main(item: object) -> dict:\n return item\n"
code_language: python3
desc: ''
isInIteration: true
iteration_id: '1728217105363'
outputs:
chapter:
children: null
type: string
subtitle:
children: null
type: string
title:
children: null
type: string
selected: false
title: 转object
type: code
variables:
- value_selector:
- '1728217105363'
- item
variable: item
height: 52
id: '1728218846720'
parent...(过长已截断)