You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

IHistoryTransform.cs 819 B

12345678910111213141516171819202122232425
  1. using LLama.Common;
  2. namespace LLama.Abstractions
  3. {
  4. /// <summary>
  5. /// Transform history to plain text and vice versa.
  6. /// </summary>
  7. public interface IHistoryTransform
  8. {
  9. /// <summary>
  10. /// Convert a ChatHistory instance to plain text.
  11. /// </summary>
  12. /// <param name="history">The ChatHistory instance</param>
  13. /// <returns></returns>
  14. string HistoryToText(ChatHistory history);
  15. /// <summary>
  16. /// Converts plain text to a ChatHistory instance.
  17. /// </summary>
  18. /// <param name="role">The role for the author.</param>
  19. /// <param name="text">The chat history as plain text.</param>
  20. /// <returns>The updated history.</returns>
  21. ChatHistory TextToHistory(AuthorRole role, string text);
  22. }
  23. }