Class SessionCreateResponse.Builder
-
- All Implemented Interfaces:
public final class SessionCreateResponse.Builder
A builder for SessionCreateResponse.
-
-
Method Summary
-
-
Method Detail
-
clientSecret
final SessionCreateResponse.Builder clientSecret(SessionCreateResponse.ClientSecret clientSecret)
Ephemeral key returned by the API.
-
clientSecret
final SessionCreateResponse.Builder clientSecret(JsonField<SessionCreateResponse.ClientSecret> clientSecret)
Sets Builder.clientSecret to an arbitrary JSON value.
You should usually call Builder.clientSecret with a well-typed ClientSecret value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
inputAudioFormat
final SessionCreateResponse.Builder inputAudioFormat(String inputAudioFormat)
The format of input audio. Options are
pcm16
,g711_ulaw
, org711_alaw
.
-
inputAudioFormat
final SessionCreateResponse.Builder inputAudioFormat(JsonField<String> inputAudioFormat)
Sets Builder.inputAudioFormat to an arbitrary JSON value.
You should usually call Builder.inputAudioFormat with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
inputAudioTranscription
final SessionCreateResponse.Builder inputAudioTranscription(SessionCreateResponse.InputAudioTranscription inputAudioTranscription)
Configuration for input audio transcription, defaults to off and can be set to
null
to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously and should be treated as rough guidance rather than the representation understood by the model.
-
inputAudioTranscription
final SessionCreateResponse.Builder inputAudioTranscription(JsonField<SessionCreateResponse.InputAudioTranscription> inputAudioTranscription)
Sets Builder.inputAudioTranscription to an arbitrary JSON value.
You should usually call Builder.inputAudioTranscription with a well-typed InputAudioTranscription value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
instructions
final SessionCreateResponse.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 SessionCreateResponse.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.
-
maxResponseOutputTokens
final SessionCreateResponse.Builder maxResponseOutputTokens(SessionCreateResponse.MaxResponseOutputTokens maxResponseOutputTokens)
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
.
-
maxResponseOutputTokens
final SessionCreateResponse.Builder maxResponseOutputTokens(JsonField<SessionCreateResponse.MaxResponseOutputTokens> maxResponseOutputTokens)
Sets Builder.maxResponseOutputTokens to an arbitrary JSON value.
You should usually call Builder.maxResponseOutputTokens with a well-typed MaxResponseOutputTokens value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
maxResponseOutputTokens
final SessionCreateResponse.Builder maxResponseOutputTokens(Long integer)
Alias for calling maxResponseOutputTokens with
MaxResponseOutputTokens.ofInteger(integer)
.
-
maxResponseOutputTokensInf
final SessionCreateResponse.Builder maxResponseOutputTokensInf()
Alias for calling maxResponseOutputTokens with
MaxResponseOutputTokens.ofInf()
.
-
modalities
final SessionCreateResponse.Builder modalities(List<SessionCreateResponse.Modality> modalities)
The set of modalities the model can respond with. To disable audio, set this to "text".
-
modalities
final SessionCreateResponse.Builder modalities(JsonField<List<SessionCreateResponse.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 SessionCreateResponse.Builder addModality(SessionCreateResponse.Modality modality)
Adds a single Modality to modalities.
-
outputAudioFormat
final SessionCreateResponse.Builder outputAudioFormat(String outputAudioFormat)
The format of output audio. Options are
pcm16
,g711_ulaw
, org711_alaw
.
-
outputAudioFormat
final SessionCreateResponse.Builder outputAudioFormat(JsonField<String> outputAudioFormat)
Sets Builder.outputAudioFormat to an arbitrary JSON value.
You should usually call Builder.outputAudioFormat with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
speed
final SessionCreateResponse.Builder speed(Double speed)
The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the minimum speed. 1.5 is the maximum speed. This value can only be changed in between model turns, not while a response is in progress.
-
speed
final SessionCreateResponse.Builder speed(JsonField<Double> speed)
Sets Builder.speed to an arbitrary JSON value.
You should usually call Builder.speed with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
temperature
final SessionCreateResponse.Builder temperature(Double temperature)
Sampling temperature for the model, limited to 0.6, 1.2. Defaults to 0.8.
-
temperature
final SessionCreateResponse.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.
-
toolChoice
final SessionCreateResponse.Builder toolChoice(String toolChoice)
How the model chooses tools. Options are
auto
,none
,required
, or specify a function.
-
toolChoice
final SessionCreateResponse.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 SessionCreateResponse.Builder tools(List<SessionCreateResponse.Tool> tools)
Tools (functions) available to the model.
-
tools
final SessionCreateResponse.Builder tools(JsonField<List<SessionCreateResponse.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 SessionCreateResponse.Builder addTool(SessionCreateResponse.Tool tool)
-
tracing
final SessionCreateResponse.Builder tracing(SessionCreateResponse.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 SessionCreateResponse.Builder tracing(JsonField<SessionCreateResponse.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 SessionCreateResponse.Builder tracing(SessionCreateResponse.Tracing.TracingConfiguration configuration)
Alias for calling tracing with
Tracing.ofConfiguration(configuration)
.
-
tracingAuto
final SessionCreateResponse.Builder tracingAuto()
Alias for calling tracing with
Tracing.ofAuto()
.
-
turnDetection
final SessionCreateResponse.Builder turnDetection(SessionCreateResponse.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 SessionCreateResponse.Builder turnDetection(JsonField<SessionCreateResponse.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.
-
voice
final SessionCreateResponse.Builder voice(SessionCreateResponse.Voice voice)
The voice the model uses to respond. Voice cannot be changed during the session once the model has responded with audio at least once. Current voice options are
alloy
,ash
,ballad
,coral
,echo
,sage
,shimmer
, andverse
.
-
voice
final SessionCreateResponse.Builder voice(JsonField<SessionCreateResponse.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 SessionCreateResponse.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 SessionCreateResponse.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final SessionCreateResponse.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final SessionCreateResponse.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final SessionCreateResponse.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final SessionCreateResponse.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final SessionCreateResponse build()
Returns an immutable instance of SessionCreateResponse.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.clientSecret()
-
-
-
-