Skip to content

Commit

Permalink
fix: Make quote nullable in MessageContentTextAnnotationsFileCitation (
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmigloz authored May 20, 2024
1 parent 3d0281a commit 75b9564
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MessageContentTextAnnotationsFileCitation
@JsonKey(name: 'file_id') required String fileId,

/// The specific quote in the file.
required String quote,
@JsonKey(includeIfNull: false) String? quote,
}) = _MessageContentTextAnnotationsFileCitation;

/// Object construction from a JSON representation
Expand Down
34 changes: 21 additions & 13 deletions packages/openai_dart/lib/src/generated/schema/schema.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40379,7 +40379,8 @@ mixin _$MessageContentTextAnnotationsFileCitation {
String get fileId => throw _privateConstructorUsedError;

/// The specific quote in the file.
String get quote => throw _privateConstructorUsedError;
@JsonKey(includeIfNull: false)
String? get quote => throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
Expand All @@ -40396,7 +40397,9 @@ abstract class $MessageContentTextAnnotationsFileCitationCopyWith<$Res> {
_$MessageContentTextAnnotationsFileCitationCopyWithImpl<$Res,
MessageContentTextAnnotationsFileCitation>;
@useResult
$Res call({@JsonKey(name: 'file_id') String fileId, String quote});
$Res call(
{@JsonKey(name: 'file_id') String fileId,
@JsonKey(includeIfNull: false) String? quote});
}

/// @nodoc
Expand All @@ -40415,17 +40418,17 @@ class _$MessageContentTextAnnotationsFileCitationCopyWithImpl<$Res,
@override
$Res call({
Object? fileId = null,
Object? quote = null,
Object? quote = freezed,
}) {
return _then(_value.copyWith(
fileId: null == fileId
? _value.fileId
: fileId // ignore: cast_nullable_to_non_nullable
as String,
quote: null == quote
quote: freezed == quote
? _value.quote
: quote // ignore: cast_nullable_to_non_nullable
as String,
as String?,
) as $Val);
}
}
Expand All @@ -40439,7 +40442,9 @@ abstract class _$$MessageContentTextAnnotationsFileCitationImplCopyWith<$Res>
__$$MessageContentTextAnnotationsFileCitationImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({@JsonKey(name: 'file_id') String fileId, String quote});
$Res call(
{@JsonKey(name: 'file_id') String fileId,
@JsonKey(includeIfNull: false) String? quote});
}

/// @nodoc
Expand All @@ -40456,17 +40461,17 @@ class __$$MessageContentTextAnnotationsFileCitationImplCopyWithImpl<$Res>
@override
$Res call({
Object? fileId = null,
Object? quote = null,
Object? quote = freezed,
}) {
return _then(_$MessageContentTextAnnotationsFileCitationImpl(
fileId: null == fileId
? _value.fileId
: fileId // ignore: cast_nullable_to_non_nullable
as String,
quote: null == quote
quote: freezed == quote
? _value.quote
: quote // ignore: cast_nullable_to_non_nullable
as String,
as String?,
));
}
}
Expand All @@ -40476,7 +40481,8 @@ class __$$MessageContentTextAnnotationsFileCitationImplCopyWithImpl<$Res>
class _$MessageContentTextAnnotationsFileCitationImpl
extends _MessageContentTextAnnotationsFileCitation {
const _$MessageContentTextAnnotationsFileCitationImpl(
{@JsonKey(name: 'file_id') required this.fileId, required this.quote})
{@JsonKey(name: 'file_id') required this.fileId,
@JsonKey(includeIfNull: false) this.quote})
: super._();

factory _$MessageContentTextAnnotationsFileCitationImpl.fromJson(
Expand All @@ -40490,7 +40496,8 @@ class _$MessageContentTextAnnotationsFileCitationImpl

/// The specific quote in the file.
@override
final String quote;
@JsonKey(includeIfNull: false)
final String? quote;

@override
String toString() {
Expand Down Expand Up @@ -40532,7 +40539,7 @@ abstract class _MessageContentTextAnnotationsFileCitation
extends MessageContentTextAnnotationsFileCitation {
const factory _MessageContentTextAnnotationsFileCitation(
{@JsonKey(name: 'file_id') required final String fileId,
required final String quote}) =
@JsonKey(includeIfNull: false) final String? quote}) =
_$MessageContentTextAnnotationsFileCitationImpl;
const _MessageContentTextAnnotationsFileCitation._() : super._();

Expand All @@ -40548,7 +40555,8 @@ abstract class _MessageContentTextAnnotationsFileCitation
@override

/// The specific quote in the file.
String get quote;
@JsonKey(includeIfNull: false)
String? get quote;
@override
@JsonKey(ignore: true)
_$$MessageContentTextAnnotationsFileCitationImplCopyWith<
Expand Down
21 changes: 15 additions & 6 deletions packages/openai_dart/lib/src/generated/schema/schema.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/openai_dart/oas/openapi_curated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4890,7 +4890,7 @@ components:
type: string
required:
- file_id
- quote
# - quote # https://github.com/openai/openai-openapi/issues/263
MessageContentTextAnnotationsFilePathObject:
type: object
description: A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.
Expand Down

0 comments on commit 75b9564

Please sign in to comment.