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.common.chathistory.md 970 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # ChatHistory
  2. Namespace: LLama.Common
  3. The chat history class
  4. ```csharp
  5. public class ChatHistory
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [ChatHistory](./llama.common.chathistory.md)
  8. ## Properties
  9. ### **Messages**
  10. List of messages in the chat
  11. ```csharp
  12. public List<Message> Messages { get; }
  13. ```
  14. #### Property Value
  15. [List&lt;Message&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1)<br>
  16. ## Constructors
  17. ### **ChatHistory()**
  18. Create a new instance of the chat content class
  19. ```csharp
  20. public ChatHistory()
  21. ```
  22. ## Methods
  23. ### **AddMessage(AuthorRole, String)**
  24. Add a message to the chat history
  25. ```csharp
  26. public void AddMessage(AuthorRole authorRole, string content)
  27. ```
  28. #### Parameters
  29. `authorRole` [AuthorRole](./llama.common.authorrole.md)<br>
  30. Role of the message author
  31. `content` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  32. Message content