ProviderQueueEntry constructor

ProviderQueueEntry({
  1. required String providerType,
  2. required String model,
  3. String? baseUrl,
  4. String? apiKeyEnv,
  5. int? contextWindow,
  6. int? maxTokens,
  7. String? ref,
})

Creates a validated entry. Throws ArgumentError on an unknown provider type or a blank model (the same strictness the parsers enforce, available to the editor).

Implementation

ProviderQueueEntry({
  required this.providerType,
  required this.model,
  this.baseUrl,
  this.apiKeyEnv,
  this.contextWindow,
  this.maxTokens,
  this.ref,
}) {
  if (!providerQueueKinds.contains(providerType)) {
    throw ArgumentError.value(
      providerType,
      'providerType',
      'unknown provider_type — supported: ${providerQueueKinds.join(', ')}',
    );
  }
  if (model.trim().isEmpty) {
    throw ArgumentError.value(model, 'model', 'must be a non-empty string');
  }
}