ModelInfo constructor

ModelInfo({
  1. required String id,
  2. required String name,
  3. required ModelCategory category,
  4. required ModelFormat format,
  5. required InferenceFramework framework,
  6. Uri? downloadURL,
  7. Uri? localPath,
  8. ModelArtifactType? artifactType,
  9. int? downloadSize,
  10. int? contextLength,
  11. bool supportsThinking = false,
  12. ThinkingTagPattern? thinkingPattern,
  13. String? description,
  14. ModelSource? source,
  15. DateTime? createdAt,
  16. DateTime? updatedAt,
})

Implementation

ModelInfo({
  required this.id,
  required this.name,
  required this.category,
  required this.format,
  required this.framework,
  this.downloadURL,
  this.localPath,
  ModelArtifactType? artifactType,
  this.downloadSize,
  int? contextLength,
  bool supportsThinking = false,
  ThinkingTagPattern? thinkingPattern,
  this.description,
  ModelSource? source,
  DateTime? createdAt,
  DateTime? updatedAt,
})  : artifactType =
          artifactType ?? ModelArtifactType.infer(downloadURL, format),
      contextLength = category.requiresContextLength
          ? (contextLength ?? 2048)
          : contextLength,
      supportsThinking = category.supportsThinking ? supportsThinking : false,
      thinkingPattern = (category.supportsThinking && supportsThinking)
          ? (thinkingPattern ?? ThinkingTagPattern.defaultPattern)
          : null,
      source = source ?? ModelSource.remote,
      createdAt = createdAt ?? DateTime.now(),
      updatedAt = updatedAt ?? DateTime.now();