Class ConversationItem
-
- All Implemented Interfaces:
public final class ConversationItem
The item to add to the conversation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ConversationItem.Builder
A builder for ConversationItem.
public final class
ConversationItem.Object
Identifier for the API object being returned - always
realtime.item
.public final class
ConversationItem.Role
The role of the message sender (
user
,assistant
,system
), only applicable formessage
items.public final class
ConversationItem.Status
The status of the item (
completed
,incomplete
). These have no effect on the conversation, but are accepted for consistency with theconversation.item.created
event.public final class
ConversationItem.Type
The type of the item (
message
,function_call
,function_call_output
).
-
Method Summary
Modifier and Type Method Description final Optional<String>
id()
The unique ID of the item, this can be generated by the client to help manage server-side context, but is not required because the server will generate one if not provided. final Optional<String>
arguments()
The arguments of the function call (for function_call
items).final Optional<String>
callId()
The ID of the function call (for function_call
andfunction_call_output
items).final Optional<List<ConversationItemContent>>
content()
The content of the message, applicable for message
items.final Optional<String>
name()
The name of the function being called (for function_call
items).final Optional<ConversationItem.Object>
object_()
Identifier for the API object being returned - always realtime.item
.final Optional<String>
output()
The output of the function call (for function_call_output
items).final Optional<ConversationItem.Role>
role()
The role of the message sender ( user
,assistant
,system
), only applicable formessage
items.final Optional<ConversationItem.Status>
status()
The status of the item ( completed
,incomplete
).final Optional<ConversationItem.Type>
type()
The type of the item ( message
,function_call
,function_call_output
).final JsonField<String>
_id()
Returns the raw JSON value of id. final JsonField<String>
_arguments()
Returns the raw JSON value of arguments. final JsonField<String>
_callId()
Returns the raw JSON value of callId. final JsonField<List<ConversationItemContent>>
_content()
Returns the raw JSON value of content. final JsonField<String>
_name()
Returns the raw JSON value of name. final JsonField<ConversationItem.Object>
_object_()
Returns the raw JSON value of object_. final JsonField<String>
_output()
Returns the raw JSON value of output. final JsonField<ConversationItem.Role>
_role()
Returns the raw JSON value of role. final JsonField<ConversationItem.Status>
_status()
Returns the raw JSON value of status. final JsonField<ConversationItem.Type>
_type()
Returns the raw JSON value of type. final Map<String, JsonValue>
_additionalProperties()
final ConversationItem.Builder
toBuilder()
final ConversationItem
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ConversationItem.Builder
builder()
Returns a mutable builder for constructing an instance of ConversationItem. -
-
Method Detail
-
id
final Optional<String> id()
The unique ID of the item, this can be generated by the client to help manage server-side context, but is not required because the server will generate one if not provided.
-
arguments
final Optional<String> arguments()
The arguments of the function call (for
function_call
items).
-
callId
final Optional<String> callId()
The ID of the function call (for
function_call
andfunction_call_output
items). If passed on afunction_call_output
item, the server will check that afunction_call
item with the same ID exists in the conversation history.
-
content
final Optional<List<ConversationItemContent>> content()
The content of the message, applicable for
message
items.Message items of role
system
support onlyinput_text
contentMessage items of role
user
supportinput_text
andinput_audio
contentMessage items of role
assistant
supporttext
content.
-
object_
final Optional<ConversationItem.Object> object_()
Identifier for the API object being returned - always
realtime.item
.
-
output
final Optional<String> output()
The output of the function call (for
function_call_output
items).
-
role
final Optional<ConversationItem.Role> role()
The role of the message sender (
user
,assistant
,system
), only applicable formessage
items.
-
status
final Optional<ConversationItem.Status> status()
The status of the item (
completed
,incomplete
). These have no effect on the conversation, but are accepted for consistency with theconversation.item.created
event.
-
type
final Optional<ConversationItem.Type> type()
The type of the item (
message
,function_call
,function_call_output
).
-
_id
final JsonField<String> _id()
Returns the raw JSON value of id.
Unlike id, this method doesn't throw if the JSON field has an unexpected type.
-
_arguments
final JsonField<String> _arguments()
Returns the raw JSON value of arguments.
Unlike arguments, this method doesn't throw if the JSON field has an unexpected type.
-
_callId
final JsonField<String> _callId()
Returns the raw JSON value of callId.
Unlike callId, this method doesn't throw if the JSON field has an unexpected type.
-
_content
final JsonField<List<ConversationItemContent>> _content()
Returns the raw JSON value of content.
Unlike content, this method doesn't throw if the JSON field has an unexpected type.
-
_name
final JsonField<String> _name()
Returns the raw JSON value of name.
Unlike name, this method doesn't throw if the JSON field has an unexpected type.
-
_object_
final JsonField<ConversationItem.Object> _object_()
Returns the raw JSON value of object_.
Unlike object_, this method doesn't throw if the JSON field has an unexpected type.
-
_output
final JsonField<String> _output()
Returns the raw JSON value of output.
Unlike output, this method doesn't throw if the JSON field has an unexpected type.
-
_role
final JsonField<ConversationItem.Role> _role()
Returns the raw JSON value of role.
Unlike role, this method doesn't throw if the JSON field has an unexpected type.
-
_status
final JsonField<ConversationItem.Status> _status()
Returns the raw JSON value of status.
Unlike status, this method doesn't throw if the JSON field has an unexpected type.
-
_type
final JsonField<ConversationItem.Type> _type()
Returns the raw JSON value of type.
Unlike type, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final ConversationItem.Builder toBuilder()
-
validate
final ConversationItem validate()
-
builder
final static ConversationItem.Builder builder()
Returns a mutable builder for constructing an instance of ConversationItem.
-
-
-
-