OpenAIAssistantAgent.AddChatMessageAsync Method
Definition
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.
Caution
Pass messages directly to Invoke instead. This method will be removed after May 1st 2025.
Adds a message to the specified thread.
[System.Obsolete("Pass messages directly to Invoke instead. This method will be removed after May 1st 2025.")]
public System.Threading.Tasks.Task AddChatMessageAsync(string threadId, Microsoft.SemanticKernel.ChatMessageContent message, System.Threading.CancellationToken cancellationToken = default);
[<System.Obsolete("Pass messages directly to Invoke instead. This method will be removed after May 1st 2025.")>]
member this.AddChatMessageAsync : string * Microsoft.SemanticKernel.ChatMessageContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function AddChatMessageAsync (threadId As String, message As ChatMessageContent, Optional cancellationToken As CancellationToken = Nothing) As Task
Parameters
- threadId
- String
The thread identifier.
- message
- ChatMessageContent
A non-system message to append to the conversation.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
- Attributes
Remarks
This method only supports messages with role = User or Assistant.