mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac
This commit is contained in:
parent
7f488b3754
commit
d430fe9551
@ -92,6 +92,15 @@ class PgvectorClient(VectorDBBase):
|
|||||||
# Ensure the pgvector extension is available
|
# Ensure the pgvector extension is available
|
||||||
self.session.execute(text("CREATE EXTENSION IF NOT EXISTS vector;"))
|
self.session.execute(text("CREATE EXTENSION IF NOT EXISTS vector;"))
|
||||||
|
|
||||||
|
if PGVECTOR_PGCRYPTO:
|
||||||
|
# Ensure the pgcrypto extension is available for encryption
|
||||||
|
self.session.execute(text("CREATE EXTENSION IF NOT EXISTS pgcrypto;"))
|
||||||
|
|
||||||
|
if not PGVECTOR_PGCRYPTO_KEY:
|
||||||
|
raise ValueError(
|
||||||
|
"PGVECTOR_PGCRYPTO_KEY must be set when PGVECTOR_PGCRYPTO is enabled."
|
||||||
|
)
|
||||||
|
|
||||||
# Check vector length consistency
|
# Check vector length consistency
|
||||||
self.check_vector_length()
|
self.check_vector_length()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user