mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET Workflows - Integrate Element Aliasing (#835)
* Checkpoint * Update test workflows * Update workflows/MathChat.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update folder * Cleanup * Signed package version * Rollback nuget.config * Cleanup * Set `ProductContext` * Move product initialization. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
+1
-13
@@ -20,7 +20,7 @@ internal sealed class AddConversationMessageExecutor(AddConversationMessage mode
|
||||
StringExpression conversationExpression = Throw.IfNull(this.Model.ConversationId, $"{nameof(this.Model)}.{nameof(this.Model.ConversationId)}");
|
||||
string conversationId = this.State.Evaluator.GetValue(conversationExpression).Value;
|
||||
|
||||
ChatMessage newMessage = new(this.GetRole(), [.. this.GetContent()]) { AdditionalProperties = this.GetMetadata() };
|
||||
ChatMessage newMessage = new(this.Model.Role.Value.ToChatRole(), [.. this.GetContent()]) { AdditionalProperties = this.GetMetadata() };
|
||||
|
||||
await agentProvider.CreateMessageAsync(conversationId, newMessage, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -41,18 +41,6 @@ internal sealed class AddConversationMessageExecutor(AddConversationMessage mode
|
||||
}
|
||||
}
|
||||
|
||||
private ChatRole GetRole()
|
||||
{
|
||||
if (this.Model.Role is null)
|
||||
{
|
||||
return ChatRole.User;
|
||||
}
|
||||
|
||||
AgentMessageRoleWrapper roleWrapper = this.State.Evaluator.GetValue(this.Model.Role).Value;
|
||||
|
||||
return roleWrapper.Value.ToChatRole();
|
||||
}
|
||||
|
||||
private AdditionalPropertiesDictionary? GetMetadata()
|
||||
{
|
||||
if (this.Model.Metadata is null)
|
||||
|
||||
Reference in New Issue
Block a user