ModelInfo constructor

const ModelInfo({
  1. required String id,
  2. String? displayName,
  3. String? description,
  4. String? ownedBy,
  5. int? created,
  6. int? inputTokenLimit,
  7. int? outputTokenLimit,
})

Information about an available model from a provider.

This class provides a standardized way to represent model metadata across different providers. Not all providers supply all fields.

Example:

final chatModel = ChatOpenAI(apiKey: '...');
final models = await chatModel.listModels();
for (final model in models) {
  print('${model.id} - ${model.displayName ?? ""}');
}

Implementation

const ModelInfo({
  required this.id,
  this.displayName,
  this.description,
  this.ownedBy,
  this.created,
  this.inputTokenLimit,
  this.outputTokenLimit,
});