llama-index-vector-stores-postgres 0.2.2__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {llama_index_vector_stores_postgres-0.2.2 → llama_index_vector_stores_postgres-0.2.4}/PKG-INFO +1 -1
- {llama_index_vector_stores_postgres-0.2.2 → llama_index_vector_stores_postgres-0.2.4}/llama_index/vector_stores/postgres/base.py +13 -2
- {llama_index_vector_stores_postgres-0.2.2 → llama_index_vector_stores_postgres-0.2.4}/pyproject.toml +1 -1
- {llama_index_vector_stores_postgres-0.2.2 → llama_index_vector_stores_postgres-0.2.4}/README.md +0 -0
- {llama_index_vector_stores_postgres-0.2.2 → llama_index_vector_stores_postgres-0.2.4}/llama_index/py.typed +0 -0
- {llama_index_vector_stores_postgres-0.2.2 → llama_index_vector_stores_postgres-0.2.4}/llama_index/vector_stores/postgres/__init__.py +0 -0
|
@@ -148,6 +148,7 @@ class PGVectorStore(BasePydanticVectorStore):
|
|
|
148
148
|
perform_setup: bool
|
|
149
149
|
debug: bool
|
|
150
150
|
use_jsonb: bool
|
|
151
|
+
create_engine_kwargs: Dict
|
|
151
152
|
|
|
152
153
|
hnsw_kwargs: Optional[Dict[str, Any]]
|
|
153
154
|
|
|
@@ -173,6 +174,7 @@ class PGVectorStore(BasePydanticVectorStore):
|
|
|
173
174
|
debug: bool = False,
|
|
174
175
|
use_jsonb: bool = False,
|
|
175
176
|
hnsw_kwargs: Optional[Dict[str, Any]] = None,
|
|
177
|
+
create_engine_kwargs: Optional[Dict[str, Any]] = None,
|
|
176
178
|
) -> None:
|
|
177
179
|
"""Constructor.
|
|
178
180
|
|
|
@@ -191,6 +193,7 @@ class PGVectorStore(BasePydanticVectorStore):
|
|
|
191
193
|
hnsw_kwargs (Optional[Dict[str, Any]], optional): HNSW kwargs, a dict that
|
|
192
194
|
contains "hnsw_ef_construction", "hnsw_ef_search", "hnsw_m", and optionally "hnsw_dist_method". Defaults to None,
|
|
193
195
|
which turns off HNSW search.
|
|
196
|
+
create_engine_kwargs (Optional[Dict[str, Any]], optional): Engine parameters to pass to create_engine. Defaults to None.
|
|
194
197
|
"""
|
|
195
198
|
table_name = table_name.lower()
|
|
196
199
|
schema_name = schema_name.lower()
|
|
@@ -216,6 +219,7 @@ class PGVectorStore(BasePydanticVectorStore):
|
|
|
216
219
|
debug=debug,
|
|
217
220
|
use_jsonb=use_jsonb,
|
|
218
221
|
hnsw_kwargs=hnsw_kwargs,
|
|
222
|
+
create_engine_kwargs=create_engine_kwargs or {},
|
|
219
223
|
)
|
|
220
224
|
|
|
221
225
|
# sqlalchemy model
|
|
@@ -264,6 +268,7 @@ class PGVectorStore(BasePydanticVectorStore):
|
|
|
264
268
|
debug: bool = False,
|
|
265
269
|
use_jsonb: bool = False,
|
|
266
270
|
hnsw_kwargs: Optional[Dict[str, Any]] = None,
|
|
271
|
+
create_engine_kwargs: Optional[Dict[str, Any]] = None,
|
|
267
272
|
) -> "PGVectorStore":
|
|
268
273
|
"""Construct from params.
|
|
269
274
|
|
|
@@ -287,6 +292,7 @@ class PGVectorStore(BasePydanticVectorStore):
|
|
|
287
292
|
hnsw_kwargs (Optional[Dict[str, Any]], optional): HNSW kwargs, a dict that
|
|
288
293
|
contains "hnsw_ef_construction", "hnsw_ef_search", "hnsw_m", and optionally "hnsw_dist_method". Defaults to None,
|
|
289
294
|
which turns off HNSW search.
|
|
295
|
+
create_engine_kwargs (Optional[Dict[str, Any]], optional): Engine parameters to pass to create_engine. Defaults to None.
|
|
290
296
|
|
|
291
297
|
Returns:
|
|
292
298
|
PGVectorStore: Instance of PGVectorStore constructed from params.
|
|
@@ -311,6 +317,7 @@ class PGVectorStore(BasePydanticVectorStore):
|
|
|
311
317
|
debug=debug,
|
|
312
318
|
use_jsonb=use_jsonb,
|
|
313
319
|
hnsw_kwargs=hnsw_kwargs,
|
|
320
|
+
create_engine_kwargs=create_engine_kwargs,
|
|
314
321
|
)
|
|
315
322
|
|
|
316
323
|
@property
|
|
@@ -324,10 +331,14 @@ class PGVectorStore(BasePydanticVectorStore):
|
|
|
324
331
|
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
|
|
325
332
|
from sqlalchemy.orm import sessionmaker
|
|
326
333
|
|
|
327
|
-
self._engine = create_engine(
|
|
334
|
+
self._engine = create_engine(
|
|
335
|
+
self.connection_string, echo=self.debug, **self.create_engine_kwargs
|
|
336
|
+
)
|
|
328
337
|
self._session = sessionmaker(self._engine)
|
|
329
338
|
|
|
330
|
-
self._async_engine = create_async_engine(
|
|
339
|
+
self._async_engine = create_async_engine(
|
|
340
|
+
self.async_connection_string, **self.create_engine_kwargs
|
|
341
|
+
)
|
|
331
342
|
self._async_session = sessionmaker(self._async_engine, class_=AsyncSession) # type: ignore
|
|
332
343
|
|
|
333
344
|
def _create_schema_if_not_exists(self) -> None:
|
{llama_index_vector_stores_postgres-0.2.2 → llama_index_vector_stores_postgres-0.2.4}/README.md
RENAMED
|
File without changes
|
|
File without changes
|