Skip to content

Commit 010bcf8

Browse files
authored
Merge pull request #343 from hchen2020/master
expected_next_action_agent
2 parents b7a210e + d0e4928 commit 010bcf8

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/Infrastructure/BotSharp.Core/Routing/Handlers/RouteToAgentRoutingHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ public class RouteToAgentRoutingHandler : RoutingHandlerBase, IRoutingHandler
1010

1111
public List<ParameterPropertyDef> Parameters => new List<ParameterPropertyDef>
1212
{
13-
new ParameterPropertyDef("next_action_reason", "the reason why route to this agent")
13+
new ParameterPropertyDef("next_action_reason", "the reason why route to this agent, if user is replying last agent's question, you must route to this agent")
1414
{
1515
Required = true
1616
},
17-
new ParameterPropertyDef("next_action_agent", "agent for next action based on user latest response")
17+
new ParameterPropertyDef("next_action_agent", "agent for next action based on user latest response, if user is replying last agent's question, you must route to this agent")
1818
{
1919
Required = true
2020
},

src/Infrastructure/BotSharp.Core/Routing/Planning/NaivePlanner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private string GetNextStepPrompt(Agent router)
116116
var render = _services.GetRequiredService<ITemplateRender>();
117117
return render.Render(template, new Dictionary<string, object>
118118
{
119-
{ "next_action_agent", states.GetState("next_action_agent")}
119+
{ "expected_next_action_agent", states.GetState("expected_next_action_agent")}
120120
});
121121
}
122122

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
What is the next step based on the CONVERSATION?
2-
If user is replying with agent's question, you must route back to the previous agent {{ next_action_agent }}.
3-
If user wants to speak to customer service, use function human_intervention_needed.
1+
What is the next step based on the CONVERSATION?
2+
Route to the appropriate agent last handled agent based on the context.
3+
{% if expected_next_action_agent != empty -%}
4+
Expected next action agent is {{ expected_next_action_agent }}.
5+
{%- endif %}
6+
Try to keep the User Goal Agent be consistent as previous goal agent.
7+
If user wants to speak to customer service, use function human_intervention_needed.

0 commit comments

Comments
 (0)