Share via


ChatHistoryAgentThread Class

Definition

Represents a conversation thread based on an instance of ChatHistory that is maanged inside this class.

public sealed class ChatHistoryAgentThread : Microsoft.SemanticKernel.Agents.AgentThread
type ChatHistoryAgentThread = class
    inherit AgentThread
Public NotInheritable Class ChatHistoryAgentThread
Inherits AgentThread
Inheritance
ChatHistoryAgentThread

Constructors

ChatHistoryAgentThread()

Initializes a new instance of the ChatHistoryAgentThread class.

ChatHistoryAgentThread(ChatHistory, String)

Initializes a new instance of the ChatHistoryAgentThread class that resumes an existing thread.

Properties

ChatHistory

Gets the underlying ChatHistory object that stores the chat history for this thread.

Id

Gets the id of the current thread.

(Inherited from AgentThread)
IsDeleted

Gets a value indicating whether the thread has been deleted.

(Inherited from AgentThread)

Methods

CreateAsync(CancellationToken)

Creates the thread and returns the thread id.

CreateInternalAsync(CancellationToken)

Creates the thread and returns the thread id. Checks have already been completed in the CreateAsync(CancellationToken) method to ensure that the thread can be created.

(Inherited from AgentThread)
DeleteAsync(CancellationToken)

Deletes the current thread.

(Inherited from AgentThread)
DeleteInternalAsync(CancellationToken)

Deletes the current thread. Checks have already been completed in the DeleteAsync(CancellationToken) method to ensure that the thread can be deleted.

(Inherited from AgentThread)
GetMessagesAsync(CancellationToken)

Asynchronously retrieves all messages in the thread.

OnNewMessageInternalAsync(ChatMessageContent, CancellationToken)

This method is called when a new message has been contributed to the chat by any participant. Checks have already been completed in the Microsoft.SemanticKernel.Agents.AgentThread.OnNewMessageAsync(Microsoft.SemanticKernel.ChatMessageContent,System.Threading.CancellationToken) method to ensure that the thread can be updated.

(Inherited from AgentThread)

Applies to