File tree Expand file tree Collapse file tree 4 files changed +37
-12
lines changed
Expand file tree Collapse file tree 4 files changed +37
-12
lines changed Original file line number Diff line number Diff line change @@ -6,12 +6,15 @@ export 'sub_models/data.dart';
66
77@immutable
88final class OpenAIImageModel {
9- /// The time the image was created.
9+ /// The time the image was [ created] .
1010 final DateTime created;
1111
1212 /// The data of the image.
1313 final List <OpenAIImageData > data;
1414
15+ /// Weither the image have some [data] .
16+ bool get haveData => data.isNotEmpty;
17+
1518 @override
1619 int get hashCode => created.hashCode ^ data.hashCode;
1720
Original file line number Diff line number Diff line change 11import 'package:meta/meta.dart' ;
22
3+ /// {@template openai_image_data_model}
4+ /// This class is used to represent an OpenAI image data.
5+ /// {@endtemplate}
36@immutable
47final class OpenAIImageData {
5- /// The URL of the image.
8+ /// The [ URL] of the image.
69 final String ? url;
710
8- /// the [OpenAIImageResponseFormat] b64Json data
11+ /// The [b64Json] data.
912 final String ? b64Json;
1013
11- ///
14+ /// The revised prompt.
1215 final String ? revisedPrompt;
1316
17+ /// Weither the image have a [URL] result.
18+ bool get haveUrl => url != null ;
19+
20+ /// Weither the image have a [b64Json] result.
21+ bool get haveB64Json => b64Json != null ;
22+
23+ /// Weither the image have a revised prompt.
24+ bool get haveRevisedPrompt => revisedPrompt != null ;
25+
1426 @override
15- int get hashCode => url.hashCode;
27+ int get hashCode => url.hashCode ^ b64Json.hashCode ^ revisedPrompt.hashCode ;
1628
1729 /// This class is used to represent an OpenAI image data.
1830 const OpenAIImageData ({
Original file line number Diff line number Diff line change @@ -3,21 +3,27 @@ import 'package:meta/meta.dart';
33
44import 'sub_models/permission.dart' ;
55
6+ /// {@template openai_model_model}
7+ /// This class is used to represent an OpenAI model.
8+ /// {@endtemplate}
69@immutable
710final class OpenAIModelModel {
8- /// The ID of the model.
11+ /// The [id] entifier of the model.
912 final String id;
1013
1114 /// The name of the organization that owns the model.
1215 final String ownedBy;
1316
14- /// The permissions of the model.
17+ /// The [permission] s of the model.
1518 final List <OpenAIModelModelPermission >? permission;
1619
20+ /// Weither the model have at least one permission in [permission] .
21+ bool get havePermission => permission != null ;
22+
1723 @override
18- int get hashCode => id.hashCode ^ ownedBy.hashCode;
24+ int get hashCode => id.hashCode ^ ownedBy.hashCode ^ permission.hashCode ;
1925
20- /// This class is used to represent an OpenAI model.
26+ /// {@macro openai_model_model}
2127 const OpenAIModelModel ({
2228 required this .id,
2329 required this .ownedBy,
@@ -43,7 +49,8 @@ final class OpenAIModelModel {
4349 }
4450
4551 @override
46- String toString () => 'OpenAIModelModel(id: $id , ownedBy: $ownedBy )' ;
52+ String toString () =>
53+ 'OpenAIModelModel(id: $id , ownedBy: $ownedBy , permission: $permission )' ;
4754
4855 @override
4956 bool operator == (covariant OpenAIModelModel other) {
Original file line number Diff line number Diff line change 11import 'package:meta/meta.dart' ;
22
3+ /// {@template openai_model_model_permission}
4+ /// This class is used to represent an OpenAI model permission.
5+ /// {@endtemplate}
36@immutable
47final class OpenAIModelModelPermission {
5- /// The ID of the permission.
8+ /// The [id] entifier of the permission.
69 final String ? id;
710
8- /// The time the permission was created.
11+ /// The time the permission was [ created] .
912 final DateTime ? created;
1013
1114 /// Whether the permission allows the user to create engines.
You can’t perform that action at this time.
0 commit comments