Skip to content

Commit

Permalink
code formating
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsbatista committed Feb 13, 2024
1 parent 696c5b9 commit 88b4725
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion integrations/pgvector/examples/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Download some Markdown files to index.
# git clone https://github.com/anakin87/neural-search-pills

import os
import glob

from haystack import Pipeline
Expand All @@ -20,9 +21,10 @@
from haystack_integrations.components.retrievers.pgvector import PgvectorEmbeddingRetriever
from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore

os.environ["PG_CONN_STR"] = "postgresql://postgres:postgres@localhost:5432/postgres"

# Initialize PgvectorDocumentStore
document_store = PgvectorDocumentStore(
connection_string="postgresql://postgres:postgres@localhost:5432/postgres",
table_name="haystack_test",
embedding_dimension=768,
vector_function="cosine_similarity",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ def __init__(
https://github.com/pgvector/pgvector?tab=readme-ov-file#hnsw
"""

self.connection_string = connection_string if isinstance(connection_string, str) else connection_string.resolve_value()
self.connection_string = (
connection_string if isinstance(connection_string, str) else connection_string.resolve_value()
)
self.table_name = table_name
self.embedding_dimension = embedding_dimension
if vector_function not in VALID_VECTOR_FUNCTIONS:
Expand Down

0 comments on commit 88b4725

Please sign in to comment.