From 830b3c8d263cd3c99d6b598eeb6f9ec4c41a8059 Mon Sep 17 00:00:00 2001 From: liupeng Date: Tue, 25 Jun 2024 11:22:33 +0800 Subject: [PATCH] add external pgvector --- README.md | 3 ++- charts/dify/templates/config.tpl | 8 ++++++++ charts/dify/templates/credentials.tpl | 4 ++++ charts/dify/values.yaml | 11 +++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c0643b7..e4a9d3f 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,8 @@ helm install my-release dify/dify - [x] object storage - [x] weaviate - [x] qdrant -- [X] milvus +- [x] milvus +- [x] pgvector ## Contributors diff --git a/charts/dify/templates/config.tpl b/charts/dify/templates/config.tpl index c781e28..e1129a3 100644 --- a/charts/dify/templates/config.tpl +++ b/charts/dify/templates/config.tpl @@ -220,6 +220,14 @@ QDRANT_URL: {{ .Values.externalQdrant.endpoint }} # The Qdrant clinet timeout setting. QDRANT_CLIENT_TIMEOUT: "20" # The DSN for Sentry error reporting. If not set, Sentry error reporting will be disabled. +{{- else if .Values.externalPgvector.enabled}} +# Pgvector configuration Only available when VECTOR_STORE is `pgvector`. +VECTOR_STORE: pgvector +PGVECTOR_HOST: {{ .Values.externalPgvector.address }} +PGVECTOR_PORT: {{ .Values.externalPgvector.port | toString | quote }} +PGVECTOR_DATABASE: {{ .Values.externalPgvector.dbName }} +# DB_USERNAME: {{ .Values.externalPgvector.username }} +# DB_PASSWORD: {{ .Values.externalPgvector.password }} {{- else if .Values.externalMilvus.enabled}} # Milvus configuration Only available when VECTOR_STORE is `milvus`. VECTOR_STORE: milvus diff --git a/charts/dify/templates/credentials.tpl b/charts/dify/templates/credentials.tpl index de833a8..9aa578c 100644 --- a/charts/dify/templates/credentials.tpl +++ b/charts/dify/templates/credentials.tpl @@ -94,6 +94,10 @@ CELERY_BROKER_URL: {{ printf "redis://:%s@%s:%v/1" .auth.password $redisHost .ma WEAVIATE_API_KEY: {{ .Values.externalWeaviate.apiKey | b64enc | quote }} {{- else if .Values.externalQdrant.enabled }} QDRANT_API_KEY: {{ .Values.externalQdrant.apiKey | b64enc | quote }} +{{- else if .Values.externalPgvector.enabled}} +PGVECTOR_USER: {{ .Values.externalPgvector.username | b64enc | quote }} +# The pgvector password. +PGVECTOR_PASSWORD: {{ .Values.externalPgvector.password | b64enc | quote }} {{- else if .Values.externalMilvus.enabled}} MILVUS_USER: {{ .Values.externalMilvus.user | b64enc | quote }} # The milvus password. diff --git a/charts/dify/values.yaml b/charts/dify/values.yaml index b7a4ccd..98de253 100644 --- a/charts/dify/values.yaml +++ b/charts/dify/values.yaml @@ -2627,6 +2627,17 @@ externalWeaviate: endpoint: "http://weaviate:8080" apiKey: "WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih" +################################### +# External Pgvector +# - these configs take effect when `externalPgvector.enabled` is true +################################### +externalPgvector: + enabled: false + username: "postgres" + password: "difyai123456" + address: "pgvector" + port: 5432 + dbName: dify ################################### # External Qdrant