// Or, if vectorize (auto-embedding-generation) is enabled: awaittable.insertOne({ vectorCol:'Alice went to the beach', });
Keep in mind though, that a vector index must still be created on this column (through Table.createVectorIndex or CQL directly) to enable vector search on this column.
You may specify the service block to enable vectorize (auto-embedding-generation) for the column.
If this is configured, then you can pass a string to the vector column instead of a vector directly, and have the Data API automatically embed it for you, using the model of your choice.
If the service field is present, then InferTableSchema will also type the column as string | DataAPIVector | null instead of just DataAPIVector | null.
Overview
Represents the syntax for defining a
vectorcolumn in a table, which has no shorthand/"loose" equivalent.Of the example format:
This may then be used through
astra-db-tsas aDataAPIVector:Keep in mind though, that a vector index must still be created on this column (through Table.createVectorIndex or CQL directly) to enable vector search on this column.
The dimension
The
dimensionmust be a positive integer, and represents the number of elements in the vector.Note that, at the time of writing, the dimension must still be specified, even if a
serviceblock is present.The service block
You may specify the
serviceblock to enable vectorize (auto-embedding-generation) for the column.If this is configured, then you can pass a
stringto the vector column instead of a vector directly, and have the Data API automatically embed it for you, using the model of your choice.If the
servicefield is present, then InferTableSchema will also type the column asstring | DataAPIVector | nullinstead of justDataAPIVector | null.See