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.

llama.abstractions.ihistorytransform.md 1.1 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # IHistoryTransform
  2. Namespace: LLama.Abstractions
  3. Transform history to plain text and vice versa.
  4. ```csharp
  5. public interface IHistoryTransform
  6. ```
  7. ## Methods
  8. ### **HistoryToText(ChatHistory)**
  9. Convert a ChatHistory instance to plain text.
  10. ```csharp
  11. string HistoryToText(ChatHistory history)
  12. ```
  13. #### Parameters
  14. `history` [ChatHistory](./llama.common.chathistory.md)<br>
  15. The ChatHistory instance
  16. #### Returns
  17. [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  18. ### **TextToHistory(AuthorRole, String)**
  19. Converts plain text to a ChatHistory instance.
  20. ```csharp
  21. ChatHistory TextToHistory(AuthorRole role, string text)
  22. ```
  23. #### Parameters
  24. `role` [AuthorRole](./llama.common.authorrole.md)<br>
  25. The role for the author.
  26. `text` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  27. The chat history as plain text.
  28. #### Returns
  29. [ChatHistory](./llama.common.chathistory.md)<br>
  30. The updated history.
  31. ### **Clone()**
  32. Copy the transform.
  33. ```csharp
  34. IHistoryTransform Clone()
  35. ```
  36. #### Returns
  37. [IHistoryTransform](./llama.abstractions.ihistorytransform.md)<br>