Represents a vector entry stored in or retrieved from a Ruvector database.
An entry consists of:
id: Optional unique UTF-8 string identifier (auto-generated UUID if omitted upon insert).vector: List of floating point numbers representing the vector embedding (stored as 32-bitf32in Rust; non-dyadic 64-bit floats are rounded tof32precision on insert).metadata: Optional arbitrary map of JSON-serializable key-value metadata.
Summary
Functions
Converts a map returned by RuvectorElixir.get/2 into a VectorEntry struct.
Creates a new VectorEntry struct.
Types
Functions
Converts a map returned by RuvectorElixir.get/2 into a VectorEntry struct.
Examples
iex> map = %{id: "doc_1", vector: [0.1, 0.2], metadata: %{"tag" => "A"}}
iex> RuvectorElixir.VectorEntry.from_map(map)
%RuvectorElixir.VectorEntry{id: "doc_1", vector: [0.1, 0.2], metadata: %{"tag" => "A"}}
Creates a new VectorEntry struct.
Accepts vectors with finite f32-representable float or integer components (automatically
converted to floats).
Options
:id- Unique UTF-8 string identifier (or non-boolean atom / integer).:metadata- Plain map of JSON-serializable metadata attributes. Atom keys and non-boolean/non-nilatom values are canonicalized to strings soRuvectorElixir.get_struct/2round-trips identically.
Examples
iex> RuvectorElixir.VectorEntry.new([1.0, 2.0, 3.0])
%RuvectorElixir.VectorEntry{id: nil, vector: [1.0, 2.0, 3.0], metadata: nil}
iex> RuvectorElixir.VectorEntry.new([1, 2, 3], id: "vec_1", metadata: %{"label" => "sample"})
%RuvectorElixir.VectorEntry{id: "vec_1", vector: [1.0, 2.0, 3.0], metadata: %{"label" => "sample"}}