22
33{% if initial_chat_targets | length > 1 %}
44# Sequential Chats
5- # TODO: The input messsage is ignored, I guess it should be in the first element?
6- chat_result = node_{{ first_converser['id'] }}.initiate_chats(
5+ chat_results = node_{{ first_converser['id'] }}.initiate_chats(
76 [
8- {% - for target in initial_chat_targets - %}
7+ {% - for target in initial_chat_targets %}
98 {
109 "recipient": node_{{ target['node'] ['id'] }},
11- {% - if target ['chat_options' ].message %}
12- "message": "{{ target.chat_options.message }}",
10+ {% - if loop .first %}
11+ "message": args.message,
12+ {% - elif target ['chat_options' ].instructions %}
13+ "message": "{{ target.chat_options.instructions }}",
1314 {% - endif %}
1415 {% - if target ['chat_options' ].max_turns %}
1516 "max_turns": {{ target.chat_options.max_turns }},
1617 {% - endif %}
1718 {% - if target ['chat_options' ].summary_method %}
1819 "summary_method": "{{ target.chat_options.summary_method }}",
1920 {% - endif %}
21+ {% - if target ['chat_options' ].summary_prompt %}
22+ "summary_prompt": "{{ target.chat_options.summary_prompt }}",
23+ {% - endif %}
2024 }{% if not loop .last %} ,{% endif %}
21- {% - endfor - %}
25+ {% - endfor %}
2226 ]
2327)
28+
29+ # Sequential Chat Results
30+
31+
2432{% - elif initial_chat_targets | length == 1 %}
2533{% - if initial_chat_targets [0].node ['type' ] == 'nestedchat' %}
2634# Nested Chat
@@ -31,7 +39,7 @@ reply = node_{{ first_converser['id'] }}.generate_reply(
3139# Talk to one single agent
3240chat_result = node_{{ first_converser['id'] }}.initiate_chat(
3341 node_{{ initial_chat_targets[0] .node['id'] }},
34- {% - if initial_chat_targets and initial_chat_targets [0] and 'data' in initial_chat_targets [0] and initial_chat_targets [0]['data' ].class in ['RetrieveUserProxyAgent' , 'MathUserProxyAgent' ] %}
42+ {% - if initial_chat_targets and initial_chat_targets [0] and 'data' in initial_chat_targets [0] and initial_chat_targets [0]['data' ].class_type in ['RetrieveUserProxyAgent' , 'MathUserProxyAgent' ] %}
3543 problem=args.message,
3644 {% - else %}
3745 message=args.message,
0 commit comments