Class ConversationItemAdded
-
- All Implemented Interfaces:
public final class ConversationItemAdded
Sent by the server when an Item is added to the default Conversation. This can happen in several cases:
When the client sends a
conversation.item.create
event.When the input audio buffer is committed. In this case the item will be a user message containing the audio from the buffer.
When the model is generating a Response. In this case the
conversation.item.added
event will be sent when the model starts generating a specific Item, and thus it will not yet have any content (andstatus
will bein_progress
).
The event will include the full content of the Item (except when model is generating a Response) except for audio data, which can be retrieved separately with a
conversation.item.retrieve
event if necessary.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ConversationItemAdded.Builder
A builder for ConversationItemAdded.
-
Method Summary
Modifier and Type Method Description final String
eventId()
The unique ID of the server event. final ConversationItem
item()
A single item within a Realtime conversation. final JsonValue
_type()
The event type, must be conversation.item.added
.final Optional<String>
previousItemId()
The ID of the item that precedes this one, if any. 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 ConversationItemAdded.Builder
toBuilder()
final ConversationItemAdded
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ConversationItemAdded.Builder
builder()
Returns a mutable builder for constructing an instance of ConversationItemAdded. -
-
Method Detail
-
item
final ConversationItem item()
A single item within a Realtime conversation.
-
_type
final JsonValue _type()
The event type, must be
conversation.item.added
.Expected to always return the following:
JsonValue.from("conversation.item.added")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
previousItemId
final Optional<String> previousItemId()
The ID of the item that precedes this one, if any. This is used to maintain ordering when items are inserted.
-
_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 ConversationItemAdded.Builder toBuilder()
-
validate
final ConversationItemAdded validate()
-
builder
final static ConversationItemAdded.Builder builder()
Returns a mutable builder for constructing an instance of ConversationItemAdded.
The following fields are required:
.eventId() .item()
-
-
-
-