Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b8fa3e7a0 |
+7
-12
@@ -38,7 +38,6 @@ def _get_vector_store() -> PGVector:
|
|||||||
connection=_pgvector_url,
|
connection=_pgvector_url,
|
||||||
use_jsonb=True,
|
use_jsonb=True,
|
||||||
create_extension=False, # created by docker init script
|
create_extension=False, # created by docker init script
|
||||||
async_mode=True,
|
|
||||||
)
|
)
|
||||||
return _vector_store
|
return _vector_store
|
||||||
|
|
||||||
@@ -60,17 +59,13 @@ text_splitter = RecursiveCharacterTextSplitter(
|
|||||||
def _get_collection_id():
|
def _get_collection_id():
|
||||||
"""Get the UUID of our collection from the langchain_pg_collection table."""
|
"""Get the UUID of our collection from the langchain_pg_collection table."""
|
||||||
engine = _get_engine()
|
engine = _get_engine()
|
||||||
try:
|
with engine.connect() as conn:
|
||||||
with engine.connect() as conn:
|
result = conn.execute(
|
||||||
result = conn.execute(
|
text("SELECT uuid FROM langchain_pg_collection WHERE name = :name"),
|
||||||
text("SELECT uuid FROM langchain_pg_collection WHERE name = :name"),
|
{"name": "simba_docs"},
|
||||||
{"name": "simba_docs"},
|
)
|
||||||
)
|
row = result.fetchone()
|
||||||
row = result.fetchone()
|
return row[0] if row else None
|
||||||
return row[0] if row else None
|
|
||||||
except Exception:
|
|
||||||
# Table doesn't exist yet (first run before any indexing)
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def date_to_epoch(date_str: str) -> float:
|
def date_to_epoch(date_str: str) -> float:
|
||||||
|
|||||||
Reference in New Issue
Block a user