Merge branch 'SciSharp:master' into master
This commit is contained in:
commit
7482339e02
|
|
@ -56,15 +56,24 @@ public partial class RoutingService
|
|||
model: _settings.Model);
|
||||
|
||||
int retryCount = 0;
|
||||
var agentService = _services.GetRequiredService<IAgentService>();
|
||||
|
||||
while (retryCount < 3)
|
||||
{
|
||||
try
|
||||
{
|
||||
var conversation = "";
|
||||
|
||||
foreach (var dialog in _dialogs.TakeLast(20))
|
||||
{
|
||||
conversation += $"{dialog.Role}: {dialog.Content}\r\n";
|
||||
var role = dialog.Role;
|
||||
if (role != AgentRole.User)
|
||||
{
|
||||
var agent = await agentService.GetAgent(dialog.CurrentAgentId);
|
||||
role = agent.Name;
|
||||
}
|
||||
|
||||
conversation += $"{role}: {dialog.Content}\r\n";
|
||||
}
|
||||
content = $"{conversation}\r\n###\r\n{content}";
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ You're {{router.name}} ({{router.description}}). Follow these steps to handle us
|
|||
2. Select a appropriate function from [FUNCTIONS].
|
||||
3. Determine which agent is suitable to handle this conversation.
|
||||
4. Re-think about the selected function or agent is the best choice.
|
||||
5. For agent required arguments, leave it blank if user doesn't provide it.
|
||||
5. For agent required arguments, leave it as blank object if user doesn't provide it.
|
||||
|
||||
[FUNCTIONS]
|
||||
{% for handler in routing_handlers %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue