Class RealtimeResponse.Builder
-
- All Implemented Interfaces:
public final class RealtimeResponse.Builder
A builder for RealtimeResponse.
-
-
Method Summary
-
-
Method Detail
-
id
final RealtimeResponse.Builder id(String id)
The unique ID of the response.
-
id
final RealtimeResponse.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.
-
conversationId
final RealtimeResponse.Builder conversationId(String conversationId)
Which conversation the response is added to, determined by the
conversation
field in theresponse.create
event. Ifauto
, the response will be added to the default conversation and the value ofconversation_id
will be an id likeconv_1234
. Ifnone
, the response will not be added to any conversation and the value ofconversation_id
will benull
. If responses are being triggered by server VAD, the response will be added to the default conversation, thus theconversation_id
will be an id likeconv_1234
.
-
conversationId
final RealtimeResponse.Builder conversationId(JsonField<String> conversationId)
Sets Builder.conversationId to an arbitrary JSON value.
You should usually call Builder.conversationId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
maxOutputTokens
final RealtimeResponse.Builder maxOutputTokens(RealtimeResponse.MaxOutputTokens maxOutputTokens)
Maximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response.
-
maxOutputTokens
final RealtimeResponse.Builder maxOutputTokens(JsonField<RealtimeResponse.MaxOutputTokens> maxOutputTokens)
Sets Builder.maxOutputTokens to an arbitrary JSON value.
You should usually call Builder.maxOutputTokens with a well-typed MaxOutputTokens value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
maxOutputTokens
final RealtimeResponse.Builder maxOutputTokens(Long integer)
Alias for calling maxOutputTokens with
MaxOutputTokens.ofInteger(integer)
.
-
maxOutputTokensInf
final RealtimeResponse.Builder maxOutputTokensInf()
Alias for calling maxOutputTokens with
MaxOutputTokens.ofInf()
.
-
metadata
final RealtimeResponse.Builder metadata(RealtimeResponse.Metadata metadata)
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
metadata
final RealtimeResponse.Builder metadata(Optional<RealtimeResponse.Metadata> metadata)
Alias for calling Builder.metadata with
metadata.orElse(null)
.
-
metadata
final RealtimeResponse.Builder metadata(JsonField<RealtimeResponse.Metadata> metadata)
Sets Builder.metadata to an arbitrary JSON value.
You should usually call Builder.metadata with a well-typed Metadata value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
modalities
final RealtimeResponse.Builder modalities(List<RealtimeResponse.Modality> modalities)
The set of modalities the model used to respond. If there are multiple modalities, the model will pick one, for example if
modalities
is["text", "audio"]
, the model could be responding in either text or audio.
-
modalities
final RealtimeResponse.Builder modalities(JsonField<List<RealtimeResponse.Modality>> modalities)
Sets Builder.modalities to an arbitrary JSON value.
You should usually call Builder.modalities with a well-typed
List<Modality>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addModality
final RealtimeResponse.Builder addModality(RealtimeResponse.Modality modality)
Adds a single Modality to modalities.
-
object_
final RealtimeResponse.Builder object_(RealtimeResponse.Object object_)
The object type, must be
realtime.response
.
-
object_
final RealtimeResponse.Builder object_(JsonField<RealtimeResponse.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 RealtimeResponse.Builder output(List<ConversationItem> output)
The list of output items generated by the response.
-
output
final RealtimeResponse.Builder output(JsonField<List<ConversationItem>> output)
Sets Builder.output to an arbitrary JSON value.
You should usually call Builder.output with a well-typed
List<ConversationItem>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addOutput
final RealtimeResponse.Builder addOutput(ConversationItem output)
Adds a single ConversationItem to Builder.output.
-
outputAudioFormat
final RealtimeResponse.Builder outputAudioFormat(RealtimeResponse.OutputAudioFormat outputAudioFormat)
The format of output audio. Options are
pcm16
,g711_ulaw
, org711_alaw
.
-
outputAudioFormat
final RealtimeResponse.Builder outputAudioFormat(JsonField<RealtimeResponse.OutputAudioFormat> outputAudioFormat)
Sets Builder.outputAudioFormat to an arbitrary JSON value.
You should usually call Builder.outputAudioFormat with a well-typed OutputAudioFormat value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
status
final RealtimeResponse.Builder status(RealtimeResponse.Status status)
The final status of the response (
completed
,cancelled
,failed
, orincomplete
,in_progress
).
-
status
final RealtimeResponse.Builder status(JsonField<RealtimeResponse.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.
-
statusDetails
final RealtimeResponse.Builder statusDetails(RealtimeResponseStatus statusDetails)
Additional details about the status.
-
statusDetails
final RealtimeResponse.Builder statusDetails(JsonField<RealtimeResponseStatus> statusDetails)
Sets Builder.statusDetails to an arbitrary JSON value.
You should usually call Builder.statusDetails with a well-typed RealtimeResponseStatus value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
temperature
final RealtimeResponse.Builder temperature(Double temperature)
Sampling temperature for the model, limited to 0.6, 1.2. Defaults to 0.8.
-
temperature
final RealtimeResponse.Builder temperature(JsonField<Double> temperature)
Sets Builder.temperature to an arbitrary JSON value.
You should usually call Builder.temperature with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
usage
final RealtimeResponse.Builder usage(RealtimeResponseUsage usage)
Usage statistics for the Response, this will correspond to billing. A Realtime API session will maintain a conversation context and append new Items to the Conversation, thus output from previous turns (text and audio tokens) will become the input for later turns.
-
usage
final RealtimeResponse.Builder usage(JsonField<RealtimeResponseUsage> usage)
Sets Builder.usage to an arbitrary JSON value.
You should usually call Builder.usage with a well-typed RealtimeResponseUsage value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
voice
final RealtimeResponse.Builder voice(RealtimeResponse.Voice voice)
The voice the model used to respond. Current voice options are
alloy
,ash
,ballad
,coral
,echo
,sage
,shimmer
, andverse
.
-
voice
final RealtimeResponse.Builder voice(JsonField<RealtimeResponse.Voice> voice)
Sets Builder.voice to an arbitrary JSON value.
You should usually call Builder.voice with a well-typed Voice value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
voice
final RealtimeResponse.Builder voice(String value)
Sets voice to an arbitrary String.
You should usually call voice with a well-typed Voice constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final RealtimeResponse.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final RealtimeResponse.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final RealtimeResponse.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final RealtimeResponse.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final RealtimeResponse.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final RealtimeResponse build()
Returns an immutable instance of RealtimeResponse.
Further updates to this Builder will not mutate the returned instance.
-
-
-
-