Class RealtimeResponse
-
- All Implemented Interfaces:
public final class RealtimeResponse
The response resource.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
RealtimeResponse.Builder
A builder for RealtimeResponse.
public final class
RealtimeResponse.MaxOutputTokens
Maximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response.
public final class
RealtimeResponse.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.
public final class
RealtimeResponse.Modality
public final class
RealtimeResponse.Object
The object type, must be
realtime.response
.public final class
RealtimeResponse.OutputAudioFormat
The format of output audio. Options are
pcm16
,g711_ulaw
, org711_alaw
.public final class
RealtimeResponse.Status
The final status of the response (
completed
,cancelled
,failed
, orincomplete
,in_progress
).public final class
RealtimeResponse.Voice
The voice the model used to respond. Current voice options are
alloy
,ash
,ballad
,coral
,echo
,fable
,onyx
,nova
,sage
,shimmer
, andverse
.
-
Method Summary
Modifier and Type Method Description final Optional<String>
id()
The unique ID of the response. final Optional<String>
conversationId()
Which conversation the response is added to, determined by the conversation
field in theresponse.create
event.final Optional<RealtimeResponse.MaxOutputTokens>
maxOutputTokens()
Maximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response. final Optional<RealtimeResponse.Metadata>
metadata()
Set of 16 key-value pairs that can be attached to an object. final Optional<List<RealtimeResponse.Modality>>
modalities()
The set of modalities the model used to respond. final Optional<RealtimeResponse.Object>
object_()
The object type, must be realtime.response
.final Optional<List<ConversationItem>>
output()
The list of output items generated by the response. final Optional<RealtimeResponse.OutputAudioFormat>
outputAudioFormat()
The format of output audio. final Optional<RealtimeResponse.Status>
status()
The final status of the response ( completed
,cancelled
,failed
, orincomplete
,in_progress
).final Optional<RealtimeResponseStatus>
statusDetails()
Additional details about the status. final Optional<Double>
temperature()
Sampling temperature for the model, limited to 0.6, 1. final Optional<RealtimeResponseUsage>
usage()
Usage statistics for the Response, this will correspond to billing. final Optional<RealtimeResponse.Voice>
voice()
The voice the model used to respond. final JsonField<String>
_id()
Returns the raw JSON value of id. final JsonField<String>
_conversationId()
Returns the raw JSON value of conversationId. final JsonField<RealtimeResponse.MaxOutputTokens>
_maxOutputTokens()
Returns the raw JSON value of maxOutputTokens. final JsonField<RealtimeResponse.Metadata>
_metadata()
Returns the raw JSON value of metadata. final JsonField<List<RealtimeResponse.Modality>>
_modalities()
Returns the raw JSON value of modalities. final JsonField<RealtimeResponse.Object>
_object_()
Returns the raw JSON value of object_. final JsonField<List<ConversationItem>>
_output()
Returns the raw JSON value of output. final JsonField<RealtimeResponse.OutputAudioFormat>
_outputAudioFormat()
Returns the raw JSON value of outputAudioFormat. final JsonField<RealtimeResponse.Status>
_status()
Returns the raw JSON value of status. final JsonField<RealtimeResponseStatus>
_statusDetails()
Returns the raw JSON value of statusDetails. final JsonField<Double>
_temperature()
Returns the raw JSON value of temperature. final JsonField<RealtimeResponseUsage>
_usage()
Returns the raw JSON value of usage. final JsonField<RealtimeResponse.Voice>
_voice()
Returns the raw JSON value of voice. final Map<String, JsonValue>
_additionalProperties()
final RealtimeResponse.Builder
toBuilder()
final RealtimeResponse
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static RealtimeResponse.Builder
builder()
Returns a mutable builder for constructing an instance of RealtimeResponse. -
-
Method Detail
-
conversationId
final Optional<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
.
-
maxOutputTokens
final Optional<RealtimeResponse.MaxOutputTokens> maxOutputTokens()
Maximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response.
-
metadata
final Optional<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.
-
modalities
final Optional<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.
-
object_
final Optional<RealtimeResponse.Object> object_()
The object type, must be
realtime.response
.
-
output
final Optional<List<ConversationItem>> output()
The list of output items generated by the response.
-
outputAudioFormat
final Optional<RealtimeResponse.OutputAudioFormat> outputAudioFormat()
The format of output audio. Options are
pcm16
,g711_ulaw
, org711_alaw
.
-
status
final Optional<RealtimeResponse.Status> status()
The final status of the response (
completed
,cancelled
,failed
, orincomplete
,in_progress
).
-
statusDetails
final Optional<RealtimeResponseStatus> statusDetails()
Additional details about the status.
-
temperature
final Optional<Double> temperature()
Sampling temperature for the model, limited to 0.6, 1.2. Defaults to 0.8.
-
usage
final Optional<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.
-
voice
final Optional<RealtimeResponse.Voice> voice()
The voice the model used to respond. Current voice options are
alloy
,ash
,ballad
,coral
,echo
,fable
,onyx
,nova
,sage
,shimmer
, andverse
.
-
_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.
-
_conversationId
final JsonField<String> _conversationId()
Returns the raw JSON value of conversationId.
Unlike conversationId, this method doesn't throw if the JSON field has an unexpected type.
-
_maxOutputTokens
final JsonField<RealtimeResponse.MaxOutputTokens> _maxOutputTokens()
Returns the raw JSON value of maxOutputTokens.
Unlike maxOutputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_metadata
final JsonField<RealtimeResponse.Metadata> _metadata()
Returns the raw JSON value of metadata.
Unlike metadata, this method doesn't throw if the JSON field has an unexpected type.
-
_modalities
final JsonField<List<RealtimeResponse.Modality>> _modalities()
Returns the raw JSON value of modalities.
Unlike modalities, this method doesn't throw if the JSON field has an unexpected type.
-
_object_
final JsonField<RealtimeResponse.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<List<ConversationItem>> _output()
Returns the raw JSON value of output.
Unlike output, this method doesn't throw if the JSON field has an unexpected type.
-
_outputAudioFormat
final JsonField<RealtimeResponse.OutputAudioFormat> _outputAudioFormat()
Returns the raw JSON value of outputAudioFormat.
Unlike outputAudioFormat, this method doesn't throw if the JSON field has an unexpected type.
-
_status
final JsonField<RealtimeResponse.Status> _status()
Returns the raw JSON value of status.
Unlike status, this method doesn't throw if the JSON field has an unexpected type.
-
_statusDetails
final JsonField<RealtimeResponseStatus> _statusDetails()
Returns the raw JSON value of statusDetails.
Unlike statusDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_temperature
final JsonField<Double> _temperature()
Returns the raw JSON value of temperature.
Unlike temperature, this method doesn't throw if the JSON field has an unexpected type.
-
_usage
final JsonField<RealtimeResponseUsage> _usage()
Returns the raw JSON value of usage.
Unlike usage, this method doesn't throw if the JSON field has an unexpected type.
-
_voice
final JsonField<RealtimeResponse.Voice> _voice()
Returns the raw JSON value of voice.
Unlike voice, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final RealtimeResponse.Builder toBuilder()
-
validate
final RealtimeResponse validate()
-
builder
final static RealtimeResponse.Builder builder()
Returns a mutable builder for constructing an instance of RealtimeResponse.
-
-
-
-