Skip to content

Commit

Permalink
refactor: Remove unused property in openai_realtime_dart (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmigloz committed Dec 21, 2024
1 parent 758f426 commit 231ccab
Show file tree
Hide file tree
Showing 5 changed files with 296 additions and 519 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ part of openai_realtime_schema;
// CLASS: InputAudioTranscriptionConfig
// ==========================================

/// Configuration for input audio transcription.
/// 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 through Whisper and should be treated as rough guidance
/// rather than the representation understood by the model.
@freezed
class InputAudioTranscriptionConfig with _$InputAudioTranscriptionConfig {
const InputAudioTranscriptionConfig._();

/// Factory constructor for InputAudioTranscriptionConfig
const factory InputAudioTranscriptionConfig({
/// Whether input audio transcription is enabled.
@JsonKey(includeIfNull: false) bool? enabled,

/// The model to use for transcription, `whisper-1` is the only currently
/// supported model.
@JsonKey(includeIfNull: false) String? model,
Expand All @@ -28,7 +29,7 @@ class InputAudioTranscriptionConfig with _$InputAudioTranscriptionConfig {
_$InputAudioTranscriptionConfigFromJson(json);

/// List of all property names of schema
static const List<String> propertyNames = ['enabled', 'model'];
static const List<String> propertyNames = ['model'];

/// Perform validations on the schema property values
String? validateSchema() {
Expand All @@ -38,7 +39,6 @@ class InputAudioTranscriptionConfig with _$InputAudioTranscriptionConfig {
/// Map representation of object (not serialized)
Map<String, dynamic> toMap() {
return {
'enabled': enabled,
'model': model,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,6 @@ InputAudioTranscriptionConfig _$InputAudioTranscriptionConfigFromJson(

/// @nodoc
mixin _$InputAudioTranscriptionConfig {
/// Whether input audio transcription is enabled.
@JsonKey(includeIfNull: false)
bool? get enabled => throw _privateConstructorUsedError;

/// The model to use for transcription, `whisper-1` is the only currently
/// supported model.
@JsonKey(includeIfNull: false)
Expand All @@ -483,9 +479,7 @@ abstract class $InputAudioTranscriptionConfigCopyWith<$Res> {
_$InputAudioTranscriptionConfigCopyWithImpl<$Res,
InputAudioTranscriptionConfig>;
@useResult
$Res call(
{@JsonKey(includeIfNull: false) bool? enabled,
@JsonKey(includeIfNull: false) String? model});
$Res call({@JsonKey(includeIfNull: false) String? model});
}

/// @nodoc
Expand All @@ -504,14 +498,9 @@ class _$InputAudioTranscriptionConfigCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? enabled = freezed,
Object? model = freezed,
}) {
return _then(_value.copyWith(
enabled: freezed == enabled
? _value.enabled
: enabled // ignore: cast_nullable_to_non_nullable
as bool?,
model: freezed == model
? _value.model
: model // ignore: cast_nullable_to_non_nullable
Expand All @@ -529,9 +518,7 @@ abstract class _$$InputAudioTranscriptionConfigImplCopyWith<$Res>
__$$InputAudioTranscriptionConfigImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{@JsonKey(includeIfNull: false) bool? enabled,
@JsonKey(includeIfNull: false) String? model});
$Res call({@JsonKey(includeIfNull: false) String? model});
}

/// @nodoc
Expand All @@ -549,14 +536,9 @@ class __$$InputAudioTranscriptionConfigImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? enabled = freezed,
Object? model = freezed,
}) {
return _then(_$InputAudioTranscriptionConfigImpl(
enabled: freezed == enabled
? _value.enabled
: enabled // ignore: cast_nullable_to_non_nullable
as bool?,
model: freezed == model
? _value.model
: model // ignore: cast_nullable_to_non_nullable
Expand All @@ -570,19 +552,13 @@ class __$$InputAudioTranscriptionConfigImplCopyWithImpl<$Res>
class _$InputAudioTranscriptionConfigImpl
extends _InputAudioTranscriptionConfig {
const _$InputAudioTranscriptionConfigImpl(
{@JsonKey(includeIfNull: false) this.enabled,
@JsonKey(includeIfNull: false) this.model})
{@JsonKey(includeIfNull: false) this.model})
: super._();

factory _$InputAudioTranscriptionConfigImpl.fromJson(
Map<String, dynamic> json) =>
_$$InputAudioTranscriptionConfigImplFromJson(json);

/// Whether input audio transcription is enabled.
@override
@JsonKey(includeIfNull: false)
final bool? enabled;

/// The model to use for transcription, `whisper-1` is the only currently
/// supported model.
@override
Expand All @@ -591,21 +567,20 @@ class _$InputAudioTranscriptionConfigImpl

@override
String toString() {
return 'InputAudioTranscriptionConfig(enabled: $enabled, model: $model)';
return 'InputAudioTranscriptionConfig(model: $model)';
}

@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$InputAudioTranscriptionConfigImpl &&
(identical(other.enabled, enabled) || other.enabled == enabled) &&
(identical(other.model, model) || other.model == model));
}

@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, enabled, model);
int get hashCode => Object.hash(runtimeType, model);

/// Create a copy of InputAudioTranscriptionConfig
/// with the given fields replaced by the non-null parameter values.
Expand All @@ -628,19 +603,13 @@ class _$InputAudioTranscriptionConfigImpl
abstract class _InputAudioTranscriptionConfig
extends InputAudioTranscriptionConfig {
const factory _InputAudioTranscriptionConfig(
{@JsonKey(includeIfNull: false) final bool? enabled,
@JsonKey(includeIfNull: false) final String? model}) =
{@JsonKey(includeIfNull: false) final String? model}) =
_$InputAudioTranscriptionConfigImpl;
const _InputAudioTranscriptionConfig._() : super._();

factory _InputAudioTranscriptionConfig.fromJson(Map<String, dynamic> json) =
_$InputAudioTranscriptionConfigImpl.fromJson;

/// Whether input audio transcription is enabled.
@override
@JsonKey(includeIfNull: false)
bool? get enabled;

/// The model to use for transcription, `whisper-1` is the only currently
/// supported model.
@override
Expand Down Expand Up @@ -3741,7 +3710,11 @@ mixin _$Session {
unknownEnumValue: JsonKey.nullForUndefinedEnumValue)
AudioFormat? get outputAudioFormat => throw _privateConstructorUsedError;

/// Configuration for input audio transcription.
/// 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 through Whisper and should be treated as rough guidance
/// rather than the representation understood by the model.
@JsonKey(name: 'input_audio_transcription', includeIfNull: false)
InputAudioTranscriptionConfig? get inputAudioTranscription =>
throw _privateConstructorUsedError;
Expand Down Expand Up @@ -4227,7 +4200,11 @@ class _$SessionImpl extends _Session {
unknownEnumValue: JsonKey.nullForUndefinedEnumValue)
final AudioFormat? outputAudioFormat;

/// Configuration for input audio transcription.
/// 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 through Whisper and should be treated as rough guidance
/// rather than the representation understood by the model.
@override
@JsonKey(name: 'input_audio_transcription', includeIfNull: false)
final InputAudioTranscriptionConfig? inputAudioTranscription;
Expand Down Expand Up @@ -4435,7 +4412,11 @@ abstract class _Session extends Session {
unknownEnumValue: JsonKey.nullForUndefinedEnumValue)
AudioFormat? get outputAudioFormat;

/// Configuration for input audio transcription.
/// 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 through Whisper and should be treated as rough guidance
/// rather than the representation understood by the model.
@override
@JsonKey(name: 'input_audio_transcription', includeIfNull: false)
InputAudioTranscriptionConfig? get inputAudioTranscription;
Expand Down
Loading

0 comments on commit 231ccab

Please sign in to comment.