Class RealtimeSessionCreateResponse
-
- All Implemented Interfaces:
public final class RealtimeSessionCreateResponse
A Realtime session configuration object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
RealtimeSessionCreateResponse.Builder
A builder for RealtimeSessionCreateResponse.
public final class
RealtimeSessionCreateResponse.Audio
Configuration for input and output audio for the session.
public final class
RealtimeSessionCreateResponse.Include
public final class
RealtimeSessionCreateResponse.MaxOutputTokens
Maximum number of output tokens for a single assistant response, inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
inf
for the maximum available tokens for a given model. Defaults toinf
.public final class
RealtimeSessionCreateResponse.OutputModality
public final class
RealtimeSessionCreateResponse.Tool
public final class
RealtimeSessionCreateResponse.Tracing
Configuration options for tracing. Set to null to disable tracing. Once tracing is enabled for a session, the configuration cannot be modified.
auto
will create a trace for the session with default values for the workflow name, group id, and metadata.public final class
RealtimeSessionCreateResponse.TurnDetection
Configuration for turn detection. Can be set to
null
to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.
-
Method Summary
Modifier and Type Method Description final Optional<String>
id()
Unique identifier for the session that looks like sess_1234567890abcdef
.final Optional<RealtimeSessionCreateResponse.Audio>
audio()
Configuration for input and output audio for the session. final Optional<Long>
expiresAt()
Expiration timestamp for the session, in seconds since epoch. final Optional<List<RealtimeSessionCreateResponse.Include>>
include()
Additional fields to include in server outputs. final Optional<String>
instructions()
The default system instructions (i.e. final Optional<RealtimeSessionCreateResponse.MaxOutputTokens>
maxOutputTokens()
Maximum number of output tokens for a single assistant response, inclusive of tool calls. final Optional<String>
model()
The Realtime model used for this session. final Optional<String>
object_()
The object type. final Optional<List<RealtimeSessionCreateResponse.OutputModality>>
outputModalities()
The set of modalities the model can respond with. final Optional<String>
toolChoice()
How the model chooses tools. final Optional<List<RealtimeSessionCreateResponse.Tool>>
tools()
Tools (functions) available to the model. final Optional<RealtimeSessionCreateResponse.Tracing>
tracing()
Configuration options for tracing. final Optional<RealtimeSessionCreateResponse.TurnDetection>
turnDetection()
Configuration for turn detection. final JsonField<String>
_id()
Returns the raw JSON value of id. final JsonField<RealtimeSessionCreateResponse.Audio>
_audio()
Returns the raw JSON value of audio. final JsonField<Long>
_expiresAt()
Returns the raw JSON value of expiresAt. final JsonField<List<RealtimeSessionCreateResponse.Include>>
_include()
Returns the raw JSON value of include. final JsonField<String>
_instructions()
Returns the raw JSON value of instructions. final JsonField<RealtimeSessionCreateResponse.MaxOutputTokens>
_maxOutputTokens()
Returns the raw JSON value of maxOutputTokens. final JsonField<String>
_model()
Returns the raw JSON value of model. final JsonField<String>
_object_()
Returns the raw JSON value of object_. final JsonField<List<RealtimeSessionCreateResponse.OutputModality>>
_outputModalities()
Returns the raw JSON value of outputModalities. final JsonField<String>
_toolChoice()
Returns the raw JSON value of toolChoice. final JsonField<List<RealtimeSessionCreateResponse.Tool>>
_tools()
Returns the raw JSON value of tools. final JsonField<RealtimeSessionCreateResponse.Tracing>
_tracing()
Returns the raw JSON value of tracing. final JsonField<RealtimeSessionCreateResponse.TurnDetection>
_turnDetection()
Returns the raw JSON value of turnDetection. final Map<String, JsonValue>
_additionalProperties()
final RealtimeSessionCreateResponse.Builder
toBuilder()
final RealtimeSessionCreateResponse
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static RealtimeSessionCreateResponse.Builder
builder()
Returns a mutable builder for constructing an instance of RealtimeSessionCreateResponse. -
-
Method Detail
-
id
final Optional<String> id()
Unique identifier for the session that looks like
sess_1234567890abcdef
.
-
audio
final Optional<RealtimeSessionCreateResponse.Audio> audio()
Configuration for input and output audio for the session.
-
expiresAt
final Optional<Long> expiresAt()
Expiration timestamp for the session, in seconds since epoch.
-
include
final Optional<List<RealtimeSessionCreateResponse.Include>> include()
Additional fields to include in server outputs.
item.input_audio_transcription.logprobs
: Include logprobs for input audio transcription.
-
instructions
final Optional<String> instructions()
The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.
Note that the server sets default instructions which will be used if this field is not set and are visible in the
session.created
event at the start of the session.
-
maxOutputTokens
final Optional<RealtimeSessionCreateResponse.MaxOutputTokens> maxOutputTokens()
Maximum number of output tokens for a single assistant response, inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
inf
for the maximum available tokens for a given model. Defaults toinf
.
-
outputModalities
final Optional<List<RealtimeSessionCreateResponse.OutputModality>> outputModalities()
The set of modalities the model can respond with. To disable audio, set this to "text".
-
toolChoice
final Optional<String> toolChoice()
How the model chooses tools. Options are
auto
,none
,required
, or specify a function.
-
tools
final Optional<List<RealtimeSessionCreateResponse.Tool>> tools()
Tools (functions) available to the model.
-
tracing
final Optional<RealtimeSessionCreateResponse.Tracing> tracing()
Configuration options for tracing. Set to null to disable tracing. Once tracing is enabled for a session, the configuration cannot be modified.
auto
will create a trace for the session with default values for the workflow name, group id, and metadata.
-
turnDetection
final Optional<RealtimeSessionCreateResponse.TurnDetection> turnDetection()
Configuration for turn detection. Can be set to
null
to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.
-
_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.
-
_audio
final JsonField<RealtimeSessionCreateResponse.Audio> _audio()
Returns the raw JSON value of audio.
Unlike audio, this method doesn't throw if the JSON field has an unexpected type.
-
_expiresAt
final JsonField<Long> _expiresAt()
Returns the raw JSON value of expiresAt.
Unlike expiresAt, this method doesn't throw if the JSON field has an unexpected type.
-
_include
final JsonField<List<RealtimeSessionCreateResponse.Include>> _include()
Returns the raw JSON value of include.
Unlike include, this method doesn't throw if the JSON field has an unexpected type.
-
_instructions
final JsonField<String> _instructions()
Returns the raw JSON value of instructions.
Unlike instructions, this method doesn't throw if the JSON field has an unexpected type.
-
_maxOutputTokens
final JsonField<RealtimeSessionCreateResponse.MaxOutputTokens> _maxOutputTokens()
Returns the raw JSON value of maxOutputTokens.
Unlike maxOutputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_model
final JsonField<String> _model()
Returns the raw JSON value of model.
Unlike model, this method doesn't throw if the JSON field has an unexpected type.
-
_object_
final JsonField<String> _object_()
Returns the raw JSON value of object_.
Unlike object_, this method doesn't throw if the JSON field has an unexpected type.
-
_outputModalities
final JsonField<List<RealtimeSessionCreateResponse.OutputModality>> _outputModalities()
Returns the raw JSON value of outputModalities.
Unlike outputModalities, this method doesn't throw if the JSON field has an unexpected type.
-
_toolChoice
final JsonField<String> _toolChoice()
Returns the raw JSON value of toolChoice.
Unlike toolChoice, this method doesn't throw if the JSON field has an unexpected type.
-
_tools
final JsonField<List<RealtimeSessionCreateResponse.Tool>> _tools()
Returns the raw JSON value of tools.
Unlike tools, this method doesn't throw if the JSON field has an unexpected type.
-
_tracing
final JsonField<RealtimeSessionCreateResponse.Tracing> _tracing()
Returns the raw JSON value of tracing.
Unlike tracing, this method doesn't throw if the JSON field has an unexpected type.
-
_turnDetection
final JsonField<RealtimeSessionCreateResponse.TurnDetection> _turnDetection()
Returns the raw JSON value of turnDetection.
Unlike turnDetection, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final RealtimeSessionCreateResponse.Builder toBuilder()
-
validate
final RealtimeSessionCreateResponse validate()
-
builder
final static RealtimeSessionCreateResponse.Builder builder()
Returns a mutable builder for constructing an instance of RealtimeSessionCreateResponse.
-
-
-
-