Merge branch 'SciSharp:master' into master

This commit is contained in:
hchen2020 2023-10-25 19:31:00 -05:00 committed by GitHub
commit 7482339e02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -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}";

View file

@ -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 %}