Merge pull request #544 from hchen2020/master

remove function return appended to dialogs.
This commit is contained in:
C. Oceania 2024-07-16 10:16:33 -05:00 committed by GitHub
commit 74862eb029
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2 additions and 7 deletions

View file

@ -110,7 +110,7 @@ public class RoleDialogModel : ITrackableMessage
{
if (Role == AgentRole.Function)
{
return $"{Role}: {FunctionName}({FunctionArgs}) => {Content}";
return $"{Role}: {Content} <= {FunctionName}({FunctionArgs})";
}
else
{

View file

@ -89,7 +89,6 @@ public partial class RouteToAgentFn : IFunctionCallback
// Stack redirection agent
_context.Push(agentId, reason: $"REDIRECTION {reason}");
message.Content = reason;
message.Role = AgentRole.Function;
}
}

View file

@ -59,12 +59,8 @@ public class RouteToAgentRoutingHandler : RoutingHandlerBase, IRoutingHandler
message.FunctionArgs = JsonSerializer.Serialize(inst);
if (message.FunctionName != null)
{
var msg = RoleDialogModel.From(message);
var msg = RoleDialogModel.From(message, role: AgentRole.Function);
var ret = await routing.InvokeFunction(message.FunctionName, msg);
if (msg.Role == AgentRole.Function)
{
_dialogs.Add(msg);
}
}
var agentId = routing.Context.GetCurrentAgentId();