Skip to main content

validate_vector_shape

Function validate_vector_shape 

Source
pub fn validate_vector_shape(
    surface: &str,
    label: &str,
    vector: &[f32],
    expected_dimension: usize,
) -> Result<()>
Expand description

Validate vector dimension and finite values for vector-store calls.

Reach for this on the caller-input boundary of every VectorStore impl (add / search / update) so all backends reject the same two malformations — wrong dimension and non-finite element — with identical error wording. Returns Error::InvalidRequest because vectors passed into a crate::VectorStore are caller input at the store boundary.