Namespace: LLama.Common
The chat history class
public class ChatHistory
Inheritance Object → ChatHistory
List of messages in the chat
public List<Message> Messages { get; set; }
Create a new instance of the chat content class
public ChatHistory()
Create a new instance of the chat history from array of messages
public ChatHistory(Message[] messageHistory)
messageHistory Message[]
Add a message to the chat history
public void AddMessage(AuthorRole authorRole, string content)
authorRole AuthorRole
Role of the message author
content String
Message content
Serialize the chat history to JSON
public string ToJson()
Deserialize a chat history from JSON
public static ChatHistory FromJson(string json)
json String