@@ -42,6 +42,7 @@ public void testAgent() throws ExecutionException, InterruptedException {
4242
4343 when (storySeedAgent .invoke (eq ("A Great Story" ))).thenReturn ("storySeedAgent" );
4444 when (storySeedAgent .outputName ()).thenReturn ("premise" );
45+ when (storySeedAgent .name ()).thenReturn ("storySeedAgent" );
4546
4647 Workflow workflow =
4748 AgentWorkflowBuilder .workflow ("storyFlow" )
@@ -72,12 +73,15 @@ public void testAgents() throws ExecutionException, InterruptedException {
7273
7374 when (storySeedAgent .invoke (eq ("A Great Story" ))).thenReturn ("storySeedAgent" );
7475 when (storySeedAgent .outputName ()).thenReturn ("premise" );
76+ when (storySeedAgent .name ()).thenReturn ("storySeedAgent" );
7577
7678 when (plotAgent .invoke (eq ("storySeedAgent" ))).thenReturn ("plotAgent" );
7779 when (plotAgent .outputName ()).thenReturn ("plot" );
80+ when (plotAgent .name ()).thenReturn ("plotAgent" );
7881
7982 when (sceneAgent .invoke (eq ("plotAgent" ))).thenReturn ("sceneAgent" );
8083 when (sceneAgent .outputName ()).thenReturn ("story" );
84+ when (sceneAgent .name ()).thenReturn ("sceneAgent" );
8185
8286 Workflow workflow =
8387 AgentWorkflowBuilder .workflow ("storyFlow" )
@@ -112,12 +116,15 @@ public void testSequence() throws ExecutionException, InterruptedException {
112116
113117 when (storySeedAgent .invoke (eq ("A Great Story" ))).thenReturn ("storySeedAgent" );
114118 when (storySeedAgent .outputName ()).thenReturn ("premise" );
119+ when (storySeedAgent .name ()).thenReturn ("storySeedAgent" );
115120
116121 when (plotAgent .invoke (eq ("storySeedAgent" ))).thenReturn ("plotAgent" );
117122 when (plotAgent .outputName ()).thenReturn ("plot" );
123+ when (plotAgent .name ()).thenReturn ("plotAgent" );
118124
119125 when (sceneAgent .invoke (eq ("plotAgent" ))).thenReturn ("sceneAgent" );
120126 when (sceneAgent .outputName ()).thenReturn ("story" );
127+ when (sceneAgent .name ()).thenReturn ("sceneAgent" );
121128
122129 Workflow workflow =
123130 AgentWorkflowBuilder .workflow ("storyFlow" )
@@ -149,12 +156,15 @@ public void testParallel() throws ExecutionException, InterruptedException {
149156
150157 when (setting .invoke (eq ("sci-fi" ))).thenReturn ("Fake conflict response" );
151158 when (setting .outputName ()).thenReturn ("setting" );
159+ when (setting .name ()).thenReturn ("setting" );
152160
153161 when (hero .invoke (eq ("sci-fi" ))).thenReturn ("Fake hero response" );
154162 when (hero .outputName ()).thenReturn ("hero" );
163+ when (hero .name ()).thenReturn ("hero" );
155164
156165 when (conflict .invoke (eq ("sci-fi" ))).thenReturn ("Fake setting response" );
157166 when (conflict .outputName ()).thenReturn ("conflict" );
167+ when (conflict .name ()).thenReturn ("conflict" );
158168
159169 Workflow workflow =
160170 AgentWorkflowBuilder .workflow ("parallelFlow" )
@@ -193,12 +203,15 @@ public void testSeqAndThenParallel() throws ExecutionException, InterruptedExcep
193203
194204 when (factAgent .invoke (eq ("alien" ))).thenReturn ("Some Fact about aliens" );
195205 when (factAgent .outputName ()).thenReturn ("fact" );
206+ when (factAgent .name ()).thenReturn ("fact" );
196207
197208 when (cultureAgent .invoke (eq ("Some Fact about aliens" ))).thenReturn (cultureTraits );
198209 when (cultureAgent .outputName ()).thenReturn ("culture" );
210+ when (cultureAgent .name ()).thenReturn ("culture" );
199211
200212 when (technologyAgent .invoke (eq ("Some Fact about aliens" ))).thenReturn (technologyTraits );
201213 when (technologyAgent .outputName ()).thenReturn ("technology" );
214+ when (technologyAgent .name ()).thenReturn ("technology" );
202215 Workflow workflow =
203216 AgentWorkflowBuilder .workflow ("alienCultureFlow" )
204217 .tasks (
@@ -237,11 +250,13 @@ public void humanInTheLoop() throws ExecutionException, InterruptedException {
237250 eq ("Discuss project updates" )))
238251 .thenReturn ("Drafted meeting invitation for John Doe" );
239252 when (meetingInvitationDraft .outputName ()).thenReturn ("draft" );
253+ when (meetingInvitationDraft .name ()).thenReturn ("draft" );
240254
241255 final MeetingInvitationStyle meetingInvitationStyle = mock (MeetingInvitationStyle .class );
242256 when (meetingInvitationStyle .invoke (eq ("Drafted meeting invitation for John Doe" ), eq ("formal" )))
243257 .thenReturn ("Styled meeting invitation for John Doe" );
244258 when (meetingInvitationStyle .outputName ()).thenReturn ("styled" );
259+ when (meetingInvitationStyle .name ()).thenReturn ("styled" );
245260
246261 AtomicReference <String > request = new AtomicReference <>();
247262
0 commit comments