ResponseFormat constructor

ResponseFormat({
  1. required ResponseFormatType type,
  2. Map<String, dynamic>? schema,
  3. String? name,
  4. bool? strict,
})

Implementation

ResponseFormat({
  required this.type,
  this.schema,
  this.name,
  this.strict,
}) {
  if (type == ResponseFormatType.jsonSchema && schema == null) {
    throw ArgumentError(
      'schema is required when type is ResponseFormatType.jsonSchema',
      'schema',
    );
  }
}