Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
221 changes: 221 additions & 0 deletions yaml_instance/demo_MathHelper.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
graph:
id: demo_MathHelper
description: 'A math assistant workflow. Able to answer college-level math questions and provide similar questions.'
log_level: DEBUG
is_majority_voting: false
nodes:
- id: Read
type: agent
config:
name: gpt-4o
provider: openai
role: |-
你是一名数学高手,擅长解决大学数学问题。
你的任务是:接受用户给出的数学问题,分析题意,拆解已知条件和所求,分条陈述给下一个节点。
注意:只需分析题意和所求,不要给出解题步骤和解题方法。
base_url: ${BASE_URL}
api_key: ${API_KEY}
params: {}
tooling: []
thinking: null
memories: []
retry: null
description: ''
context_window: 3
log_output: true
- id: Solve
type: agent
config:
name: gpt-4o
provider: openai
role: |-
你是一个数学高手,擅长解决大学数学问题。
你的任务是:根据提供的拆解后的已知条件和所求,深入分析,得出一个相对快捷的解法,并将解题步骤陈述给下一个节点。
注意:不要给出完整的解法,只需给出思路和解题步骤
base_url: ${BASE_URL}
api_key: ${API_KEY}
params: {}
tooling: []
thinking: null
memories: []
retry: null
description: ''
context_window: 3
log_output: true
- id: Check
type: agent
config:
name: gpt-4o
provider: openai
role: |
你是一个数学高手,擅长解决大学数学问题。
你的任务是:检查给出的解法是否能真正解决该问题,如果解法正确,不用做任何操作,如果解法有错误,直接给出修改后的解法。
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Check agent prompt says “if correct, do nothing”, but the only input to Print is Check’s output (via the Check→Print edge). If Check returns an empty/near-empty message, Print won’t have solution content to format. Adjust the Check prompt to always output the final verified solution steps (either unchanged or corrected), or change the edges so Print can also consume the Solve output when Check makes no changes.

Suggested change
你的任务是:检查给出的解法是否能真正解决该问题如果解法正确,不用做任何操作,如果解法有错误,直接给出修改后的解法
你的任务是:检查给出的解法是否能真正解决该问题。请始终输出【最终确认后的完整解题步骤】:如果解法正确,请在充分理解的基础上用你自己的话完整、清晰地复述或略微润色该解题步骤;如果解法有错误或不完整,请直接给出修改后的、正确且完整的解题步骤

Copilot uses AI. Check for mistakes.
base_url: ${BASE_URL}
api_key: ${API_KEY}
params: {}
tooling: []
thinking: null
memories: []
retry: null
description: ''
context_window: 3
log_output: true
- id: Print
type: agent
config:
name: gpt-4o
provider: openai
role: |
你是一个数学高手,擅长解决大学数学问题。
你的任务是:根据陈述的数学题解法,用严谨的格式给出一个简洁的完整的回答,并打印到对话框中,作为对该数学题的最终答案。
base_url: ${BASE_URL}
api_key: ${API_KEY}
params: {}
tooling: []
thinking: null
memories: []
retry: null
description: ''
context_window: 3
log_output: true
- id: Rethink
type: agent
config:
name: gpt-4o
provider: openai
role: |
你是一个数学高手,擅长解决大学数学问题。
你的任务是:根据题目分析和解法步骤,给出一道运用了相同或相似知识点解决的数学题,并直接给出解题步骤,并阐述相似点在何处
base_url: ${BASE_URL}
api_key: ${API_KEY}
params: {}
tooling: []
thinking: null
memories: []
retry: null
description: ''
context_window: 3
log_output: true
- id: Human View
type: human
config:
description: |-
如果你想再看一道相似题目,请输入one more。
如果不想,请输入stop。
description: ''
Comment on lines +102 to +105
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Human View tells users to input “stop”, but the only outgoing conditional edge from this node matches “one more”. If the user types “stop”, no edge will fire and the workflow may stall. Add an explicit “stop” (or default) edge from Human View to a terminal node and/or set graph.end appropriately.

Copilot uses AI. Check for mistakes.
context_window: 0
log_output: true
edges:
- from: Read
to: Solve
trigger: true
condition:
type: function
config:
name: 'true'
carry_data: true
keep_message: false
clear_context: false
clear_kept_context: false
process: null
dynamic: null
- from: Solve
to: Check
trigger: true
condition:
type: function
config:
name: 'true'
carry_data: true
keep_message: false
clear_context: false
clear_kept_context: false
process: null
dynamic: null
- from: Check
to: Print
trigger: true
condition:
type: function
config:
name: 'true'
carry_data: true
keep_message: false
clear_context: false
clear_kept_context: false
process: null
dynamic: null
- from: Print
to: Rethink
trigger: true
condition:
type: function
config:
name: 'true'
carry_data: true
Comment on lines +148 to +155
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Print always triggers Rethink, which means the workflow will generate a “similar question” even when the user didn’t ask for one. This conflicts with the Human View instructions that say the user should type “one more” to see another problem. Consider routing Print → Human View first, and only trigger Rethink when the keyword condition matches.

Copilot uses AI. Check for mistakes.
keep_message: false
clear_context: false
clear_kept_context: false
process: null
dynamic: null
- from: Rethink
to: Human View
trigger: true
condition:
type: function
config:
name: 'true'
carry_data: true
keep_message: false
clear_context: false
clear_kept_context: false
process: null
dynamic: null
- from: Human View
to: Rethink
trigger: true
condition:
type: keyword
config:
any:
- one more
none: []
regex: []
case_sensitive: true
carry_data: true
keep_message: false
clear_context: false
clear_kept_context: false
process: null
dynamic: null
- from: Read
to: Rethink
trigger: false
condition:
type: function
config:
name: 'true'
carry_data: true
keep_message: false
clear_context: false
clear_kept_context: false
process: null
dynamic: null
- from: Read
to: Check
trigger: false
condition:
type: function
config:
name: 'true'
carry_data: true
keep_message: false
clear_context: false
clear_kept_context: false
process: null
dynamic: null
memory: []
initial_instruction: ''
start:
- Read
end: []