Skip to main content
AskMe (beta)
Loading icon

%Library.Vector

datatype class %Library.Vector extends %Library.DataType

ODBC Type: VARCHAR

Datatype class for storing vector content, such as embeddings, in the native $vector format. See also the TO_VECTOR() SQL function to convert user input to the VECTOR datatype

Method Inventory

Parameters

parameter DATATYPE = FLOAT;
The datatype of the elements stored in the vector. Default to FLOAT (SQL type, corresponds to 'xf32' in ObjectScript), a significantly more storage-conscious option for Vector Search.
parameter LEN;
The number of elements the vector can contain.
parameter STORAGEDEFAULT = GLOBALNODE;
The number of elements the vector can contain.

Methods

classmethod DisplayToLogical(%val As %String) as %Vector
DisplayToLogical - If this is passed a dynamic array e.g. 'Set dynArray=[1,2,3,4]' then detect this with $isobject(%val) and then if it is an oref then test if it is a dynamic array and if so then walk this turning it into a vector so we can support JSON and dynamic arrays.
classmethod IsValid(%val As %Vector) as %Status
Inherited description: Return $$$OK if the value is valid for the datatype, or an error code otherwise.
classmethod LogicalToDisplay(%val As %Vector) as %String
classmethod LogicalToOdbc(%val As %Vector) as %String
classmethod Normalize(%val As %Vector) as %Vector
classmethod OdbcToLogical(%val As %String) as %Vector

Subclasses

FeedbackOpens in a new tab