IOpenAIClient.CreateThreadMessageAsync

IOpenAIClient.CreateThreadMessageAsync method

Creates a new message within a thread asynchronously.

public Task<ThreadMessageResponse> CreateThreadMessageAsync(string threadId, 
    ThreadMessageCreateRequest threadMessageRequest, CancellationToken? cancellationToken = default)
ParameterTypeDescription
threadIdStringThe ID of the thread where the message will be created.
threadMessageRequestThreadMessageCreateRequestThe request details for creating the message.
cancellationTokenNullable`1A token to cancel the operation.

Return Value

A task that represents the asynchronous operation. The task result contains the response from the message creation.

Exceptions

exceptioncondition
AIClientExceptionThrown when the thread Id is null or empty.

See Also