[ Edit, Add ] edited and updated docs of file model directory files code
This commit is contained in:
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user