expected_next_action_agent

This commit is contained in:
Haiping Chen 2024-03-14 23:48:32 -05:00
parent b7a210efec
commit d0e492820f
3 changed files with 10 additions and 6 deletions

View file

@ -10,11 +10,11 @@ public class RouteToAgentRoutingHandler : RoutingHandlerBase, IRoutingHandler
public List<ParameterPropertyDef> Parameters => new List<ParameterPropertyDef>
{
new ParameterPropertyDef("next_action_reason", "the reason why route to this agent")
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")
{
Required = true
},
new ParameterPropertyDef("next_action_agent", "agent for next action based on user latest response")
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")
{
Required = true
},

View file

@ -116,7 +116,7 @@ public class NaivePlanner : IPlaner
var render = _services.GetRequiredService<ITemplateRender>();
return render.Render(template, new Dictionary<string, object>
{
{ "next_action_agent", states.GetState("next_action_agent")}
{ "expected_next_action_agent", states.GetState("expected_next_action_agent")}
});
}

View file

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