Add the Flutter video editing application with project management, media import, timeline editing, preview, AI assistance, diagnostics and settings. Include shared UI and native host packages, platform runners, application tests and release tooling. Provide usage and contribution guides, the MIT license and third-party notices. Exclude local credentials, build outputs and validation data.
1319 lines
36 KiB
Dart
1319 lines
36 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// coverage:ignore-file
|
|
// ignore_for_file: type=lint, type=warning, deprecated_member_use, deprecated_member_use_from_same_package
|
|
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
|
|
|
part of 'agent_models.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
T _$identity<T>(T value) => value;
|
|
|
|
/// @nodoc
|
|
mixin _$AgentModelSettings {
|
|
String get id;
|
|
int? get contextWindow;
|
|
int? get maxOutputTokens;
|
|
|
|
/// Create a copy of AgentModelSettings
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$AgentModelSettingsCopyWith<AgentModelSettings> get copyWith =>
|
|
_$AgentModelSettingsCopyWithImpl<AgentModelSettings>(
|
|
this as AgentModelSettings,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
final _this = this as AgentModelSettings;
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is AgentModelSettings &&
|
|
(identical(other.id, _this.id) || other.id == _this.id) &&
|
|
(identical(other.contextWindow, _this.contextWindow) ||
|
|
other.contextWindow == _this.contextWindow) &&
|
|
(identical(other.maxOutputTokens, _this.maxOutputTokens) ||
|
|
other.maxOutputTokens == _this.maxOutputTokens));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
final _this = this as AgentModelSettings;
|
|
return Object.hash(
|
|
runtimeType,
|
|
_this.id,
|
|
_this.contextWindow,
|
|
_this.maxOutputTokens,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
final _this = this as AgentModelSettings;
|
|
return 'AgentModelSettings(id: ${_this.id}, contextWindow: ${_this.contextWindow}, maxOutputTokens: ${_this.maxOutputTokens})';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $AgentModelSettingsCopyWith<$Res> {
|
|
factory $AgentModelSettingsCopyWith(
|
|
AgentModelSettings value,
|
|
$Res Function(AgentModelSettings) _then,
|
|
) = _$AgentModelSettingsCopyWithImpl;
|
|
@useResult
|
|
$Res call({String id, int? contextWindow, int? maxOutputTokens});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$AgentModelSettingsCopyWithImpl<$Res>
|
|
implements $AgentModelSettingsCopyWith<$Res> {
|
|
_$AgentModelSettingsCopyWithImpl(this._self, this._then);
|
|
|
|
final AgentModelSettings _self;
|
|
final $Res Function(AgentModelSettings) _then;
|
|
|
|
/// Create a copy of AgentModelSettings
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? contextWindow = freezed,
|
|
Object? maxOutputTokens = freezed,
|
|
}) {
|
|
return _then(
|
|
AgentModelSettings(
|
|
id: null == id
|
|
? _self.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
contextWindow: freezed == contextWindow
|
|
? _self.contextWindow
|
|
: contextWindow // ignore: cast_nullable_to_non_nullable
|
|
as int?,
|
|
maxOutputTokens: freezed == maxOutputTokens
|
|
? _self.maxOutputTokens
|
|
: maxOutputTokens // ignore: cast_nullable_to_non_nullable
|
|
as int?,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Adds pattern-matching-related methods to [AgentModelSettings].
|
|
extension AgentModelSettingsPatterns on AgentModelSettings {
|
|
/// A variant of `map` that fallback to returning `orElse`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeMap<TResult extends Object?>(
|
|
TResult Function(_AgentModelSettings value)? $default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentModelSettings() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// Callbacks receives the raw object, upcasted.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case final Subclass2 value:
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult map<TResult extends Object?>(
|
|
TResult Function(_AgentModelSettings value) $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentModelSettings():
|
|
return $default(_that);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `map` that fallback to returning `null`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? mapOrNull<TResult extends Object?>(
|
|
TResult? Function(_AgentModelSettings value)? $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentModelSettings() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to an `orElse` callback.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeWhen<TResult extends Object?>(
|
|
TResult Function(String id, int? contextWindow, int? maxOutputTokens)?
|
|
$default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentModelSettings() when $default != null:
|
|
return $default(_that.id, _that.contextWindow, _that.maxOutputTokens);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// As opposed to `map`, this offers destructuring.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case Subclass2(:final field2):
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult when<TResult extends Object?>(
|
|
TResult Function(String id, int? contextWindow, int? maxOutputTokens)
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentModelSettings():
|
|
return $default(_that.id, _that.contextWindow, _that.maxOutputTokens);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to returning `null`
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? whenOrNull<TResult extends Object?>(
|
|
TResult? Function(String id, int? contextWindow, int? maxOutputTokens)?
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentModelSettings() when $default != null:
|
|
return $default(_that.id, _that.contextWindow, _that.maxOutputTokens);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
class _AgentModelSettings extends AgentModelSettings {
|
|
const _AgentModelSettings({
|
|
required this.id,
|
|
this.contextWindow,
|
|
this.maxOutputTokens,
|
|
}) : super._();
|
|
|
|
@override
|
|
final String id;
|
|
@override
|
|
final int? contextWindow;
|
|
@override
|
|
final int? maxOutputTokens;
|
|
|
|
/// Create a copy of AgentModelSettings
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$AgentModelSettingsCopyWith<_AgentModelSettings> get copyWith =>
|
|
__$AgentModelSettingsCopyWithImpl<_AgentModelSettings>(this, _$identity);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _AgentModelSettings &&
|
|
(identical(other.id, id) || other.id == id) &&
|
|
(identical(other.contextWindow, contextWindow) ||
|
|
other.contextWindow == contextWindow) &&
|
|
(identical(other.maxOutputTokens, maxOutputTokens) ||
|
|
other.maxOutputTokens == maxOutputTokens));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
return Object.hash(runtimeType, id, contextWindow, maxOutputTokens);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AgentModelSettings(id: $id, contextWindow: $contextWindow, maxOutputTokens: $maxOutputTokens)';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$AgentModelSettingsCopyWith<$Res>
|
|
implements $AgentModelSettingsCopyWith<$Res> {
|
|
factory _$AgentModelSettingsCopyWith(
|
|
_AgentModelSettings value,
|
|
$Res Function(_AgentModelSettings) _then,
|
|
) = __$AgentModelSettingsCopyWithImpl;
|
|
@override
|
|
@useResult
|
|
$Res call({String id, int? contextWindow, int? maxOutputTokens});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$AgentModelSettingsCopyWithImpl<$Res>
|
|
implements _$AgentModelSettingsCopyWith<$Res> {
|
|
__$AgentModelSettingsCopyWithImpl(this._self, this._then);
|
|
|
|
final _AgentModelSettings _self;
|
|
final $Res Function(_AgentModelSettings) _then;
|
|
|
|
/// Create a copy of AgentModelSettings
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? contextWindow = freezed,
|
|
Object? maxOutputTokens = freezed,
|
|
}) {
|
|
return _then(
|
|
_AgentModelSettings(
|
|
id: null == id
|
|
? _self.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
contextWindow: freezed == contextWindow
|
|
? _self.contextWindow
|
|
: contextWindow // ignore: cast_nullable_to_non_nullable
|
|
as int?,
|
|
maxOutputTokens: freezed == maxOutputTokens
|
|
? _self.maxOutputTokens
|
|
: maxOutputTokens // ignore: cast_nullable_to_non_nullable
|
|
as int?,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$AgentProviderSettings {
|
|
String get id;
|
|
String get name;
|
|
String get apiType;
|
|
String get baseUrl;
|
|
List<AgentModelSettings> get models;
|
|
String? get credentialId;
|
|
bool get enabled;
|
|
|
|
/// Create a copy of AgentProviderSettings
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$AgentProviderSettingsCopyWith<AgentProviderSettings> get copyWith =>
|
|
_$AgentProviderSettingsCopyWithImpl<AgentProviderSettings>(
|
|
this as AgentProviderSettings,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
final _this = this as AgentProviderSettings;
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is AgentProviderSettings &&
|
|
(identical(other.id, _this.id) || other.id == _this.id) &&
|
|
(identical(other.name, _this.name) || other.name == _this.name) &&
|
|
(identical(other.apiType, _this.apiType) ||
|
|
other.apiType == _this.apiType) &&
|
|
(identical(other.baseUrl, _this.baseUrl) ||
|
|
other.baseUrl == _this.baseUrl) &&
|
|
const DeepCollectionEquality().equals(other.models, _this.models) &&
|
|
(identical(other.credentialId, _this.credentialId) ||
|
|
other.credentialId == _this.credentialId) &&
|
|
(identical(other.enabled, _this.enabled) ||
|
|
other.enabled == _this.enabled));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
final _this = this as AgentProviderSettings;
|
|
return Object.hash(
|
|
runtimeType,
|
|
_this.id,
|
|
_this.name,
|
|
_this.apiType,
|
|
_this.baseUrl,
|
|
const DeepCollectionEquality().hash(_this.models),
|
|
_this.credentialId,
|
|
_this.enabled,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
final _this = this as AgentProviderSettings;
|
|
return 'AgentProviderSettings(id: ${_this.id}, name: ${_this.name}, apiType: ${_this.apiType}, baseUrl: ${_this.baseUrl}, models: ${_this.models}, credentialId: ${_this.credentialId}, enabled: ${_this.enabled})';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $AgentProviderSettingsCopyWith<$Res> {
|
|
factory $AgentProviderSettingsCopyWith(
|
|
AgentProviderSettings value,
|
|
$Res Function(AgentProviderSettings) _then,
|
|
) = _$AgentProviderSettingsCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
String id,
|
|
String name,
|
|
String apiType,
|
|
String baseUrl,
|
|
List<AgentModelSettings> models,
|
|
String? credentialId,
|
|
bool enabled,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$AgentProviderSettingsCopyWithImpl<$Res>
|
|
implements $AgentProviderSettingsCopyWith<$Res> {
|
|
_$AgentProviderSettingsCopyWithImpl(this._self, this._then);
|
|
|
|
final AgentProviderSettings _self;
|
|
final $Res Function(AgentProviderSettings) _then;
|
|
|
|
/// Create a copy of AgentProviderSettings
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? name = null,
|
|
Object? apiType = null,
|
|
Object? baseUrl = null,
|
|
Object? models = null,
|
|
Object? credentialId = freezed,
|
|
Object? enabled = null,
|
|
}) {
|
|
return _then(
|
|
AgentProviderSettings(
|
|
id: null == id
|
|
? _self.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
name: null == name
|
|
? _self.name
|
|
: name // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
apiType: null == apiType
|
|
? _self.apiType
|
|
: apiType // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
baseUrl: null == baseUrl
|
|
? _self.baseUrl
|
|
: baseUrl // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
models: null == models
|
|
? _self.models
|
|
: models // ignore: cast_nullable_to_non_nullable
|
|
as List<AgentModelSettings>,
|
|
credentialId: freezed == credentialId
|
|
? _self.credentialId
|
|
: credentialId // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
enabled: null == enabled
|
|
? _self.enabled
|
|
: enabled // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Adds pattern-matching-related methods to [AgentProviderSettings].
|
|
extension AgentProviderSettingsPatterns on AgentProviderSettings {
|
|
/// A variant of `map` that fallback to returning `orElse`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeMap<TResult extends Object?>(
|
|
TResult Function(_AgentProviderSettings value)? $default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentProviderSettings() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// Callbacks receives the raw object, upcasted.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case final Subclass2 value:
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult map<TResult extends Object?>(
|
|
TResult Function(_AgentProviderSettings value) $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentProviderSettings():
|
|
return $default(_that);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `map` that fallback to returning `null`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? mapOrNull<TResult extends Object?>(
|
|
TResult? Function(_AgentProviderSettings value)? $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentProviderSettings() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to an `orElse` callback.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeWhen<TResult extends Object?>(
|
|
TResult Function(
|
|
String id,
|
|
String name,
|
|
String apiType,
|
|
String baseUrl,
|
|
List<AgentModelSettings> models,
|
|
String? credentialId,
|
|
bool enabled,
|
|
)?
|
|
$default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentProviderSettings() when $default != null:
|
|
return $default(
|
|
_that.id,
|
|
_that.name,
|
|
_that.apiType,
|
|
_that.baseUrl,
|
|
_that.models,
|
|
_that.credentialId,
|
|
_that.enabled,
|
|
);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// As opposed to `map`, this offers destructuring.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case Subclass2(:final field2):
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult when<TResult extends Object?>(
|
|
TResult Function(
|
|
String id,
|
|
String name,
|
|
String apiType,
|
|
String baseUrl,
|
|
List<AgentModelSettings> models,
|
|
String? credentialId,
|
|
bool enabled,
|
|
)
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentProviderSettings():
|
|
return $default(
|
|
_that.id,
|
|
_that.name,
|
|
_that.apiType,
|
|
_that.baseUrl,
|
|
_that.models,
|
|
_that.credentialId,
|
|
_that.enabled,
|
|
);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to returning `null`
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? whenOrNull<TResult extends Object?>(
|
|
TResult? Function(
|
|
String id,
|
|
String name,
|
|
String apiType,
|
|
String baseUrl,
|
|
List<AgentModelSettings> models,
|
|
String? credentialId,
|
|
bool enabled,
|
|
)?
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentProviderSettings() when $default != null:
|
|
return $default(
|
|
_that.id,
|
|
_that.name,
|
|
_that.apiType,
|
|
_that.baseUrl,
|
|
_that.models,
|
|
_that.credentialId,
|
|
_that.enabled,
|
|
);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
class _AgentProviderSettings extends AgentProviderSettings {
|
|
const _AgentProviderSettings({
|
|
required this.id,
|
|
required this.name,
|
|
required this.apiType,
|
|
required this.baseUrl,
|
|
required List<AgentModelSettings> models,
|
|
this.credentialId,
|
|
this.enabled = true,
|
|
}) : _models = models,
|
|
super._();
|
|
|
|
@override
|
|
final String id;
|
|
@override
|
|
final String name;
|
|
@override
|
|
final String apiType;
|
|
@override
|
|
final String baseUrl;
|
|
final List<AgentModelSettings> _models;
|
|
@override
|
|
List<AgentModelSettings> get models {
|
|
if (_models is EqualUnmodifiableListView) return _models;
|
|
// ignore: implicit_dynamic_type
|
|
return EqualUnmodifiableListView(_models);
|
|
}
|
|
|
|
@override
|
|
final String? credentialId;
|
|
@override
|
|
@JsonKey()
|
|
final bool enabled;
|
|
|
|
/// Create a copy of AgentProviderSettings
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$AgentProviderSettingsCopyWith<_AgentProviderSettings> get copyWith =>
|
|
__$AgentProviderSettingsCopyWithImpl<_AgentProviderSettings>(
|
|
this,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _AgentProviderSettings &&
|
|
(identical(other.id, id) || other.id == id) &&
|
|
(identical(other.name, name) || other.name == name) &&
|
|
(identical(other.apiType, apiType) || other.apiType == apiType) &&
|
|
(identical(other.baseUrl, baseUrl) || other.baseUrl == baseUrl) &&
|
|
const DeepCollectionEquality().equals(other.models, _models) &&
|
|
(identical(other.credentialId, credentialId) ||
|
|
other.credentialId == credentialId) &&
|
|
(identical(other.enabled, enabled) || other.enabled == enabled));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
return Object.hash(
|
|
runtimeType,
|
|
id,
|
|
name,
|
|
apiType,
|
|
baseUrl,
|
|
const DeepCollectionEquality().hash(_models),
|
|
credentialId,
|
|
enabled,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AgentProviderSettings(id: $id, name: $name, apiType: $apiType, baseUrl: $baseUrl, models: $models, credentialId: $credentialId, enabled: $enabled)';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$AgentProviderSettingsCopyWith<$Res>
|
|
implements $AgentProviderSettingsCopyWith<$Res> {
|
|
factory _$AgentProviderSettingsCopyWith(
|
|
_AgentProviderSettings value,
|
|
$Res Function(_AgentProviderSettings) _then,
|
|
) = __$AgentProviderSettingsCopyWithImpl;
|
|
@override
|
|
@useResult
|
|
$Res call({
|
|
String id,
|
|
String name,
|
|
String apiType,
|
|
String baseUrl,
|
|
List<AgentModelSettings> models,
|
|
String? credentialId,
|
|
bool enabled,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$AgentProviderSettingsCopyWithImpl<$Res>
|
|
implements _$AgentProviderSettingsCopyWith<$Res> {
|
|
__$AgentProviderSettingsCopyWithImpl(this._self, this._then);
|
|
|
|
final _AgentProviderSettings _self;
|
|
final $Res Function(_AgentProviderSettings) _then;
|
|
|
|
/// Create a copy of AgentProviderSettings
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? name = null,
|
|
Object? apiType = null,
|
|
Object? baseUrl = null,
|
|
Object? models = null,
|
|
Object? credentialId = freezed,
|
|
Object? enabled = null,
|
|
}) {
|
|
return _then(
|
|
_AgentProviderSettings(
|
|
id: null == id
|
|
? _self.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
name: null == name
|
|
? _self.name
|
|
: name // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
apiType: null == apiType
|
|
? _self.apiType
|
|
: apiType // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
baseUrl: null == baseUrl
|
|
? _self.baseUrl
|
|
: baseUrl // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
models: null == models
|
|
? _self._models
|
|
: models // ignore: cast_nullable_to_non_nullable
|
|
as List<AgentModelSettings>,
|
|
credentialId: freezed == credentialId
|
|
? _self.credentialId
|
|
: credentialId // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
enabled: null == enabled
|
|
? _self.enabled
|
|
: enabled // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$AgentSettingsState {
|
|
bool get enabled;
|
|
List<AgentProviderSettings> get providers;
|
|
String? get selectedProviderId;
|
|
String? get selectedModelId;
|
|
int get revision;
|
|
|
|
/// Create a copy of AgentSettingsState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$AgentSettingsStateCopyWith<AgentSettingsState> get copyWith =>
|
|
_$AgentSettingsStateCopyWithImpl<AgentSettingsState>(
|
|
this as AgentSettingsState,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
final _this = this as AgentSettingsState;
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is AgentSettingsState &&
|
|
(identical(other.enabled, _this.enabled) ||
|
|
other.enabled == _this.enabled) &&
|
|
const DeepCollectionEquality().equals(
|
|
other.providers,
|
|
_this.providers,
|
|
) &&
|
|
(identical(other.selectedProviderId, _this.selectedProviderId) ||
|
|
other.selectedProviderId == _this.selectedProviderId) &&
|
|
(identical(other.selectedModelId, _this.selectedModelId) ||
|
|
other.selectedModelId == _this.selectedModelId) &&
|
|
(identical(other.revision, _this.revision) ||
|
|
other.revision == _this.revision));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
final _this = this as AgentSettingsState;
|
|
return Object.hash(
|
|
runtimeType,
|
|
_this.enabled,
|
|
const DeepCollectionEquality().hash(_this.providers),
|
|
_this.selectedProviderId,
|
|
_this.selectedModelId,
|
|
_this.revision,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
final _this = this as AgentSettingsState;
|
|
return 'AgentSettingsState(enabled: ${_this.enabled}, providers: ${_this.providers}, selectedProviderId: ${_this.selectedProviderId}, selectedModelId: ${_this.selectedModelId}, revision: ${_this.revision})';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $AgentSettingsStateCopyWith<$Res> {
|
|
factory $AgentSettingsStateCopyWith(
|
|
AgentSettingsState value,
|
|
$Res Function(AgentSettingsState) _then,
|
|
) = _$AgentSettingsStateCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
bool enabled,
|
|
List<AgentProviderSettings> providers,
|
|
String? selectedProviderId,
|
|
String? selectedModelId,
|
|
int revision,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$AgentSettingsStateCopyWithImpl<$Res>
|
|
implements $AgentSettingsStateCopyWith<$Res> {
|
|
_$AgentSettingsStateCopyWithImpl(this._self, this._then);
|
|
|
|
final AgentSettingsState _self;
|
|
final $Res Function(AgentSettingsState) _then;
|
|
|
|
/// Create a copy of AgentSettingsState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? enabled = null,
|
|
Object? providers = null,
|
|
Object? selectedProviderId = freezed,
|
|
Object? selectedModelId = freezed,
|
|
Object? revision = null,
|
|
}) {
|
|
return _then(
|
|
AgentSettingsState(
|
|
enabled: null == enabled
|
|
? _self.enabled
|
|
: enabled // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
providers: null == providers
|
|
? _self.providers
|
|
: providers // ignore: cast_nullable_to_non_nullable
|
|
as List<AgentProviderSettings>,
|
|
selectedProviderId: freezed == selectedProviderId
|
|
? _self.selectedProviderId
|
|
: selectedProviderId // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
selectedModelId: freezed == selectedModelId
|
|
? _self.selectedModelId
|
|
: selectedModelId // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
revision: null == revision
|
|
? _self.revision
|
|
: revision // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Adds pattern-matching-related methods to [AgentSettingsState].
|
|
extension AgentSettingsStatePatterns on AgentSettingsState {
|
|
/// A variant of `map` that fallback to returning `orElse`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeMap<TResult extends Object?>(
|
|
TResult Function(_AgentSettingsState value)? $default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentSettingsState() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// Callbacks receives the raw object, upcasted.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case final Subclass2 value:
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult map<TResult extends Object?>(
|
|
TResult Function(_AgentSettingsState value) $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentSettingsState():
|
|
return $default(_that);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `map` that fallback to returning `null`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? mapOrNull<TResult extends Object?>(
|
|
TResult? Function(_AgentSettingsState value)? $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentSettingsState() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to an `orElse` callback.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeWhen<TResult extends Object?>(
|
|
TResult Function(
|
|
bool enabled,
|
|
List<AgentProviderSettings> providers,
|
|
String? selectedProviderId,
|
|
String? selectedModelId,
|
|
int revision,
|
|
)?
|
|
$default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentSettingsState() when $default != null:
|
|
return $default(
|
|
_that.enabled,
|
|
_that.providers,
|
|
_that.selectedProviderId,
|
|
_that.selectedModelId,
|
|
_that.revision,
|
|
);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// As opposed to `map`, this offers destructuring.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case Subclass2(:final field2):
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult when<TResult extends Object?>(
|
|
TResult Function(
|
|
bool enabled,
|
|
List<AgentProviderSettings> providers,
|
|
String? selectedProviderId,
|
|
String? selectedModelId,
|
|
int revision,
|
|
)
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentSettingsState():
|
|
return $default(
|
|
_that.enabled,
|
|
_that.providers,
|
|
_that.selectedProviderId,
|
|
_that.selectedModelId,
|
|
_that.revision,
|
|
);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to returning `null`
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? whenOrNull<TResult extends Object?>(
|
|
TResult? Function(
|
|
bool enabled,
|
|
List<AgentProviderSettings> providers,
|
|
String? selectedProviderId,
|
|
String? selectedModelId,
|
|
int revision,
|
|
)?
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _AgentSettingsState() when $default != null:
|
|
return $default(
|
|
_that.enabled,
|
|
_that.providers,
|
|
_that.selectedProviderId,
|
|
_that.selectedModelId,
|
|
_that.revision,
|
|
);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
class _AgentSettingsState extends AgentSettingsState {
|
|
const _AgentSettingsState({
|
|
this.enabled = false,
|
|
List<AgentProviderSettings> providers = const [],
|
|
this.selectedProviderId,
|
|
this.selectedModelId,
|
|
this.revision = 0,
|
|
}) : _providers = providers,
|
|
super._();
|
|
|
|
@override
|
|
@JsonKey()
|
|
final bool enabled;
|
|
final List<AgentProviderSettings> _providers;
|
|
@override
|
|
@JsonKey()
|
|
List<AgentProviderSettings> get providers {
|
|
if (_providers is EqualUnmodifiableListView) return _providers;
|
|
// ignore: implicit_dynamic_type
|
|
return EqualUnmodifiableListView(_providers);
|
|
}
|
|
|
|
@override
|
|
final String? selectedProviderId;
|
|
@override
|
|
final String? selectedModelId;
|
|
@override
|
|
@JsonKey()
|
|
final int revision;
|
|
|
|
/// Create a copy of AgentSettingsState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$AgentSettingsStateCopyWith<_AgentSettingsState> get copyWith =>
|
|
__$AgentSettingsStateCopyWithImpl<_AgentSettingsState>(this, _$identity);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _AgentSettingsState &&
|
|
(identical(other.enabled, enabled) || other.enabled == enabled) &&
|
|
const DeepCollectionEquality().equals(
|
|
other.providers,
|
|
_providers,
|
|
) &&
|
|
(identical(other.selectedProviderId, selectedProviderId) ||
|
|
other.selectedProviderId == selectedProviderId) &&
|
|
(identical(other.selectedModelId, selectedModelId) ||
|
|
other.selectedModelId == selectedModelId) &&
|
|
(identical(other.revision, revision) ||
|
|
other.revision == revision));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
return Object.hash(
|
|
runtimeType,
|
|
enabled,
|
|
const DeepCollectionEquality().hash(_providers),
|
|
selectedProviderId,
|
|
selectedModelId,
|
|
revision,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AgentSettingsState(enabled: $enabled, providers: $providers, selectedProviderId: $selectedProviderId, selectedModelId: $selectedModelId, revision: $revision)';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$AgentSettingsStateCopyWith<$Res>
|
|
implements $AgentSettingsStateCopyWith<$Res> {
|
|
factory _$AgentSettingsStateCopyWith(
|
|
_AgentSettingsState value,
|
|
$Res Function(_AgentSettingsState) _then,
|
|
) = __$AgentSettingsStateCopyWithImpl;
|
|
@override
|
|
@useResult
|
|
$Res call({
|
|
bool enabled,
|
|
List<AgentProviderSettings> providers,
|
|
String? selectedProviderId,
|
|
String? selectedModelId,
|
|
int revision,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$AgentSettingsStateCopyWithImpl<$Res>
|
|
implements _$AgentSettingsStateCopyWith<$Res> {
|
|
__$AgentSettingsStateCopyWithImpl(this._self, this._then);
|
|
|
|
final _AgentSettingsState _self;
|
|
final $Res Function(_AgentSettingsState) _then;
|
|
|
|
/// Create a copy of AgentSettingsState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$Res call({
|
|
Object? enabled = null,
|
|
Object? providers = null,
|
|
Object? selectedProviderId = freezed,
|
|
Object? selectedModelId = freezed,
|
|
Object? revision = null,
|
|
}) {
|
|
return _then(
|
|
_AgentSettingsState(
|
|
enabled: null == enabled
|
|
? _self.enabled
|
|
: enabled // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
providers: null == providers
|
|
? _self._providers
|
|
: providers // ignore: cast_nullable_to_non_nullable
|
|
as List<AgentProviderSettings>,
|
|
selectedProviderId: freezed == selectedProviderId
|
|
? _self.selectedProviderId
|
|
: selectedProviderId // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
selectedModelId: freezed == selectedModelId
|
|
? _self.selectedModelId
|
|
: selectedModelId // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
revision: null == revision
|
|
? _self.revision
|
|
: revision // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
),
|
|
);
|
|
}
|
|
}
|