mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
* Builds locally and tests pass * Fix typo * Reverted nuget config change to remove internal feed and map to new public object model package with renames. * Renaming Bot object model in additional sample. --------- Co-authored-by: Peter Ibekwe <peibekwe@microsoft.com>
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System.Collections.Frozen;
|
|
using System.Collections.Generic;
|
|
using Microsoft.Agents.ObjectModel;
|
|
using Microsoft.Extensions.AI;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen;
|
|
|
|
internal partial class AddConversationMessageTemplate
|
|
{
|
|
public AddConversationMessageTemplate(AddConversationMessage model)
|
|
{
|
|
this.Model = this.Initialize(model);
|
|
this.Message = this.Model.Message?.Path;
|
|
this.UseAgentProvider = true;
|
|
}
|
|
|
|
public AddConversationMessage Model { get; }
|
|
|
|
public PropertyPath? Message { get; }
|
|
|
|
public const string DefaultRole = nameof(ChatRole.User);
|
|
|
|
public static readonly FrozenDictionary<AgentMessageRoleWrapper, string> RoleMap =
|
|
new Dictionary<AgentMessageRoleWrapper, string>()
|
|
{
|
|
[AgentMessageRoleWrapper.Get(AgentMessageRole.User)] = nameof(ChatRole.User),
|
|
[AgentMessageRoleWrapper.Get(AgentMessageRole.Agent)] = nameof(ChatRole.Assistant),
|
|
}.ToFrozenDictionary();
|
|
}
|