[ Edit, Add ] edited and updated docs of file model directory files code

This commit is contained in:
Anas Fikhi
2023-11-22 03:27:06 +01:00
parent 8c7e988cd7
commit fb0cad3234
4 changed files with 16 additions and 4 deletions

View File

@ -23,6 +23,9 @@ final class OpenAIEmbeddingsModel {
/// Weither the embeddings have at least one item in [data].
bool get haveData => data.isNotEmpty;
/// Weither the embeddings have a usage information.
bool get haveUsage => usage != null;
@override
int get hashCode => data.hashCode ^ model.hashCode ^ usage.hashCode;

View File

@ -12,6 +12,9 @@ final class OpenAIEmbeddingsDataModel {
/// The index of the text.
final int index;
/// Weither the embeddings have at least one item in [embeddings].
bool get haveEmbeddings => embeddings.isNotEmpty;
@override
int get hashCode => embeddings.hashCode ^ index.hashCode;

View File

@ -11,6 +11,12 @@ final class OpenAIEmbeddingsUsageModel {
/// The total number of tokens in the prompt and completion.
final int? totalTokens;
/// Weither the usage have a prompt tokens information.
bool get havePromptTokens => promptTokens != null;
/// Weither the usage have a total tokens information.
bool get haveTotalTokens => totalTokens != null;
@override
int get hashCode => promptTokens.hashCode ^ totalTokens.hashCode;

View File

@ -5,19 +5,19 @@ import 'package:meta/meta.dart';
/// {@endtemplate}
@immutable
final class OpenAIFileModel {
/// The ID of the file. This is used to reference the file in other API calls.
/// The [id]entifier of the file. This is used to reference the file in other API calls.
final String id;
/// The size of the file in bytes.
/// The size of the file in [bytes].
final int bytes;
/// The date the file was created.
/// The date the file was [created].
final DateTime createdAt;
/// The name of the file.
final String fileName;
/// The purpose of the file.
/// The [purpose] of the file.
final String purpose;
@override