// 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
vector
column in a table, which has no shorthand/"loose" equivalent.Of the example format:
This may then be used through
astra-db-ts
as 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
dimension
must 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
service
block is present.The service block
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 asstring | DataAPIVector | null
instead of justDataAPIVector | null
.See