Skip to content

Commit 74862eb

Browse files
authored
Merge pull request #544 from hchen2020/master
remove function return appended to dialogs.
2 parents 2d15f29 + 7d66c2d commit 74862eb

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

src/Infrastructure/BotSharp.Abstraction/Conversations/Models/RoleDialogModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public override string ToString()
110110
{
111111
if (Role == AgentRole.Function)
112112
{
113-
return $"{Role}: {FunctionName}({FunctionArgs}) => {Content}";
113+
return $"{Role}: {Content} <= {FunctionName}({FunctionArgs})";
114114
}
115115
else
116116
{

src/Infrastructure/BotSharp.Core/Routing/Functions/RouteToAgentFn.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ public async Task<bool> Execute(RoleDialogModel message)
8989
// Stack redirection agent
9090
_context.Push(agentId, reason: $"REDIRECTION {reason}");
9191
message.Content = reason;
92-
message.Role = AgentRole.Function;
9392
}
9493
}
9594

src/Infrastructure/BotSharp.Core/Routing/Handlers/RouteToAgentRoutingHandler.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,8 @@ await hook.OnNewTaskDetected(message, inst.NextActionReason)
5959
message.FunctionArgs = JsonSerializer.Serialize(inst);
6060
if (message.FunctionName != null)
6161
{
62-
var msg = RoleDialogModel.From(message);
62+
var msg = RoleDialogModel.From(message, role: AgentRole.Function);
6363
var ret = await routing.InvokeFunction(message.FunctionName, msg);
64-
if (msg.Role == AgentRole.Function)
65-
{
66-
_dialogs.Add(msg);
67-
}
6864
}
6965

7066
var agentId = routing.Context.GetCurrentAgentId();

0 commit comments

Comments
 (0)