using LLama.Common;
using System.Text.Json.Serialization;
namespace LLama.Abstractions
{
///
/// Transform history to plain text and vice versa.
///
[JsonConverter(typeof(PolymorphicJSONConverter))]
public interface IHistoryTransform
{
///
/// Convert a ChatHistory instance to plain text.
///
/// The ChatHistory instance
///
string HistoryToText(ChatHistory history);
///
/// Converts plain text to a ChatHistory instance.
///
/// The role for the author.
/// The chat history as plain text.
/// The updated history.
ChatHistory TextToHistory(AuthorRole role, string text);
///
/// Copy the transform.
///
///
IHistoryTransform Clone();
}
}