Files
agent-framework/workflows/MathChat.yaml
T
Chris 74879489a4 .NET Workflow - Integrated updated CPS Object Model (#681)
* Checkpoint

* Update workflows/DeepResearch.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Comment

* Fix comment

* Update package version

* Fix nuget haxx

* Checkpoint

* Code complete

* Testing

* Message content workaround

* Add sequential flow

* Checkpoint

* Integration test project

* Checkpoint

* Checkpoint cleanup

* Complete

* Update package

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-15 20:41:07 +00:00

89 lines
2.4 KiB
YAML

#
# 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 congraluations by using the word "congratulations".
#
kind: AdaptiveDialog
beginDialog:
kind: OnActivity
id: workflow_demo
actions:
- kind: SetVariable
id: set_project
variable: Topic.Project
value: =System.LastMessageText
- kind: InvokeAzureAgent
id: question_student
conversationId: =System.ConversationId
agent:
name: =Env.FOUNDRY_AGENT_STUDENT
input:
messages: =[UserMessage(Topic.Project)]
output:
messages: Topic.Answer
- kind: ResetVariable
id: reset_project
variable: Topic.Project
- kind: InvokeAzureAgent
id: question_teacher
conversationId: =System.ConversationId
agent:
name: =Env.FOUNDRY_AGENT_TEACHER
- kind: SetVariable
id: set_count_increment
variable: Topic.TurnCount
value: =Topic.TurnCount + 1
- kind: ConditionGroup
id: check_completion
conditions:
- condition: =!IsBlank(Find("congratulations", Lower(System.LastMessageText)))
id: check_turn_done
actions:
- kind: SendActivity
id: sendActivity_done
activity: GOLD STAR!
- condition: =Topic.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...