Class: Boxcars::VectorStore::Pgvector::SaveToDatabase

Inherits:
Object
  • Object
show all
Includes:
Boxcars::VectorStore
Defined in:
lib/boxcars/vector_store/pgvector/save_to_database.rb

Instance Method Summary collapse

Methods included from Boxcars::VectorStore

included

Constructor Details

#initialize(params) ⇒ Array

Returns array of Boxcars::VectorStore::Document.

Parameters:

  • pg_vectors (Array)

    array of Boxcars::VectorStore::Document

  • database_url (String)

    database url

  • table_name (String)

    table name

  • embedding_column_name (String)

    embedding column name

  • content_column_name (String)

    content column name

  • metadata_column_name (String)

    metadata column name



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/boxcars/vector_store/pgvector/save_to_database.rb', line 19

def initialize(params)
  validate_param_types(params)
  @db_connection = test_db_params(params)

  @table_name = params[:table_name]
  @content_column_name = params[:content_column_name]
  @embedding_column_name = params[:embedding_column_name]
  @metadata_column_name = params[:metadata_column_name]

  @pg_vectors = params[:pg_vectors]
end

Instance Method Details

#callArray

Returns array of Boxcars::VectorStore::Document.

Returns:

  • (Array)

    array of Boxcars::VectorStore::Document



32
33
34
# File 'lib/boxcars/vector_store/pgvector/save_to_database.rb', line 32

def call
  add_vectors_to_database
end