Table of Contents

Class CollectionVectorAttribute

Namespace
DataStax.AstraDB.DataApi.Core
Assembly
DataStax.AstraDB.DataApi.dll

Specifies vector options for a collection.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class CollectionVectorAttribute : Attribute, _Attribute
Inheritance
CollectionVectorAttribute
Implements
Inherited Members

Constructors

CollectionVectorAttribute()

Initializes a new instance of CollectionVectorAttribute with default settings.

public CollectionVectorAttribute()

CollectionVectorAttribute(SimilarityMetric, int, string)

Initializes a new instance with the specified metric and optionally other settings.

public CollectionVectorAttribute(SimilarityMetric metric, int dimension = -1, string sourceModel = null)

Parameters

metric SimilarityMetric

The similarity metric to use for vector comparisons.

dimension int

Optional. The number of dimensions for the vector.

sourceModel string

Optional. The source model for embeddings optimization.

CollectionVectorAttribute(int, string)

Initializes a new instance, optionally specifying various settings.

public CollectionVectorAttribute(int dimension = -1, string sourceModel = null)

Parameters

dimension int

Optional. The number of dimensions for the vector.

sourceModel string

Optional. The source model for embeddings optimization.

Properties

Dimension

The number of dimensions for the vector.

public int? Dimension { get; set; }

Property Value

int?

Metric

The similarity metric to use for vector comparisons.

public SimilarityMetric? Metric { get; set; }

Property Value

SimilarityMetric?

SourceModel

Configures the index with the fastest settings for a given source of embeddings vectors. Example values include 'openai-v3-large', 'cohere-v3', 'bert'. Defaults to 'other' if not set.

public string SourceModel { get; set; }

Property Value

string