Table of Contents

Class ConversationItemCreateRequest

Namespace
OpenAI.Realtime
Assembly
OpenAI-DotNet.dll

Add a new Item to the Conversation's context, including messages, function calls, and function call responses. This event can be used both to populate a "history" of the conversation and to add new items mid-stream, but has the current limitation that it cannot populate assistant audio messages. If successful, the server will respond with a conversation.item.created event, otherwise an error event will be sent.

public sealed class ConversationItemCreateRequest : BaseRealtimeEvent, IClientEvent, IRealtimeEvent
Inheritance
ConversationItemCreateRequest
Implements
Inherited Members

Constructors

ConversationItemCreateRequest()

public ConversationItemCreateRequest()

ConversationItemCreateRequest(ConversationItem, string)

public ConversationItemCreateRequest(ConversationItem item, string previousItemId = null)

Parameters

item ConversationItem
previousItemId string

Properties

EventId

The unique ID of the server event.

[JsonInclude]
[JsonPropertyName("event_id")]
public override string EventId { get; }

Property Value

string

Item

The item to add to the conversation.

[JsonInclude]
[JsonPropertyName("item")]
public ConversationItem Item { get; }

Property Value

ConversationItem

PreviousItemId

The ID of the preceding item after which the new item will be inserted. If not set, the new item will be appended to the end of the conversation. If set, it allows an item to be inserted mid-conversation. If the ID cannot be found, an error will be returned and the item will not be added.

[JsonInclude]
[JsonPropertyName("previous_item_id")]
public string PreviousItemId { get; }

Property Value

string

Type

[JsonInclude]
[JsonPropertyName("type")]
public override string Type { get; protected set; }

Property Value

string