Class RealtimeSessionCreateResponse.Builder
-
- All Implemented Interfaces:
public final class RealtimeSessionCreateResponse.Builder
A builder for RealtimeSessionCreateResponse.
-
-
Method Summary
-
-
Method Detail
-
id
final RealtimeSessionCreateResponse.Builder id(String id)
Unique identifier for the session that looks like
sess_1234567890abcdef
.
-
id
final RealtimeSessionCreateResponse.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.
-
audio
final RealtimeSessionCreateResponse.Builder audio(RealtimeSessionCreateResponse.Audio audio)
Configuration for input and output audio for the session.
-
audio
final RealtimeSessionCreateResponse.Builder audio(JsonField<RealtimeSessionCreateResponse.Audio> audio)
Sets Builder.audio to an arbitrary JSON value.
You should usually call Builder.audio with a well-typed Audio value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
expiresAt
final RealtimeSessionCreateResponse.Builder expiresAt(Long expiresAt)
Expiration timestamp for the session, in seconds since epoch.
-
expiresAt
final RealtimeSessionCreateResponse.Builder expiresAt(JsonField<Long> expiresAt)
Sets Builder.expiresAt to an arbitrary JSON value.
You should usually call Builder.expiresAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
include
final RealtimeSessionCreateResponse.Builder include(List<RealtimeSessionCreateResponse.Include> include)
Additional fields to include in server outputs.
item.input_audio_transcription.logprobs
: Include logprobs for input audio transcription.
-
include
final RealtimeSessionCreateResponse.Builder include(JsonField<List<RealtimeSessionCreateResponse.Include>> include)
Sets Builder.include to an arbitrary JSON value.
You should usually call Builder.include with a well-typed
List<Include>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addInclude
final RealtimeSessionCreateResponse.Builder addInclude(RealtimeSessionCreateResponse.Include include)
Adds a single Include to Builder.include.
-
instructions
final RealtimeSessionCreateResponse.Builder instructions(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.
-
instructions
final RealtimeSessionCreateResponse.Builder instructions(JsonField<String> instructions)
Sets Builder.instructions to an arbitrary JSON value.
You should usually call Builder.instructions 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 RealtimeSessionCreateResponse.Builder maxOutputTokens(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
.
-
maxOutputTokens
final RealtimeSessionCreateResponse.Builder maxOutputTokens(JsonField<RealtimeSessionCreateResponse.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 RealtimeSessionCreateResponse.Builder maxOutputTokens(Long integer)
Alias for calling maxOutputTokens with
MaxOutputTokens.ofInteger(integer)
.
-
maxOutputTokensInf
final RealtimeSessionCreateResponse.Builder maxOutputTokensInf()
Alias for calling maxOutputTokens with
MaxOutputTokens.ofInf()
.
-
model
final RealtimeSessionCreateResponse.Builder model(String model)
The Realtime model used for this session.
-
model
final RealtimeSessionCreateResponse.Builder model(JsonField<String> model)
Sets Builder.model to an arbitrary JSON value.
You should usually call Builder.model 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 RealtimeSessionCreateResponse.Builder object_(String object_)
The object type. Always
realtime.session
.
-
object_
final RealtimeSessionCreateResponse.Builder object_(JsonField<String> object_)
Sets Builder.object_ to an arbitrary JSON value.
You should usually call Builder.object_ with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
outputModalities
final RealtimeSessionCreateResponse.Builder outputModalities(List<RealtimeSessionCreateResponse.OutputModality> outputModalities)
The set of modalities the model can respond with. To disable audio, set this to "text".
-
outputModalities
final RealtimeSessionCreateResponse.Builder outputModalities(JsonField<List<RealtimeSessionCreateResponse.OutputModality>> outputModalities)
Sets Builder.outputModalities to an arbitrary JSON value.
You should usually call Builder.outputModalities with a well-typed
List<OutputModality>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addOutputModality
final RealtimeSessionCreateResponse.Builder addOutputModality(RealtimeSessionCreateResponse.OutputModality outputModality)
Adds a single OutputModality to outputModalities.
-
toolChoice
final RealtimeSessionCreateResponse.Builder toolChoice(String toolChoice)
How the model chooses tools. Options are
auto
,none
,required
, or specify a function.
-
toolChoice
final RealtimeSessionCreateResponse.Builder toolChoice(JsonField<String> toolChoice)
Sets Builder.toolChoice to an arbitrary JSON value.
You should usually call Builder.toolChoice with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
tools
final RealtimeSessionCreateResponse.Builder tools(List<RealtimeSessionCreateResponse.Tool> tools)
Tools (functions) available to the model.
-
tools
final RealtimeSessionCreateResponse.Builder tools(JsonField<List<RealtimeSessionCreateResponse.Tool>> tools)
Sets Builder.tools to an arbitrary JSON value.
You should usually call Builder.tools with a well-typed
List<Tool>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addTool
final RealtimeSessionCreateResponse.Builder addTool(RealtimeSessionCreateResponse.Tool tool)
-
tracing
final RealtimeSessionCreateResponse.Builder tracing(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.
-
tracing
final RealtimeSessionCreateResponse.Builder tracing(JsonField<RealtimeSessionCreateResponse.Tracing> tracing)
Sets Builder.tracing to an arbitrary JSON value.
You should usually call Builder.tracing with a well-typed Tracing value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
tracing
final RealtimeSessionCreateResponse.Builder tracing(RealtimeSessionCreateResponse.Tracing.TracingConfiguration configuration)
Alias for calling tracing with
Tracing.ofConfiguration(configuration)
.
-
tracingAuto
final RealtimeSessionCreateResponse.Builder tracingAuto()
Alias for calling tracing with
Tracing.ofAuto()
.
-
turnDetection
final RealtimeSessionCreateResponse.Builder turnDetection(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.
-
turnDetection
final RealtimeSessionCreateResponse.Builder turnDetection(JsonField<RealtimeSessionCreateResponse.TurnDetection> turnDetection)
Sets Builder.turnDetection to an arbitrary JSON value.
You should usually call Builder.turnDetection with a well-typed TurnDetection value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final RealtimeSessionCreateResponse.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final RealtimeSessionCreateResponse.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final RealtimeSessionCreateResponse.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final RealtimeSessionCreateResponse.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final RealtimeSessionCreateResponse.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final RealtimeSessionCreateResponse build()
Returns an immutable instance of RealtimeSessionCreateResponse.
Further updates to this Builder will not mutate the returned instance.
-
-
-
-