diff --git a/src/Infrastructure/BotSharp.Core/Routing/Reasoning/NaiveReasoner.cs b/src/Infrastructure/BotSharp.Core/Routing/Reasoning/NaiveReasoner.cs index 39e8be430..8f0865397 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/Reasoning/NaiveReasoner.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/Reasoning/NaiveReasoner.cs @@ -104,7 +104,8 @@ private string GetNextStepPrompt(Agent router) return render.Render(template, new Dictionary { { StateConst.EXPECTED_ACTION_AGENT, states.GetState(StateConst.EXPECTED_ACTION_AGENT) }, - { StateConst.EXPECTED_GOAL_AGENT, states.GetState(StateConst.EXPECTED_GOAL_AGENT) } + { StateConst.EXPECTED_GOAL_AGENT, states.GetState(StateConst.EXPECTED_GOAL_AGENT) }, + { StateConst.USER_GOAL_AGENT, states.GetState(StateConst.USER_GOAL_AGENT) } }); } } diff --git a/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/templates/reasoner.naive.liquid b/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/templates/reasoner.naive.liquid index 396a4449d..257b770cd 100644 --- a/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/templates/reasoner.naive.liquid +++ b/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/templates/reasoner.naive.liquid @@ -10,5 +10,5 @@ If the user only provides requested information, keep the previous next action a Expected user goal agent is {{ expected_user_goal_agent }}. {%- else -%} User goal agent is inferred from the user's active goal. -Keep the existing user goal agent unless the latest user message explicitly starts a different task or workflow. +Keep the existing user goal agent{% if user_goal_agent != blank %} ({{ user_goal_agent }}){% endif %} unless the latest user message explicitly starts a different task or workflow. {%- endif %} \ No newline at end of file