SessionConfig class abstract
Session configuration to update.
- Available extensions
- Annotations
-
- @freezed
Constructors
-
SessionConfig({@JsonKey.new(name: 'client_secret', includeIfNull: false) SessionConfigClientSecret? clientSecret, @JsonKey.new(includeIfNull: false) List<
Modality> ? modalities, @JsonKey.new(includeIfNull: false) String? instructions, @JsonKey.new(includeIfNull: false, unknownEnumValue: JsonKey.nullForUndefinedEnumValue) Voice? voice, @JsonKey.new(name: 'input_audio_format', includeIfNull: false, unknownEnumValue: JsonKey.nullForUndefinedEnumValue) AudioFormat? inputAudioFormat, @JsonKey.new(name: 'output_audio_format', includeIfNull: false, unknownEnumValue: JsonKey.nullForUndefinedEnumValue) AudioFormat? outputAudioFormat, @JsonKey.new(name: 'input_audio_transcription', includeIfNull: false) InputAudioTranscriptionConfig? inputAudioTranscription, @JsonKey.new(name: 'turn_detection') required TurnDetection? turnDetection, @JsonKey.new(includeIfNull: false) List<ToolDefinition> ? tools, @JsonKey.new(name: 'tool_choice', includeIfNull: false) SessionConfigToolChoice? toolChoice, @JsonKey.new(includeIfNull: false) double? temperature, @JsonKey.new(name: 'max_response_output_tokens', includeIfNull: false) SessionConfigMaxResponseOutputTokens? maxResponseOutputTokens}) -
Factory constructor for SessionConfig
constfactory
-
SessionConfig.fromJson(Map<
String, dynamic> json) -
Object construction from a JSON representation
factory
Properties
- clientSecret → SessionConfigClientSecret?
-
Ephemeral key returned by the API.
no setterinherited
-
copyWith
→ $SessionConfigCopyWith<
SessionConfig> -
Create a copy of SessionConfig
with the given fields replaced by the non-null parameter values.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- inputAudioFormat → AudioFormat?
-
The format of input audio. Options are
pcm16,g711_ulaw, org711_alaw.no setterinherited - inputAudioTranscription → InputAudioTranscriptionConfig?
-
Configuration for input audio transcription, defaults to off and can be set to
nullto turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through the /audio/transcriptions endpoint and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.no setterinherited - instructions → String?
-
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.
no setterinherited
- maxResponseOutputTokens → SessionConfigMaxResponseOutputTokens?
-
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
inffor the maximum available tokens for a given model. Defaults toinf.no setterinherited -
modalities
→ List<
Modality> ? -
The set of modalities the model can respond with. To disable audio, set this to
"text".no setterinherited - outputAudioFormat → AudioFormat?
-
The format of output audio. Options are
pcm16,g711_ulaw, org711_alaw.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- temperature → double?
-
Sampling temperature for the model, limited to
0.6, 1.2. Defaults to 0.8.no setterinherited - toolChoice → SessionConfigToolChoice?
-
How the model chooses tools. Options are
auto,none,required, or specify a function.no setterinherited -
tools
→ List<
ToolDefinition> ? -
Tools (functions) available to the model.
no setterinherited
- turnDetection → TurnDetection?
-
Configuration for turn detection. Can be set to
nullto 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.no setterinherited - 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,echosage,shimmerandverse.no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_SessionConfig value)) → TResult -
Available on SessionConfig, provided by the SessionConfigPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_SessionConfig value)?) → TResult? -
Available on SessionConfig, provided by the SessionConfigPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_SessionConfig value)?, {required TResult orElse()}) → TResult -
Available on SessionConfig, provided by the SessionConfigPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(SessionConfigClientSecret? clientSecret, List< Modality> ? modalities, String? instructions, Voice? voice, AudioFormat? inputAudioFormat, AudioFormat? outputAudioFormat, InputAudioTranscriptionConfig? inputAudioTranscription, TurnDetection? turnDetection, List<ToolDefinition> ? tools, SessionConfigToolChoice? toolChoice, double? temperature, SessionConfigMaxResponseOutputTokens? maxResponseOutputTokens)?, {required TResult orElse()}) → TResult -
Available on SessionConfig, provided by the SessionConfigPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this SessionConfig to a JSON map.
inherited
-
toMap(
) → Map< String, dynamic> - Map representation of object (not serialized)
-
toString(
) → String -
A string representation of this object.
inherited
-
validateSchema(
) → String? - Perform validations on the schema property values
-
when<
TResult extends Object?> (TResult $default(SessionConfigClientSecret? clientSecret, List< Modality> ? modalities, String? instructions, Voice? voice, AudioFormat? inputAudioFormat, AudioFormat? outputAudioFormat, InputAudioTranscriptionConfig? inputAudioTranscription, TurnDetection? turnDetection, List<ToolDefinition> ? tools, SessionConfigToolChoice? toolChoice, double? temperature, SessionConfigMaxResponseOutputTokens? maxResponseOutputTokens)) → TResult -
Available on SessionConfig, provided by the SessionConfigPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(SessionConfigClientSecret? clientSecret, List< Modality> ? modalities, String? instructions, Voice? voice, AudioFormat? inputAudioFormat, AudioFormat? outputAudioFormat, InputAudioTranscriptionConfig? inputAudioTranscription, TurnDetection? turnDetection, List<ToolDefinition> ? tools, SessionConfigToolChoice? toolChoice, double? temperature, SessionConfigMaxResponseOutputTokens? maxResponseOutputTokens)?) → TResult? -
Available on SessionConfig, provided by the SessionConfigPatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
propertyNames
→ const List<
String> - List of all property names of schema