class

OpenAI::RealtimeBetaClientEventConversationItemCreate

Inherits JSON::Serializable < Reference < Object

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.

Constructors

new(event_id : String | Nil = nil, type_value : Hash(String, JSON::Any) = Hash(String, JSON::Any).new, previous_item_id : String | Nil = nil, item : RealtimeConversationItem = RealtimeConversationItemMessageSystem.new)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

event_id

Optional client-generated ID used to identify this event.

Source
event_id=(event_id : String | Nil)

Optional client-generated ID used to identify this event.

Source
item
Source
item=(item : RealtimeConversationItem)
Source
previous_item_id

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 to root, the new item will be added to the beginning of the conversation. If set to an existing ID, 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.

Source
previous_item_id=(previous_item_id : String | Nil)

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 to root, the new item will be added to the beginning of the conversation. If set to an existing ID, 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.

Source
type_value

The event type, must be conversation.item.create.

Source
type_value=(type_value : Hash(String, JSON::Any))

The event type, must be conversation.item.create.

Source