using System;
using System.Collections.Generic;
using System.Text;
namespace LLama.Common
{
public enum AuthorRole
{
Unknown = -1,
System = 0,
User = 1,
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));
}
}
}