SearchApiParameters constructor

SearchApiParameters(
  1. String query, {
  2. List<String>? documents,
  3. String? file,
  4. int maxRerank = 200,
  5. bool returnMetadata = false,
})

Implementation

SearchApiParameters(this.query,
    {this.documents,
    this.file,
    this.maxRerank = 200,
    this.returnMetadata = false}) {
  if (documents == null && file == null) {
    throw ArgumentError(
        'Either the documents argument or the file argument needs to be provided.');
  }
  if (documents != null && file != null) {
    throw ArgumentError(
        'You can only provide the documents or the file argument, but not both.');
  }
}