module Hnswlib VERSION: ::String HSWLIB_VERSION: ::String class HnswIndex attr_reader metric: String def initialize: (n_features: Integer n_features, max_item: Integer max_item, ?metric: ::String metric, ?m: ::Integer m, ?ef_construction: ::Integer ef_construction, ?random_seed: ::Integer random_seed) -> void def add_item: (Integer i, Array[Float] v) -> bool def get_item: (Integer i) -> Array[Float] def remove_item: (Integer i) -> void def get_nns_by_item: (Integer i, Integer n, ?include_distances: (true | false) include_distances) -> ([Array[Integer], Array[Float]] | Array[Integer]) def get_nns_by_vector: (Array[Float] v, Integer n, ?include_distances: (true | false) include_distances) -> ([Array[Integer], Array[Float]] | Array[Integer]) def resize_index: (Integer new_max_item) -> void def set_ef: (Integer ef) -> void def save: (String filename) -> void def load: (String filename) -> void def get_distance: (Integer i, Integer j) -> Float def n_items: () -> Integer def n_features: () -> Integer def max_item: () -> Integer end Index: untyped class L2Space attr_accessor dim: Integer def initialize: (Integer dim) -> void def distance: (Array[Float] a, Array[Float] b) -> Float end class InnerProductSpace attr_accessor dim: Integer def initialize: (Integer dim) -> void def distance: (Array[Float] a, Array[Float] b) -> Float end class BruteforceSearch attr_accessor space: (::Hnswlib::L2Space | ::Hnswlib::InnerProductSpace) def initialize: (space: (::Hnswlib::L2Space | ::Hnswlib::InnerProductSpace) space, max_elements: Integer max_elements) -> void def add_point: (Array[Float] arr, Integer idx) -> bool def current_count: () -> Integer def load_index: (String filename) -> void def max_elements: () -> Integer def remove_point: (Integer idx) -> void def save_index: (String filename) -> void def search_knn: (Array[Float] arr, Integer k) -> [Array[Integer], Array[Float]] end class HierarchicalNSW attr_accessor space: (::Hnswlib::L2Space | ::Hnswlib::InnerProductSpace) def initialize: (space: (::Hnswlib::L2Space | ::Hnswlib::InnerProductSpace) space, max_elements: Integer max_elements, ?m: Integer m, ?ef_construction: Integer ef_construction, ?random_seed: Integer random_seed) -> void def add_point: (Array[Float] arr, Integer idx) -> bool def current_count: () -> Integer def get_ids: () -> Array[Integer] def get_point: (Integer idx) -> Array[Float] def load_index: (String filename) -> void def mark_deleted: (Integer idx) -> void def max_elements: () -> Integer def resize_index: (Integer new_max_elements) -> void def save_index: (String filename) -> void def search_knn: (Array[Float] arr, Integer k) -> [Array[Integer], Array[Float]] def set_ef: (Integer ef) -> void end end