ProjectConversationsClient.CreateProjectConversationItemsAsync 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.
Create items in a conversation with the given ID.
public virtual System.Threading.Tasks.Task<System.ClientModel.ClientResult<System.Collections.ObjectModel.ReadOnlyCollection<OpenAI.Responses.ResponseItem>>> CreateProjectConversationItemsAsync(string conversationId, System.Collections.Generic.IEnumerable<OpenAI.Responses.ResponseItem> items, System.Collections.Generic.IEnumerable<OpenAI.Conversations.IncludedConversationItemProperty> include = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateProjectConversationItemsAsync : string * seq<OpenAI.Responses.ResponseItem> * seq<OpenAI.Conversations.IncludedConversationItemProperty> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult<System.Collections.ObjectModel.ReadOnlyCollection<OpenAI.Responses.ResponseItem>>>
override this.CreateProjectConversationItemsAsync : string * seq<OpenAI.Responses.ResponseItem> * seq<OpenAI.Conversations.IncludedConversationItemProperty> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult<System.Collections.ObjectModel.ReadOnlyCollection<OpenAI.Responses.ResponseItem>>>
Public Overridable Function CreateProjectConversationItemsAsync (conversationId As String, items As IEnumerable(Of ResponseItem), Optional include As IEnumerable(Of IncludedConversationItemProperty) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ClientResult(Of ReadOnlyCollection(Of ResponseItem)))
Parameters
- conversationId
- String
The id of the conversation on which the item needs to be created.
- items
- IEnumerable<OpenAI.Responses.ResponseItem>
The items to add to the conversation. You may add up to 20 items at a time.
- include
- IEnumerable<OpenAI.Conversations.IncludedConversationItemProperty>
Additional fields to include in the response.
See the include parameter for listing Conversation items for more information.
- cancellationToken
- CancellationToken
The cancellation token that can be used to cancel the operation.
Returns
Exceptions
conversationId or items is null.
conversationId is an empty string, and was expected to be non-empty.
Service returned a non-success status code.