ChatHistory Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a history of chat messages from a chat conversation.
public class ChatHistory : System.Collections.Generic.ICollection<Microsoft.SemanticKernel.ChatMessageContent>, System.Collections.Generic.IEnumerable<Microsoft.SemanticKernel.ChatMessageContent>, System.Collections.Generic.IList<Microsoft.SemanticKernel.ChatMessageContent>, System.Collections.Generic.IReadOnlyCollection<Microsoft.SemanticKernel.ChatMessageContent>, System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent>
type ChatHistory = class
interface IList<ChatMessageContent>
interface ICollection<ChatMessageContent>
interface seq<ChatMessageContent>
interface IEnumerable
interface IReadOnlyList<ChatMessageContent>
interface IReadOnlyCollection<ChatMessageContent>
Public Class ChatHistory
Implements ICollection(Of ChatMessageContent), IEnumerable(Of ChatMessageContent), IList(Of ChatMessageContent), IReadOnlyCollection(Of ChatMessageContent), IReadOnlyList(Of ChatMessageContent)
- Inheritance
-
ChatHistory
- Implements
Chat |
Initializes an empty history. |
Chat |
Initializes the history will all of the specified messages. |
Chat |
Creates a new instance of the ChatHistory class with a system message |
Count |
Gets the number of messages in the history. |
Item[Int32] |
Gets or sets the message at the specified index in the history. |
Add(Chat |
Adds a message to the history. |
Add |
Add an assistant message to the chat history |
Add |
|
Add |
|
Add |
Adds the messages to the history. |
Add |
Add a system message to the chat history |
Add |
Add a user message to the chat history |
Add |
Add a user message to the chat history |
Clear() |
Removes all messages from the history. |
Contains(Chat |
Determines whether a message is in the history. |
Copy |
Copies all of the messages in the history to an array, starting at the specified destination array index. |
Index |
Searches for the specified message and returns the index of the first occurrence. |
Insert(Int32, Chat |
Inserts a message into the history at the specified index. |
Remove(Chat |
Removes the first occurrence of the specified message from the history. |
Remove |
Removes the message at the specified index from the history. |
Remove |
Removes a range of messages from the history. |
ICollection<Chat |
Gets a value indicating whether the ICollection<T> is read-only. |
IEnumerable. |
Returns an enumerator that iterates through a collection. |
IEnumerable<Chat |
Returns an enumerator that iterates through the collection. |
To |
Enumeration of chat-history in descending order. |
To |
Asynchronous enumeration of chat-history in descending order. |
Add |
Add a message to the chat history at the end of the streamed message |