Class ConversationItemCreatedEvent
-
- All Implemented Interfaces:
public final class ConversationItemCreatedEvent
Returned when a conversation item is created. There are several scenarios that produce this event:
The server is generating a Response, which if successful will produce either one or two Items, which will be of type
message
(roleassistant
) or typefunction_call
.The input audio buffer has been committed, either by the client or the server (in
server_vad
mode). The server will take the content of the input audio buffer and add it to a new user message Item.The client has sent a
conversation.item.create
event to add a new Item to the Conversation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ConversationItemCreatedEvent.Builder
A builder for ConversationItemCreatedEvent.
-
Method Summary
Modifier and Type Method Description final String
eventId()
The unique ID of the server event. final ConversationItem
item()
The item to add to the conversation. final String
previousItemId()
The ID of the preceding item in the Conversation context, allows the client to understand the order of the conversation. final JsonValue
_type()
The event type, must be conversation.item.created
.final JsonField<String>
_eventId()
Returns the raw JSON value of eventId. final JsonField<ConversationItem>
_item()
Returns the raw JSON value of item. final JsonField<String>
_previousItemId()
Returns the raw JSON value of previousItemId. final Map<String, JsonValue>
_additionalProperties()
final ConversationItemCreatedEvent.Builder
toBuilder()
final ConversationItemCreatedEvent
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ConversationItemCreatedEvent.Builder
builder()
Returns a mutable builder for constructing an instance of ConversationItemCreatedEvent. -
-
Method Detail
-
item
final ConversationItem item()
The item to add to the conversation.
-
previousItemId
final String previousItemId()
The ID of the preceding item in the Conversation context, allows the client to understand the order of the conversation.
-
_type
final JsonValue _type()
The event type, must be
conversation.item.created
.Expected to always return the following:
JsonValue.from("conversation.item.created")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_eventId
final JsonField<String> _eventId()
Returns the raw JSON value of eventId.
Unlike eventId, this method doesn't throw if the JSON field has an unexpected type.
-
_item
final JsonField<ConversationItem> _item()
Returns the raw JSON value of item.
Unlike item, this method doesn't throw if the JSON field has an unexpected type.
-
_previousItemId
final JsonField<String> _previousItemId()
Returns the raw JSON value of previousItemId.
Unlike previousItemId, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final ConversationItemCreatedEvent.Builder toBuilder()
-
validate
final ConversationItemCreatedEvent validate()
-
builder
final static ConversationItemCreatedEvent.Builder builder()
Returns a mutable builder for constructing an instance of ConversationItemCreatedEvent.
The following fields are required:
.eventId() .item() .previousItemId()
-
-
-
-