using System.Collections.Generic;
namespace LLama.Common
{
///
/// Role of the message author, e.g. user/assistant/system
///
public enum AuthorRole
{
///
/// Role is unknown
///
Unknown = -1,
///
/// Message comes from a "system" prompt, not written by a user or language model
///
System = 0,
///
/// Message comes from the user
///
User = 1,
///
/// Messages was generated by the language model
///
Assistant = 2,
}
// copy from semantic-kernel
///
/// The chat history class
///
public class ChatHistory
{
///
/// Chat message representation
///
public class Message
{
///
/// Role of the message author, e.g. user/assistant/system
///
public AuthorRole AuthorRole { get; set; }
///
/// Message content
///
public string Content { get; set; }
///
/// Create a new instance
///
/// Role of message author
/// Message content
public Message(AuthorRole authorRole, string content)
{
this.AuthorRole = authorRole;
this.Content = content;
}
}
///
/// List of messages in the chat
///
public List Messages { get; }
///
/// Create a new instance of the chat content class
///
public ChatHistory()
{
this.Messages = new List();
}
///
/// Add a message to the chat history
///
/// Role of the message author
/// Message content
public void AddMessage(AuthorRole authorRole, string content)
{
this.Messages.Add(new Message(authorRole, content));
}
}
}