mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Fixed (#2190)
This commit is contained in:
+6
@@ -19,6 +19,7 @@ internal sealed class AddConversationMessageExecutor(AddConversationMessage mode
|
||||
{
|
||||
Throw.IfNull(this.Model.ConversationId, $"{nameof(this.Model)}.{nameof(this.Model.ConversationId)}");
|
||||
string conversationId = this.Evaluator.GetValue(this.Model.ConversationId).Value;
|
||||
bool isWorkflowConversation = context.IsWorkflowConversation(conversationId, out string? _);
|
||||
|
||||
ChatMessage newMessage = new(this.Model.Role.Value.ToChatRole(), [.. this.GetContent()]) { AdditionalProperties = this.GetMetadata() };
|
||||
|
||||
@@ -27,6 +28,11 @@ internal sealed class AddConversationMessageExecutor(AddConversationMessage mode
|
||||
|
||||
await this.AssignAsync(this.Model.Message?.Path, newMessage.ToRecord(), context).ConfigureAwait(false);
|
||||
|
||||
if (isWorkflowConversation)
|
||||
{
|
||||
await context.AddEventAsync(new AgentRunResponseEvent(this.Id, new AgentRunResponse(newMessage)), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return default;
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -20,6 +20,7 @@ internal sealed class CopyConversationMessagesExecutor(CopyConversationMessages
|
||||
{
|
||||
Throw.IfNull(this.Model.ConversationId, $"{nameof(this.Model)}.{nameof(this.Model.ConversationId)}");
|
||||
string conversationId = this.Evaluator.GetValue(this.Model.ConversationId).Value;
|
||||
bool isWorkflowConversation = context.IsWorkflowConversation(conversationId, out string? _);
|
||||
|
||||
IEnumerable<ChatMessage>? inputMessages = this.GetInputMessages();
|
||||
|
||||
@@ -29,6 +30,11 @@ internal sealed class CopyConversationMessagesExecutor(CopyConversationMessages
|
||||
{
|
||||
await agentProvider.CreateMessageAsync(conversationId, message, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (isWorkflowConversation)
|
||||
{
|
||||
await context.AddEventAsync(new AgentRunResponseEvent(this.Id, new AgentRunResponse([.. inputMessages])), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
return default;
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
"conversation_count": 2,
|
||||
"min_action_count": 8,
|
||||
"min_message_count": 1,
|
||||
"min_response_count": 0,
|
||||
"min_response_count": 1,
|
||||
"actions": {
|
||||
"start": [
|
||||
"conversation_create1",
|
||||
|
||||
Reference in New Issue
Block a user