diff --git a/api/core/plugin/endpoint/exc.py b/api/core/plugin/endpoint/exc.py
new file mode 100644
index 0000000000..aa29f1e9a1
--- /dev/null
+++ b/api/core/plugin/endpoint/exc.py
@@ -0,0 +1,6 @@
+class EndpointSetupFailedError(ValueError):
+ """
+ Endpoint setup failed error
+ """
+
+ pass
diff --git a/api/core/plugin/impl/base.py b/api/core/plugin/impl/base.py
index 4f1d808a3e..591e7b0525 100644
--- a/api/core/plugin/impl/base.py
+++ b/api/core/plugin/impl/base.py
@@ -17,6 +17,7 @@ from core.model_runtime.errors.invoke import (
InvokeServerUnavailableError,
)
from core.model_runtime.errors.validate import CredentialsValidateFailedError
+from core.plugin.endpoint.exc import EndpointSetupFailedError
from core.plugin.entities.plugin_daemon import PluginDaemonBasicResponse, PluginDaemonError, PluginDaemonInnerError
from core.plugin.impl.exc import (
PluginDaemonBadRequestError,
@@ -219,6 +220,8 @@ class BasePluginClient:
raise InvokeServerUnavailableError(description=args.get("description"))
case CredentialsValidateFailedError.__name__:
raise CredentialsValidateFailedError(error_object.get("message"))
+ case EndpointSetupFailedError.__name__:
+ raise EndpointSetupFailedError(error_object.get("message"))
case _:
raise PluginInvokeError(description=message)
case PluginDaemonInternalServerError.__name__:
diff --git a/api/core/rag/datasource/vdb/pgvector/pgvector.py b/api/core/rag/datasource/vdb/pgvector/pgvector.py
index 366a21c381..04e9cf801e 100644
--- a/api/core/rag/datasource/vdb/pgvector/pgvector.py
+++ b/api/core/rag/datasource/vdb/pgvector/pgvector.py
@@ -1,3 +1,4 @@
+import hashlib
import json
import logging
import uuid
@@ -61,12 +62,12 @@ CREATE TABLE IF NOT EXISTS {table_name} (
"""
SQL_CREATE_INDEX = """
-CREATE INDEX IF NOT EXISTS embedding_cosine_v1_idx ON {table_name}
+CREATE INDEX IF NOT EXISTS embedding_cosine_v1_idx_{index_hash} ON {table_name}
USING hnsw (embedding vector_cosine_ops) WITH (m = 16, ef_construction = 64);
"""
SQL_CREATE_INDEX_PG_BIGM = """
-CREATE INDEX IF NOT EXISTS bigm_idx ON {table_name}
+CREATE INDEX IF NOT EXISTS bigm_idx_{index_hash} ON {table_name}
USING gin (text gin_bigm_ops);
"""
@@ -76,6 +77,7 @@ class PGVector(BaseVector):
super().__init__(collection_name)
self.pool = self._create_connection_pool(config)
self.table_name = f"embedding_{collection_name}"
+ self.index_hash = hashlib.md5(self.table_name.encode()).hexdigest()[:8]
self.pg_bigm = config.pg_bigm
def get_type(self) -> str:
@@ -256,10 +258,9 @@ class PGVector(BaseVector):
# PG hnsw index only support 2000 dimension or less
# ref: https://github.com/pgvector/pgvector?tab=readme-ov-file#indexing
if dimension <= 2000:
- cur.execute(SQL_CREATE_INDEX.format(table_name=self.table_name))
+ cur.execute(SQL_CREATE_INDEX.format(table_name=self.table_name, index_hash=self.index_hash))
if self.pg_bigm:
- cur.execute("CREATE EXTENSION IF NOT EXISTS pg_bigm")
- cur.execute(SQL_CREATE_INDEX_PG_BIGM.format(table_name=self.table_name))
+ cur.execute(SQL_CREATE_INDEX_PG_BIGM.format(table_name=self.table_name, index_hash=self.index_hash))
redis_client.set(collection_exist_cache_key, 1, ex=3600)
diff --git a/web/app/account/header.tsx b/web/app/account/header.tsx
index 2bb89552c8..11b6beec08 100644
--- a/web/app/account/header.tsx
+++ b/web/app/account/header.tsx
@@ -4,23 +4,25 @@ import { RiArrowRightUpLine, RiRobot2Line } from '@remixicon/react'
import { useRouter } from 'next/navigation'
import Button from '../components/base/button'
import Avatar from './avatar'
-import LogoSite from '@/app/components/base/logo/logo-site'
+import DifyLogo from '@/app/components/base/logo/dify-logo'
+import { useCallback } from 'react'
const Header = () => {
const { t } = useTranslation()
const router = useRouter()
- const back = () => {
+ const back = useCallback(() => {
router.back()
- }
+ }, [router])
+
return (
-
+
-
-
{t('common.account.account')}
+
+
{t('common.account.account')}