Class: Boxcars::VectorStore::InMemory::Search
- Inherits:
-
Object
- Object
- Boxcars::VectorStore::InMemory::Search
- Includes:
- Boxcars::VectorStore
- Defined in:
- lib/boxcars/vector_store/in_memory/search.rb
Instance Method Summary collapse
- #call(query_vector:, count: 1) ⇒ Object
-
#initialize(params) ⇒ Search
constructor
initialize the vector store InMemory::Search with the following parameters:.
Methods included from Boxcars::VectorStore
Constructor Details
#initialize(params) ⇒ Search
initialize the vector store InMemory::Search with the following parameters:
13 14 15 16 |
# File 'lib/boxcars/vector_store/in_memory/search.rb', line 13 def initialize(params) validate_params(params[:vector_documents]) @vector_documents = params[:vector_documents] end |
Instance Method Details
#call(query_vector:, count: 1) ⇒ Object
18 19 20 21 22 |
# File 'lib/boxcars/vector_store/in_memory/search.rb', line 18 def call(query_vector:, count: 1) raise ::Boxcars::ArgumentError, 'query_vector is empty' if query_vector.empty? search(query_vector, count) end |