Skip to content

Commit 6001c12

Browse files
authored
.NET: Fix declarative workflows deep research sample (#7674)
* Fix declarative workflows deep research sample * Address PR comments
1 parent 6a3633e commit 6001c12

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

‎declarative-agents/workflow-samples/DeepResearch.yaml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
# - Knowledge Agent: Performs generic web searches.
1515
# - Coder Agent: Able to write and execute code.
1616
# - Weather Agent: Provides weather information.
17+
#
18+
# Example input:
19+
# Find the current temperatures in Seattle and San Francisco, calculate the difference in Celsius and Fahrenheit, and recommend what clothing to pack for each city.
1720
#
1821
kind: Workflow
1922
maxTurns: 500
@@ -264,14 +267,14 @@ trigger:
264267
output:
265268
messages: Local.Plan
266269
input:
270+
arguments:
271+
team: =Local.TeamDescription
267272
messages: |-
268273
=UserMessage(
269274
"Please briefly explain what went wrong on this last run (the root cause of the failure),
270275
and then come up with a new plan that takes steps and/or includes hints to overcome prior challenges and especially avoids repeating the same mistakes.
271-
As before, the new plan should be concise, be expressed in bullet-point form, and consider the following team composition
272-
(do not involve any other outside people since we cannot contact anyone else):
273-
274-
{Local.TeamDescription}")
276+
As before, the new plan should be concise, be expressed in bullet-point form, and only involve the team members already described
277+
(do not involve any other outside people since we cannot contact anyone else).")
275278
276279
- kind: SetTextVariable
277280
id: setVariable_jW7tmM

‎dotnet/samples/03-workflows/Declarative/DeepResearch/Program.cs‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,27 @@ 4. EDUCATED GUESSES
123123
private static DeclarativeAgentDefinition DefinePlannerAgent(IConfiguration configuration) =>
124124
new(configuration.GetValue(Application.Settings.FoundryModel))
125125
{
126-
Instructions = // TODO: Use Structured Inputs / Prompt Template
126+
Instructions =
127127
"""
128128
Your only job is to devise an efficient plan that identifies (by name) how a team member may contribute to addressing the user request.
129129
130130
Only select the following team which is listed as "- [Name]: [Description]"
131131
132-
- WeatherAgent: Able to retrieve weather information
133-
- CoderAgent: Able to write and execute Python code
134-
- KnowledgeAgent: Able to perform generic websearches
132+
{{team}}
135133
136134
The plan must be a bullet point list must be in the form "- [AgentName]: [Specific action or task for that agent to perform]"
137135
138136
Remember, there is no requirement to involve the entire team -- only select team member's whose particular expertise is required for this task.
139-
"""
137+
""",
138+
StructuredInputs =
139+
{
140+
["team"] =
141+
new StructuredInputDefinition
142+
{
143+
IsRequired = true,
144+
Description = "The available team members and their capabilities.",
145+
}
146+
}
140147
};
141148

142149
private static DeclarativeAgentDefinition DefineManagerAgent(IConfiguration configuration) =>
@@ -151,7 +158,7 @@ private static DeclarativeAgentDefinition DefineManagerAgent(IConfiguration conf
151158
- WeatherAgent: Able to retrieve weather information
152159
153160
To make progress on the request, please answer the following questions, including necessary reasoning:
154-
- Is the request fully satisfied? (True if complete, or False if the original request has yet to be SUCCESSFULLY and FULLY addressed)
161+
- Is the request fully satisfied? (True if the requested work is complete and enough information is available to provide the final answer. A verified negative or empty result, such as confirming that a requested resource does not exist, can fully satisfy the request. False if work remains or if a negative or empty result may be caused by an execution, authorization, connectivity, or investigation failure.)
155162
- Are we in a loop where we are repeating the same requests and / or getting the same responses from an agent multiple times? Loops can span multiple turns, and can include repeated actions like scrolling up or down more than a handful of times.
156163
- Are we making forward progress? (True if just starting, or recent messages are adding value. False if recent messages show evidence of being stuck in a loop or if there is evidence of significant barriers to success such as the inability to read from a required file)
157164
- Who should speak next? (select from: KnowledgeAgent, CoderAgent, WeatherAgent)

0 commit comments

Comments
 (0)