File tree Expand file tree Collapse file tree
Infrastructure/BotSharp.Core/Routing
WebStarter/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,15 +56,24 @@ public async Task<FunctionCallFromLlm> GetNextInstruction()
5656 model : _settings . Model ) ;
5757
5858 int retryCount = 0 ;
59+ var agentService = _services . GetRequiredService < IAgentService > ( ) ;
5960
6061 while ( retryCount < 3 )
6162 {
6263 try
6364 {
6465 var conversation = "" ;
66+
6567 foreach ( var dialog in _dialogs . TakeLast ( 20 ) )
6668 {
67- conversation += $ "{ dialog . Role } : { dialog . Content } \r \n ";
69+ var role = dialog . Role ;
70+ if ( role != AgentRole . User )
71+ {
72+ var agent = await agentService . GetAgent ( dialog . CurrentAgentId ) ;
73+ role = agent . Name ;
74+ }
75+
76+ conversation += $ "{ role } : { dialog . Content } \r \n ";
6877 }
6978 content = $ "{ conversation } \r \n ###\r \n { content } ";
7079
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ You're {{router.name}} ({{router.description}}). Follow these steps to handle us
332. Select a appropriate function from [FUNCTIONS].
443. Determine which agent is suitable to handle this conversation.
554. Re-think about the selected function or agent is the best choice.
6- 5. For agent required arguments, leave it blank if user doesn't provide it.
6+ 5. For agent required arguments, leave it as blank object if user doesn't provide it.
77
88[FUNCTIONS]
99{% for handler in routing_handlers %}
You can’t perform that action at this time.
0 commit comments