Class ConversationItem.Builder
-
- All Implemented Interfaces:
public final class ConversationItem.Builder
A builder for ConversationItem.
-
-
Method Summary
Modifier and Type Method Description final ConversationItem.Builder
id(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 ConversationItem.Builder
id(JsonField<String> id)
Sets Builder.id to an arbitrary JSON value. final ConversationItem.Builder
arguments(String arguments)
The arguments of the function call (for function_call
items).final ConversationItem.Builder
arguments(JsonField<String> arguments)
Sets Builder.arguments to an arbitrary JSON value. final ConversationItem.Builder
callId(String callId)
The ID of the function call (for function_call
andfunction_call_output
items).final ConversationItem.Builder
callId(JsonField<String> callId)
Sets Builder.callId to an arbitrary JSON value. final ConversationItem.Builder
content(List<ConversationItemContent> content)
The content of the message, applicable for message
items.final ConversationItem.Builder
content(JsonField<List<ConversationItemContent>> content)
Sets Builder.content to an arbitrary JSON value. final ConversationItem.Builder
addContent(ConversationItemContent content)
Adds a single ConversationItemContent to Builder.content. final ConversationItem.Builder
name(String name)
The name of the function being called (for function_call
items).final ConversationItem.Builder
name(JsonField<String> name)
Sets Builder.name to an arbitrary JSON value. final ConversationItem.Builder
object_(ConversationItem.Object object_)
Identifier for the API object being returned - always realtime.item
.final ConversationItem.Builder
object_(JsonField<ConversationItem.Object> object_)
Sets Builder.object_ to an arbitrary JSON value. final ConversationItem.Builder
output(String output)
The output of the function call (for function_call_output
items).final ConversationItem.Builder
output(JsonField<String> output)
Sets Builder.output to an arbitrary JSON value. final ConversationItem.Builder
role(ConversationItem.Role role)
The role of the message sender ( user
,assistant
,system
), only applicable formessage
items.final ConversationItem.Builder
role(JsonField<ConversationItem.Role> role)
Sets Builder.role to an arbitrary JSON value. final ConversationItem.Builder
status(ConversationItem.Status status)
The status of the item ( completed
,incomplete
,in_progress
).final ConversationItem.Builder
status(JsonField<ConversationItem.Status> status)
Sets Builder.status to an arbitrary JSON value. final ConversationItem.Builder
type(ConversationItem.Type type)
The type of the item ( message
,function_call
,function_call_output
).final ConversationItem.Builder
type(JsonField<ConversationItem.Type> type)
Sets Builder.type to an arbitrary JSON value. final ConversationItem.Builder
additionalProperties(Map<String, JsonValue> additionalProperties)
final ConversationItem.Builder
putAdditionalProperty(String key, JsonValue value)
final ConversationItem.Builder
putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
final ConversationItem.Builder
removeAdditionalProperty(String key)
final ConversationItem.Builder
removeAllAdditionalProperties(Set<String> keys)
final ConversationItem
build()
Returns an immutable instance of ConversationItem. -
-
Method Detail
-
id
final ConversationItem.Builder id(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.
-
id
final ConversationItem.Builder id(JsonField<String> id)
Sets Builder.id to an arbitrary JSON value.
You should usually call Builder.id with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
arguments
final ConversationItem.Builder arguments(String arguments)
The arguments of the function call (for
function_call
items).
-
arguments
final ConversationItem.Builder arguments(JsonField<String> arguments)
Sets Builder.arguments to an arbitrary JSON value.
You should usually call Builder.arguments with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
callId
final ConversationItem.Builder callId(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.
-
callId
final ConversationItem.Builder callId(JsonField<String> callId)
Sets Builder.callId to an arbitrary JSON value.
You should usually call Builder.callId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
content
final ConversationItem.Builder content(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.
-
content
final ConversationItem.Builder content(JsonField<List<ConversationItemContent>> content)
Sets Builder.content to an arbitrary JSON value.
You should usually call Builder.content with a well-typed
List<ConversationItemContent>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addContent
final ConversationItem.Builder addContent(ConversationItemContent content)
Adds a single ConversationItemContent to Builder.content.
-
name
final ConversationItem.Builder name(String name)
The name of the function being called (for
function_call
items).
-
name
final ConversationItem.Builder name(JsonField<String> name)
Sets Builder.name to an arbitrary JSON value.
You should usually call Builder.name with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
object_
final ConversationItem.Builder object_(ConversationItem.Object object_)
Identifier for the API object being returned - always
realtime.item
.
-
object_
final ConversationItem.Builder object_(JsonField<ConversationItem.Object> object_)
Sets Builder.object_ to an arbitrary JSON value.
You should usually call Builder.object_ with a well-typed Object value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
output
final ConversationItem.Builder output(String output)
The output of the function call (for
function_call_output
items).
-
output
final ConversationItem.Builder output(JsonField<String> output)
Sets Builder.output to an arbitrary JSON value.
You should usually call Builder.output with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
role
final ConversationItem.Builder role(ConversationItem.Role role)
The role of the message sender (
user
,assistant
,system
), only applicable formessage
items.
-
role
final ConversationItem.Builder role(JsonField<ConversationItem.Role> role)
Sets Builder.role to an arbitrary JSON value.
You should usually call Builder.role with a well-typed Role value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
status
final ConversationItem.Builder status(ConversationItem.Status status)
The status of the item (
completed
,incomplete
,in_progress
). These have no effect on the conversation, but are accepted for consistency with theconversation.item.created
event.
-
status
final ConversationItem.Builder status(JsonField<ConversationItem.Status> status)
Sets Builder.status to an arbitrary JSON value.
You should usually call Builder.status with a well-typed Status value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
type
final ConversationItem.Builder type(ConversationItem.Type type)
The type of the item (
message
,function_call
,function_call_output
).
-
type
final ConversationItem.Builder type(JsonField<ConversationItem.Type> type)
Sets Builder.type to an arbitrary JSON value.
You should usually call Builder.type with a well-typed Type value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final ConversationItem.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final ConversationItem.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final ConversationItem.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final ConversationItem.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final ConversationItem.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final ConversationItem build()
Returns an immutable instance of ConversationItem.
Further updates to this Builder will not mutate the returned instance.
-
-
-
-