forked from microsoft/agent-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMathChat.yaml
More file actions
88 lines (74 loc) · 2.46 KB
/
MathChat.yaml
File metadata and controls
88 lines (74 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
# This workflow demonstrates conversation between two agents: a student and a teacher.
# The student attempts to solve the input problem and the teacher provides guidance.
#
# For this workflow, two agents are used, each with a prompt specific to their role.
#
# Student:
# See: ./setup/StudentAgent.yaml
#
# With instructions:
#
# Your job is help a math teacher practice teaching by making intentional mistakes.
# You Attempt to solve the given math problem, but with intentional mistakes so the teacher can help.
# Always incorporate the teacher's advice to fix your next response.
# You have the math-skills of a 6th grader.
# Teacher:
# See: ./setup/TeacherAgent.yaml
#
# With instructions:
#
# Review and coach the student's approach to solving the given math problem.
# Don't repeat the solution or try and solve it.
# If the student has demonstrated comprehension and responded to all of your feedback,
# give the student your congratulations by using the word "congratulations".
#
kind: Workflow
trigger:
kind: OnConversationStart
id: workflow_demo
actions:
- kind: SetVariable
id: set_project
variable: Local.InputTask
value: =UserMessage(System.LastMessageText)
- kind: InvokeAzureAgent
id: question_student
conversationId: =System.ConversationId
agent:
name: =Env.FOUNDRY_AGENT_STUDENT
input:
messages: =Local.InputTask
- kind: ResetVariable
id: reset_project
variable: Local.InputTask
- kind: InvokeAzureAgent
id: question_teacher
conversationId: =System.ConversationId
agent:
name: =Env.FOUNDRY_AGENT_TEACHER
output:
messages: Local.TeacherResponse
- kind: SetVariable
id: set_count_increment
variable: Local.TurnCount
value: =Local.TurnCount + 1
- kind: ConditionGroup
id: check_completion
conditions:
- condition: =!IsBlank(Find("CONGRATULATIONS", Upper(Last(Local.TeacherResponse).Text)))
id: check_turn_done
actions:
- kind: SendActivity
id: sendActivity_done
activity: GOLD STAR!
- condition: =Local.TurnCount < 4
id: check_turn_count
actions:
- kind: GotoAction
id: goto_student_agent
actionId: question_student
elseActions:
- kind: SendActivity
id: sendActivity_tired
activity: Let's try again later...