Fix router history dialogs.
This commit is contained in:
parent
329aa37e5d
commit
4f6fed56d8
|
|
@ -30,7 +30,7 @@ public class RoleDialogModel : ITrackableMessage
|
|||
public string? SecondaryContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Postback content
|
||||
/// Postback of previous round payload
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonPropertyName("payload")]
|
||||
|
|
@ -131,6 +131,7 @@ public class RoleDialogModel : ITrackableMessage
|
|||
ToolCallId = source.ToolCallId,
|
||||
PostbackFunctionName = source.PostbackFunctionName,
|
||||
RichContent = source.RichContent,
|
||||
Payload = source.Payload,
|
||||
StopCompletion = source.StopCompletion,
|
||||
Instruction = source.Instruction,
|
||||
Data = source.Data,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public partial class ConversationService
|
|||
routing.Context.SetMessageId(_conversationId, message.MessageId);
|
||||
routing.Context.Push(agent.Id, reason: "request started");
|
||||
|
||||
// Save payload
|
||||
// Save payload in order to assign the payload before hook is invoked
|
||||
if (replyMessage != null && !string.IsNullOrEmpty(replyMessage.Payload))
|
||||
{
|
||||
message.Payload = replyMessage.Payload;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,15 @@ public partial class RoutingService
|
|||
role = agent.Name;
|
||||
}
|
||||
|
||||
conversation += $"{role}: {dialog.Payload ?? dialog.Content}\r\n";
|
||||
if (role == AgentRole.User)
|
||||
{
|
||||
conversation += $"{role}: {dialog.Payload ?? dialog.Content}\r\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Assistant reply deosn't need help with payload
|
||||
conversation += $"{role}: {dialog.Content}\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
return conversation;
|
||||
|
|
|
|||
Loading…
Reference in a new issue