putVectors method

Future<void> putVectors(
  1. List<Vector> vectors
)

Inserts or updates a batch of vectors in this index.

The batch must contain between 1 and 500 vectors.

Implementation

Future<void> putVectors(List<Vector> vectors) async {
  if (vectors.isEmpty || vectors.length > 500) {
    throw ArgumentError('Vector batch size must be between 1 and 500 items');
  }
  await _storageFetch.post(
    '$_url/PutVectors',
    {
      'vectorBucketName': bucketName,
      'indexName': indexName,
      'vectors': vectors.map((vector) => vector.toJson()).toList(),
    },
    options: _options,
  );
}