Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41dfdf1ac0 | ||
|
|
dd7de74aa6 | ||
|
|
f11131f8b5 | ||
|
|
2e6e414a9e | ||
|
|
c45d676477 | ||
|
|
b8d8dddd5a | ||
|
|
c45c22b1b2 | ||
|
|
3d57a9ccdc |
@@ -44,22 +44,19 @@ def oauth_server_access_token_required(view):
|
||||
if not oauth_provider_app or not isinstance(oauth_provider_app, OAuthProviderApp):
|
||||
raise BadRequest("Invalid oauth_provider_app")
|
||||
|
||||
if not request.headers.get("Authorization"):
|
||||
raise BadRequest("Authorization is required")
|
||||
|
||||
authorization_header = request.headers.get("Authorization")
|
||||
if not authorization_header:
|
||||
raise BadRequest("Authorization header is required")
|
||||
|
||||
parts = authorization_header.split(" ")
|
||||
parts = authorization_header.strip().split(" ")
|
||||
if len(parts) != 2:
|
||||
raise BadRequest("Invalid Authorization header format")
|
||||
|
||||
token_type = parts[0]
|
||||
if token_type != "Bearer":
|
||||
token_type = parts[0].strip()
|
||||
if token_type.lower() != "bearer":
|
||||
raise BadRequest("token_type is invalid")
|
||||
|
||||
access_token = parts[1]
|
||||
access_token = parts[1].strip()
|
||||
if not access_token:
|
||||
raise BadRequest("access_token is required")
|
||||
|
||||
@@ -125,7 +122,10 @@ class OAuthServerUserTokenApi(Resource):
|
||||
parser.add_argument("refresh_token", type=str, required=False, location="json")
|
||||
parsed_args = parser.parse_args()
|
||||
|
||||
grant_type = OAuthGrantType(parsed_args["grant_type"])
|
||||
try:
|
||||
grant_type = OAuthGrantType(parsed_args["grant_type"])
|
||||
except ValueError:
|
||||
raise BadRequest("invalid grant_type")
|
||||
|
||||
if grant_type == OAuthGrantType.AUTHORIZATION_CODE:
|
||||
if not parsed_args["code"]:
|
||||
@@ -163,8 +163,6 @@ class OAuthServerUserTokenApi(Resource):
|
||||
"refresh_token": refresh_token,
|
||||
}
|
||||
)
|
||||
else:
|
||||
raise BadRequest("invalid grant_type")
|
||||
|
||||
|
||||
class OAuthServerUserAccountApi(Resource):
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
from base64 import b64encode
|
||||
from collections.abc import Callable
|
||||
from functools import wraps
|
||||
from hashlib import sha1
|
||||
from hmac import new as hmac_new
|
||||
from typing import ParamSpec, TypeVar
|
||||
|
||||
P = ParamSpec("P")
|
||||
R = TypeVar("R")
|
||||
from flask import abort, request
|
||||
|
||||
from configs import dify_config
|
||||
@@ -10,9 +14,9 @@ from extensions.ext_database import db
|
||||
from models.model import EndUser
|
||||
|
||||
|
||||
def billing_inner_api_only(view):
|
||||
def billing_inner_api_only(view: Callable[P, R]):
|
||||
@wraps(view)
|
||||
def decorated(*args, **kwargs):
|
||||
def decorated(*args: P.args, **kwargs: P.kwargs):
|
||||
if not dify_config.INNER_API:
|
||||
abort(404)
|
||||
|
||||
@@ -26,9 +30,9 @@ def billing_inner_api_only(view):
|
||||
return decorated
|
||||
|
||||
|
||||
def enterprise_inner_api_only(view):
|
||||
def enterprise_inner_api_only(view: Callable[P, R]):
|
||||
@wraps(view)
|
||||
def decorated(*args, **kwargs):
|
||||
def decorated(*args: P.args, **kwargs: P.kwargs):
|
||||
if not dify_config.INNER_API:
|
||||
abort(404)
|
||||
|
||||
@@ -78,9 +82,9 @@ def enterprise_inner_api_user_auth(view):
|
||||
return decorated
|
||||
|
||||
|
||||
def plugin_inner_api_only(view):
|
||||
def plugin_inner_api_only(view: Callable[P, R]):
|
||||
@wraps(view)
|
||||
def decorated(*args, **kwargs):
|
||||
def decorated(*args: P.args, **kwargs: P.kwargs):
|
||||
if not dify_config.PLUGIN_DAEMON_KEY:
|
||||
abort(404)
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ default_retrieval_model = {
|
||||
"search_method": RetrievalMethod.SEMANTIC_SEARCH.value,
|
||||
"reranking_enable": False,
|
||||
"reranking_model": {"reranking_provider_name": "", "reranking_model_name": ""},
|
||||
"top_k": 2,
|
||||
"top_k": 4,
|
||||
"score_threshold_enabled": False,
|
||||
}
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ class AnalyticdbVectorOpenAPI:
|
||||
response = self._client.query_collection_data(request)
|
||||
documents = []
|
||||
for match in response.body.matches.match:
|
||||
if match.score > score_threshold:
|
||||
if match.score >= score_threshold:
|
||||
metadata = json.loads(match.metadata.get("metadata_"))
|
||||
metadata["score"] = match.score
|
||||
doc = Document(
|
||||
@@ -293,7 +293,7 @@ class AnalyticdbVectorOpenAPI:
|
||||
response = self._client.query_collection_data(request)
|
||||
documents = []
|
||||
for match in response.body.matches.match:
|
||||
if match.score > score_threshold:
|
||||
if match.score >= score_threshold:
|
||||
metadata = json.loads(match.metadata.get("metadata_"))
|
||||
metadata["score"] = match.score
|
||||
doc = Document(
|
||||
|
||||
@@ -229,7 +229,7 @@ class AnalyticdbVectorBySql:
|
||||
documents = []
|
||||
for record in cur:
|
||||
id, vector, score, page_content, metadata = record
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
metadata["score"] = score
|
||||
doc = Document(
|
||||
page_content=page_content,
|
||||
|
||||
@@ -157,7 +157,7 @@ class BaiduVector(BaseVector):
|
||||
if meta is not None:
|
||||
meta = json.loads(meta)
|
||||
score = row.get("score", 0.0)
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
meta["score"] = score
|
||||
doc = Document(page_content=row_data.get(self.field_text), metadata=meta)
|
||||
docs.append(doc)
|
||||
|
||||
@@ -120,7 +120,7 @@ class ChromaVector(BaseVector):
|
||||
distance = distances[index]
|
||||
metadata = dict(metadatas[index])
|
||||
score = 1 - distance
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
metadata["score"] = score
|
||||
doc = Document(
|
||||
page_content=documents[index],
|
||||
|
||||
@@ -304,7 +304,7 @@ class CouchbaseVector(BaseVector):
|
||||
return docs
|
||||
|
||||
def search_by_full_text(self, query: str, **kwargs: Any) -> list[Document]:
|
||||
top_k = kwargs.get("top_k", 2)
|
||||
top_k = kwargs.get("top_k", 4)
|
||||
try:
|
||||
CBrequest = search.SearchRequest.create(search.QueryStringQuery("text:" + query))
|
||||
search_iter = self._scope.search(
|
||||
|
||||
@@ -216,7 +216,7 @@ class ElasticSearchVector(BaseVector):
|
||||
docs = []
|
||||
for doc, score in docs_and_scores:
|
||||
score_threshold = float(kwargs.get("score_threshold") or 0.0)
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
if doc.metadata is not None:
|
||||
doc.metadata["score"] = score
|
||||
docs.append(doc)
|
||||
|
||||
@@ -127,7 +127,7 @@ class HuaweiCloudVector(BaseVector):
|
||||
docs = []
|
||||
for doc, score in docs_and_scores:
|
||||
score_threshold = float(kwargs.get("score_threshold") or 0.0)
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
if doc.metadata is not None:
|
||||
doc.metadata["score"] = score
|
||||
docs.append(doc)
|
||||
|
||||
@@ -275,7 +275,7 @@ class LindormVectorStore(BaseVector):
|
||||
docs = []
|
||||
for doc, score in docs_and_scores:
|
||||
score_threshold = kwargs.get("score_threshold", 0.0) or 0.0
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
if doc.metadata is not None:
|
||||
doc.metadata["score"] = score
|
||||
docs.append(doc)
|
||||
|
||||
@@ -194,7 +194,7 @@ class OpenGauss(BaseVector):
|
||||
metadata, text, distance = record
|
||||
score = 1 - distance
|
||||
metadata["score"] = score
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
docs.append(Document(page_content=text, metadata=metadata))
|
||||
return docs
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ class OpenSearchVector(BaseVector):
|
||||
|
||||
metadata["score"] = hit["_score"]
|
||||
score_threshold = float(kwargs.get("score_threshold") or 0.0)
|
||||
if hit["_score"] > score_threshold:
|
||||
if hit["_score"] >= score_threshold:
|
||||
doc = Document(page_content=hit["_source"].get(Field.CONTENT_KEY.value), metadata=metadata)
|
||||
docs.append(doc)
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ class OracleVector(BaseVector):
|
||||
metadata, text, distance = record
|
||||
score = 1 - distance
|
||||
metadata["score"] = score
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
docs.append(Document(page_content=text, metadata=metadata))
|
||||
conn.close()
|
||||
return docs
|
||||
|
||||
@@ -202,7 +202,7 @@ class PGVectoRS(BaseVector):
|
||||
score = 1 - dis
|
||||
metadata["score"] = score
|
||||
score_threshold = float(kwargs.get("score_threshold") or 0.0)
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
doc = Document(page_content=record.text, metadata=metadata)
|
||||
docs.append(doc)
|
||||
return docs
|
||||
|
||||
@@ -195,7 +195,7 @@ class PGVector(BaseVector):
|
||||
metadata, text, distance = record
|
||||
score = 1 - distance
|
||||
metadata["score"] = score
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
docs.append(Document(page_content=text, metadata=metadata))
|
||||
return docs
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ class VastbaseVector(BaseVector):
|
||||
metadata, text, distance = record
|
||||
score = 1 - distance
|
||||
metadata["score"] = score
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
docs.append(Document(page_content=text, metadata=metadata))
|
||||
return docs
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ class QdrantVector(BaseVector):
|
||||
continue
|
||||
metadata = result.payload.get(Field.METADATA_KEY.value) or {}
|
||||
# duplicate check score threshold
|
||||
if result.score > score_threshold:
|
||||
if result.score >= score_threshold:
|
||||
metadata["score"] = result.score
|
||||
doc = Document(
|
||||
page_content=result.payload.get(Field.CONTENT_KEY.value, ""),
|
||||
|
||||
@@ -233,7 +233,7 @@ class RelytVector(BaseVector):
|
||||
docs = []
|
||||
for document, score in results:
|
||||
score_threshold = float(kwargs.get("score_threshold") or 0.0)
|
||||
if 1 - score > score_threshold:
|
||||
if 1 - score >= score_threshold:
|
||||
docs.append(document)
|
||||
return docs
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ class TableStoreVector(BaseVector):
|
||||
)
|
||||
documents = []
|
||||
for search_hit in search_response.search_hits:
|
||||
if search_hit.score > score_threshold:
|
||||
if search_hit.score >= score_threshold:
|
||||
ots_column_map = {}
|
||||
for col in search_hit.row[1]:
|
||||
ots_column_map[col[0]] = col[1]
|
||||
|
||||
@@ -291,7 +291,7 @@ class TencentVector(BaseVector):
|
||||
score = 1 - result.get("score", 0.0)
|
||||
else:
|
||||
score = result.get("score", 0.0)
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
meta["score"] = score
|
||||
doc = Document(page_content=result.get(self.field_text), metadata=meta)
|
||||
docs.append(doc)
|
||||
|
||||
@@ -351,7 +351,7 @@ class TidbOnQdrantVector(BaseVector):
|
||||
metadata = result.payload.get(Field.METADATA_KEY.value) or {}
|
||||
# duplicate check score threshold
|
||||
score_threshold = kwargs.get("score_threshold") or 0.0
|
||||
if result.score > score_threshold:
|
||||
if result.score >= score_threshold:
|
||||
metadata["score"] = result.score
|
||||
doc = Document(
|
||||
page_content=result.payload.get(Field.CONTENT_KEY.value, ""),
|
||||
|
||||
@@ -110,7 +110,7 @@ class UpstashVector(BaseVector):
|
||||
score = record.score
|
||||
if metadata is not None and text is not None:
|
||||
metadata["score"] = score
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
docs.append(Document(page_content=text, metadata=metadata))
|
||||
return docs
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ class VikingDBVector(BaseVector):
|
||||
metadata = result.fields.get(vdb_Field.METADATA_KEY.value)
|
||||
if metadata is not None:
|
||||
metadata = json.loads(metadata)
|
||||
if result.score > score_threshold:
|
||||
if result.score >= score_threshold:
|
||||
metadata["score"] = result.score
|
||||
doc = Document(page_content=result.fields.get(vdb_Field.CONTENT_KEY.value), metadata=metadata)
|
||||
docs.append(doc)
|
||||
|
||||
@@ -220,7 +220,7 @@ class WeaviateVector(BaseVector):
|
||||
for doc, score in docs_and_scores:
|
||||
score_threshold = float(kwargs.get("score_threshold") or 0.0)
|
||||
# check score threshold
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
if doc.metadata is not None:
|
||||
doc.metadata["score"] = score
|
||||
docs.append(doc)
|
||||
|
||||
@@ -123,7 +123,7 @@ class ParagraphIndexProcessor(BaseIndexProcessor):
|
||||
for result in results:
|
||||
metadata = result.metadata
|
||||
metadata["score"] = result.score
|
||||
if result.score > score_threshold:
|
||||
if result.score >= score_threshold:
|
||||
doc = Document(page_content=result.page_content, metadata=metadata)
|
||||
docs.append(doc)
|
||||
return docs
|
||||
|
||||
@@ -162,7 +162,7 @@ class ParentChildIndexProcessor(BaseIndexProcessor):
|
||||
for result in results:
|
||||
metadata = result.metadata
|
||||
metadata["score"] = result.score
|
||||
if result.score > score_threshold:
|
||||
if result.score >= score_threshold:
|
||||
doc = Document(page_content=result.page_content, metadata=metadata)
|
||||
docs.append(doc)
|
||||
return docs
|
||||
|
||||
@@ -158,7 +158,7 @@ class QAIndexProcessor(BaseIndexProcessor):
|
||||
for result in results:
|
||||
metadata = result.metadata
|
||||
metadata["score"] = result.score
|
||||
if result.score > score_threshold:
|
||||
if result.score >= score_threshold:
|
||||
doc = Document(page_content=result.page_content, metadata=metadata)
|
||||
docs.append(doc)
|
||||
return docs
|
||||
|
||||
@@ -65,7 +65,7 @@ default_retrieval_model: dict[str, Any] = {
|
||||
"search_method": RetrievalMethod.SEMANTIC_SEARCH.value,
|
||||
"reranking_enable": False,
|
||||
"reranking_model": {"reranking_provider_name": "", "reranking_model_name": ""},
|
||||
"top_k": 2,
|
||||
"top_k": 4,
|
||||
"score_threshold_enabled": False,
|
||||
}
|
||||
|
||||
@@ -647,7 +647,7 @@ class DatasetRetrieval:
|
||||
retrieval_method=retrieval_model["search_method"],
|
||||
dataset_id=dataset.id,
|
||||
query=query,
|
||||
top_k=retrieval_model.get("top_k") or 2,
|
||||
top_k=retrieval_model.get("top_k") or 4,
|
||||
score_threshold=retrieval_model.get("score_threshold", 0.0)
|
||||
if retrieval_model["score_threshold_enabled"]
|
||||
else 0.0,
|
||||
@@ -743,7 +743,7 @@ class DatasetRetrieval:
|
||||
tool = DatasetMultiRetrieverTool.from_dataset(
|
||||
dataset_ids=[dataset.id for dataset in available_datasets],
|
||||
tenant_id=tenant_id,
|
||||
top_k=retrieve_config.top_k or 2,
|
||||
top_k=retrieve_config.top_k or 4,
|
||||
score_threshold=retrieve_config.score_threshold,
|
||||
hit_callbacks=[hit_callback],
|
||||
return_resource=return_resource,
|
||||
|
||||
@@ -181,7 +181,7 @@ class DatasetMultiRetrieverTool(DatasetRetrieverBaseTool):
|
||||
retrieval_method="keyword_search",
|
||||
dataset_id=dataset.id,
|
||||
query=query,
|
||||
top_k=retrieval_model.get("top_k") or 2,
|
||||
top_k=retrieval_model.get("top_k") or 4,
|
||||
)
|
||||
if documents:
|
||||
all_documents.extend(documents)
|
||||
@@ -192,7 +192,7 @@ class DatasetMultiRetrieverTool(DatasetRetrieverBaseTool):
|
||||
retrieval_method=retrieval_model["search_method"],
|
||||
dataset_id=dataset.id,
|
||||
query=query,
|
||||
top_k=retrieval_model.get("top_k") or 2,
|
||||
top_k=retrieval_model.get("top_k") or 4,
|
||||
score_threshold=retrieval_model.get("score_threshold", 0.0)
|
||||
if retrieval_model["score_threshold_enabled"]
|
||||
else 0.0,
|
||||
|
||||
@@ -13,7 +13,7 @@ class DatasetRetrieverBaseTool(BaseModel, ABC):
|
||||
name: str = "dataset"
|
||||
description: str = "use this to retrieve a dataset. "
|
||||
tenant_id: str
|
||||
top_k: int = 2
|
||||
top_k: int = 4
|
||||
score_threshold: Optional[float] = None
|
||||
hit_callbacks: list[DatasetIndexToolCallbackHandler] = []
|
||||
return_resource: bool
|
||||
|
||||
@@ -78,7 +78,7 @@ default_retrieval_model = {
|
||||
"search_method": RetrievalMethod.SEMANTIC_SEARCH.value,
|
||||
"reranking_enable": False,
|
||||
"reranking_model": {"reranking_provider_name": "", "reranking_model_name": ""},
|
||||
"top_k": 2,
|
||||
"top_k": 4,
|
||||
"score_threshold_enabled": False,
|
||||
}
|
||||
|
||||
|
||||
@@ -1149,7 +1149,7 @@ class DocumentService:
|
||||
"search_method": RetrievalMethod.SEMANTIC_SEARCH.value,
|
||||
"reranking_enable": False,
|
||||
"reranking_model": {"reranking_provider_name": "", "reranking_model_name": ""},
|
||||
"top_k": 2,
|
||||
"top_k": 4,
|
||||
"score_threshold_enabled": False,
|
||||
}
|
||||
|
||||
@@ -1612,7 +1612,7 @@ class DocumentService:
|
||||
search_method=RetrievalMethod.SEMANTIC_SEARCH.value,
|
||||
reranking_enable=False,
|
||||
reranking_model=RerankingModel(reranking_provider_name="", reranking_model_name=""),
|
||||
top_k=2,
|
||||
top_k=4,
|
||||
score_threshold_enabled=False,
|
||||
)
|
||||
# save dataset
|
||||
|
||||
@@ -18,7 +18,7 @@ default_retrieval_model = {
|
||||
"search_method": RetrievalMethod.SEMANTIC_SEARCH.value,
|
||||
"reranking_enable": False,
|
||||
"reranking_model": {"reranking_provider_name": "", "reranking_model_name": ""},
|
||||
"top_k": 2,
|
||||
"top_k": 4,
|
||||
"score_threshold_enabled": False,
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class HitTestingService:
|
||||
retrieval_method=retrieval_model.get("search_method", "semantic_search"),
|
||||
dataset_id=dataset.id,
|
||||
query=query,
|
||||
top_k=retrieval_model.get("top_k", 2),
|
||||
top_k=retrieval_model.get("top_k", 4),
|
||||
score_threshold=retrieval_model.get("score_threshold", 0.0)
|
||||
if retrieval_model["score_threshold_enabled"]
|
||||
else 0.0,
|
||||
|
||||
@@ -28,7 +28,7 @@ const ExternalKnowledgeBaseCreate: React.FC<ExternalKnowledgeBaseCreateProps> =
|
||||
external_knowledge_api_id: '',
|
||||
external_knowledge_id: '',
|
||||
external_retrieval_model: {
|
||||
top_k: 2,
|
||||
top_k: 4,
|
||||
score_threshold: 0.5,
|
||||
score_threshold_enabled: false,
|
||||
},
|
||||
|
||||
@@ -49,7 +49,7 @@ const TextAreaWithButton = ({
|
||||
const { t } = useTranslation()
|
||||
const [isSettingsOpen, setIsSettingsOpen] = useState(false)
|
||||
const [externalRetrievalSettings, setExternalRetrievalSettings] = useState({
|
||||
top_k: 2,
|
||||
top_k: 4,
|
||||
score_threshold: 0.5,
|
||||
score_threshold_enabled: false,
|
||||
})
|
||||
|
||||
@@ -233,7 +233,7 @@ const DebugConfigurationContext = createContext<IDebugConfiguration>({
|
||||
reranking_provider_name: '',
|
||||
reranking_model_name: '',
|
||||
},
|
||||
top_k: 2,
|
||||
top_k: 4,
|
||||
score_threshold_enabled: false,
|
||||
score_threshold: 0.7,
|
||||
datasets: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
common: 'Wir respektieren Ihre Privatsphäre und werden diese Informationen nur verwenden, um Ihre Erfahrung mit unseren Entwickler-Tools zu verbessern.',
|
||||
notLoggedIn: 'möchte auf Ihr Dify Cloud-Konto zugreifen',
|
||||
loggedIn: 'möchte auf die folgenden Informationen aus Ihrem Dify Cloud-Konto zugreifen.',
|
||||
notLoggedIn: 'Diese App möchte auf Ihr Dify Cloud-Konto zugreifen',
|
||||
loggedIn: 'Diese App möchte auf die folgenden Informationen aus Ihrem Dify Cloud-Konto zugreifen.',
|
||||
needLogin: 'Bitte melden Sie sich an, um zu autorisieren.',
|
||||
},
|
||||
scopes: {
|
||||
@@ -21,7 +21,7 @@ const translation = {
|
||||
login: 'Anmelden',
|
||||
unknownApp: 'Unbekannte App',
|
||||
continue: 'Fortsetzen',
|
||||
connect: 'Verbinde zu',
|
||||
connect: 'Verbinden mit',
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
loggedIn: 'wants to access the following information from your Dify Cloud account.',
|
||||
notLoggedIn: 'wants to access your Dify Cloud account',
|
||||
loggedIn: 'This app wants to access the following information from your Dify Cloud account.',
|
||||
notLoggedIn: 'This app wants to access your Dify Cloud account',
|
||||
needLogin: 'Please log in to authorize',
|
||||
common: 'We respect your privacy and will only use this information to enhance your experience with our developer tools.',
|
||||
},
|
||||
@@ -18,7 +18,7 @@ const translation = {
|
||||
},
|
||||
error: {
|
||||
invalidParams: 'Invalid parameters',
|
||||
authorizeFailed: 'Authorize failed',
|
||||
authorizeFailed: 'Authorization failed',
|
||||
authAppInfoFetchFailed: 'Failed to fetch app info for authorization',
|
||||
},
|
||||
unknownApp: 'Unknown App',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
needLogin: 'Por favor inicie sesión para autorizar',
|
||||
notLoggedIn: 'quiere acceder a su cuenta de Dify Cloud',
|
||||
loggedIn: 'quiere acceder a la siguiente información de su cuenta de Dify Cloud.',
|
||||
notLoggedIn: 'Esta aplicación quiere acceder a su cuenta de Dify Cloud',
|
||||
loggedIn: 'Esta aplicación quiere acceder a la siguiente información de su cuenta de Dify Cloud.',
|
||||
common: 'Respetamos su privacidad y solo utilizaremos esta información para mejorar su experiencia con nuestras herramientas para desarrolladores.',
|
||||
},
|
||||
scopes: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
needLogin: 'لطفاً برای تأیید وارد شوید',
|
||||
notLoggedIn: 'میخواهد به حساب Dify Cloud شما دسترسی پیدا کند',
|
||||
loggedIn: 'میخواهد به اطلاعات زیر از حساب ابر دیفی شما دسترسی پیدا کند.',
|
||||
notLoggedIn: 'این برنامه میخواهد به حساب Dify Cloud شما دسترسی پیدا کند',
|
||||
loggedIn: 'این برنامه میخواهد به اطلاعات زیر از حساب ابر دیفی شما دسترسی پیدا کند.',
|
||||
common: 'ما به حریم خصوصی شما احترام میگذاریم و تنها از این اطلاعات برای بهبود تجربه شما با ابزارهای توسعهدهندهمان استفاده خواهیم کرد.',
|
||||
},
|
||||
scopes: {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
needLogin: 'Veuillez vous connecter pour autoriser',
|
||||
notLoggedIn: 'veut accéder à votre compte Dify Cloud',
|
||||
notLoggedIn: 'Cette application veut accéder à votre compte Dify Cloud',
|
||||
common: 'Nous respectons votre vie privée et n\'utiliserons ces informations que pour améliorer votre expérience avec nos outils de développement.',
|
||||
loggedIn: 'veut accéder aux informations suivantes de votre compte Dify Cloud.',
|
||||
loggedIn: 'Cette application veut accéder aux informations suivantes de votre compte Dify Cloud.',
|
||||
},
|
||||
scopes: {
|
||||
email: 'E-mail',
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
needLogin: 'कृपया प्राधिकरण के लिए लॉग इन करें',
|
||||
notLoggedIn: 'आप आपके Dify Cloud खाते तक पहुंचना चाहते हैं',
|
||||
notLoggedIn: 'यह ऐप आपके Dify Cloud खाते तक पहुंचना चाहता है',
|
||||
common: 'हम आपकी गोपनीयता का सम्मान करते हैं और इस जानकारी का उपयोग केवल आपके हमारे विकास उपकरणों के साथ अनुभव को बेहतर बनाने के लिए करेंगे।',
|
||||
loggedIn: 'आप आपके Dify Cloud खाते से निम्नलिखित जानकारी तक पहुंचना चाहते हैं।',
|
||||
loggedIn: 'यह ऐप आपके Dify Cloud खाते से निम्नलिखित जानकारी तक पहुंचना चाहता है।',
|
||||
},
|
||||
scopes: {
|
||||
name: 'नाम',
|
||||
@@ -13,7 +13,7 @@ const translation = {
|
||||
timezone: 'समय क्षेत्र',
|
||||
},
|
||||
error: {
|
||||
authorizeFailed: 'अनु autorización विफल',
|
||||
authorizeFailed: 'प्राधिकरण विफल',
|
||||
invalidParams: 'अमान्य पैरामीटर',
|
||||
authAppInfoFetchFailed: 'प्राधिकरण के लिए ऐप जानकारी प्राप्त करने में असफल हुआ',
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
notLoggedIn: 'vuole accedere al tuo account Dify Cloud',
|
||||
loggedIn: 'vuole accedere alle seguenti informazioni dal tuo account Dify Cloud.',
|
||||
notLoggedIn: 'Questa app vuole accedere al tuo account Dify Cloud',
|
||||
loggedIn: 'Questa app vuole accedere alle seguenti informazioni dal tuo account Dify Cloud.',
|
||||
common: 'Rispettiamo la tua privacy e utilizzeremo queste informazioni solo per migliorare la tua esperienza con i nostri strumenti per sviluppatori.',
|
||||
needLogin: 'Per favore, accedi per autorizzare',
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
notLoggedIn: 'あなたのDify Cloudアカウントにアクセスしたいです',
|
||||
notLoggedIn: 'このアプリはあなたのDify Cloudアカウントにアクセスしたいです',
|
||||
needLogin: 'ログインして認証してください',
|
||||
loggedIn: 'あなたのDify Cloudアカウントから以下の情報にアクセスしたいと思っています。',
|
||||
loggedIn: 'このアプリはあなたのDify Cloudアカウントから以下の情報にアクセスしたいと思っています。',
|
||||
common: '私たちはあなたのプライバシーを尊重し、この情報を私たちの開発者ツールによる体験を向上させるためにのみ使用します。',
|
||||
},
|
||||
scopes: {
|
||||
@@ -17,10 +17,10 @@ const translation = {
|
||||
invalidParams: '無効なパラメータ',
|
||||
authAppInfoFetchFailed: '認証のためのアプリ情報の取得に失敗しました',
|
||||
},
|
||||
unknownApp: '未知のアプリ',
|
||||
unknownApp: '不明なアプリ',
|
||||
login: 'ログイン',
|
||||
switchAccount: 'アカウントを切り替える',
|
||||
continue: '続けてください',
|
||||
continue: '続行',
|
||||
connect: '接続する',
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
needLogin: '로그인하여 인증해 주세요.',
|
||||
notLoggedIn: 'Dify Cloud 계정에 접근하고 싶어합니다.',
|
||||
loggedIn: '다음 정보를 귀하의 Dify Cloud 계정에서 액세스하려고 합니다.',
|
||||
notLoggedIn: '이 앱은 Dify Cloud 계정에 접근하고 싶어합니다.',
|
||||
loggedIn: '이 앱은 다음 정보를 귀하의 Dify Cloud 계정에서 액세스하려고 합니다.',
|
||||
common: '우리는 귀하의 개인 정보를 존중하며, 이 정보를 개발자 도구를 통한 귀하의 경험 향상에만 사용할 것입니다.',
|
||||
},
|
||||
scopes: {
|
||||
@@ -17,11 +17,11 @@ const translation = {
|
||||
authorizeFailed: '권한 부여 실패',
|
||||
authAppInfoFetchFailed: '인증을 위한 앱 정보를 가져오지 못했습니다.',
|
||||
},
|
||||
continue: '계속하다',
|
||||
continue: '계속',
|
||||
unknownApp: '알 수 없는 앱',
|
||||
switchAccount: '계정 전환',
|
||||
login: '로그인',
|
||||
connect: '연결하다',
|
||||
connect: '연결',
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
needLogin: 'Proszę się zalogować, aby autoryzować',
|
||||
notLoggedIn: 'chce uzyskać dostęp do twojego konta Dify Cloud',
|
||||
notLoggedIn: 'Ta aplikacja chce uzyskać dostęp do twojego konta Dify Cloud',
|
||||
common: 'Szanujemy Twoją prywatność i będziemy wykorzystywać te informacje tylko w celu ulepszenia Twojego doświadczenia z naszymi narzędziami deweloperskimi.',
|
||||
loggedIn: 'chce uzyskać dostęp do następujących informacji z twojego konta Dify Cloud.',
|
||||
loggedIn: 'Ta aplikacja chce uzyskać dostęp do następujących informacji z twojego konta Dify Cloud.',
|
||||
},
|
||||
scopes: {
|
||||
timezone: 'Strefa czasowa',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
notLoggedIn: 'quer acessar sua conta do Dify Cloud',
|
||||
loggedIn: 'quer acessar as seguintes informações da sua conta Dify Cloud.',
|
||||
notLoggedIn: 'Este aplicativo quer acessar sua conta do Dify Cloud',
|
||||
loggedIn: 'Este aplicativo quer acessar as seguintes informações da sua conta Dify Cloud.',
|
||||
common: 'Respeitamos sua privacidade e usaremos essas informações apenas para melhorar sua experiência com nossas ferramentas de desenvolvedor.',
|
||||
needLogin: 'Por favor, faça login para autorizar',
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
needLogin: 'Vă rugăm să vă conectați pentru a autoriza',
|
||||
loggedIn: 'vrea să acceseze următoarele informații din contul tău Dify Cloud.',
|
||||
notLoggedIn: 'vrea să acceseze contul tău Dify Cloud',
|
||||
loggedIn: 'Această aplicație vrea să acceseze următoarele informații din contul tău Dify Cloud.',
|
||||
notLoggedIn: 'Această aplicație vrea să acceseze contul tău Dify Cloud',
|
||||
common: 'Respectăm confidențialitatea dvs. și vom folosi aceste informații doar pentru a îmbunătăți experiența dvs. cu instrumentele noastre pentru dezvoltatori.',
|
||||
},
|
||||
scopes: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
needLogin: 'Пожалуйста, войдите, чтобы авторизоваться',
|
||||
notLoggedIn: 'хочет получить доступ к вашей учетной записи Dify Cloud',
|
||||
loggedIn: 'хочет получить следующую информацию из вашего аккаунта Dify Cloud.',
|
||||
notLoggedIn: 'Это приложение хочет получить доступ к вашей учетной записи Dify Cloud',
|
||||
loggedIn: 'Это приложение хочет получить следующую информацию из вашего аккаунта Dify Cloud.',
|
||||
common: 'Мы уважаем вашу конфиденциальность и будем использовать эту информацию только для улучшения вашего опыта с нашими инструментами разработчика.',
|
||||
},
|
||||
scopes: {
|
||||
@@ -17,7 +17,7 @@ const translation = {
|
||||
authorizeFailed: 'Авторизация не удалась',
|
||||
authAppInfoFetchFailed: 'Не удалось получить информацию об приложении для авторизации',
|
||||
},
|
||||
continue: 'Продолжайте',
|
||||
continue: 'Продолжить',
|
||||
connect: 'Подключиться к',
|
||||
switchAccount: 'Сменить аккаунт',
|
||||
unknownApp: 'Неизвестное приложение',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
notLoggedIn: 'želi dostopati do vašega Dify Cloud računa',
|
||||
loggedIn: 'želi dostopati do naslednjih informacij iz vašega računa Dify Cloud.',
|
||||
notLoggedIn: 'Ta aplikacija želi dostopati do vašega Dify Cloud računa',
|
||||
loggedIn: 'Ta aplikacija želi dostopati do naslednjih informacij iz vašega računa Dify Cloud.',
|
||||
common: 'Soočamo se z vašo zasebnostjo in te informacije bomo uporabili le za izboljšanje vaših izkušenj z našimi orodji za razvijalce.',
|
||||
needLogin: 'Prosimo, prijavite se za avtorizacijo',
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
needLogin: 'โปรดเข้าสู่ระบบเพื่ออนุญาต',
|
||||
notLoggedIn: 'ต้องการเข้าถึงบัญชี Dify Cloud ของคุณ',
|
||||
loggedIn: 'ต้องการเข้าถึงข้อมูลต่อไปนี้จากบัญชี Dify Cloud ของคุณ.',
|
||||
notLoggedIn: 'แอปพลิเคชันนี้ต้องการเข้าถึงบัญชี Dify Cloud ของคุณ',
|
||||
loggedIn: 'แอปพลิเคชันนี้ต้องการเข้าถึงข้อมูลต่อไปนี้จากบัญชี Dify Cloud ของคุณ.',
|
||||
common: 'เรามีความเคารพต่อความเป็นส่วนตัวของคุณและจะใช้ข้อมูลนี้เพื่อปรับปรุงประสบการณ์ของคุณกับเครื่องมือนักพัฒนาของเราเท่านั้น.',
|
||||
},
|
||||
scopes: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
notLoggedIn: 'Dify Cloud hesabınıza erişmek istiyor',
|
||||
notLoggedIn: 'Bu uygulama Dify Cloud hesabınıza erişmek istiyor',
|
||||
common: 'Gizliliğinize saygı gösteriyoruz ve bu bilgiyi yalnızca geliştirici araçlarımızla deneyiminizi geliştirmek için kullanacağız.',
|
||||
loggedIn: 'Dify Cloud hesabınızdaki aşağıdaki bilgilere erişmek istiyor.',
|
||||
loggedIn: 'Bu uygulama Dify Cloud hesabınızdaki aşağıdaki bilgilere erişmek istiyor.',
|
||||
needLogin: 'Lütfen yetkilendirmek için giriş yapın',
|
||||
},
|
||||
scopes: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
notLoggedIn: 'хоче отримати доступ до вашого облікового запису Dify Cloud',
|
||||
notLoggedIn: 'Цей додаток хоче отримати доступ до вашого облікового запису Dify Cloud',
|
||||
needLogin: 'Будь ласка, увійдіть, щоб авторизуватися.',
|
||||
loggedIn: 'хоче отримати доступ до наступної інформації з вашого облікового запису Dify Cloud.',
|
||||
loggedIn: 'Цей додаток хоче отримати доступ до наступної інформації з вашого облікового запису Dify Cloud.',
|
||||
common: 'Ми поважаємо вашу конфіденційність і використовуватимемо цю інформацію лише для покращення вашого досвіду з нашими інструментами для розробників.',
|
||||
},
|
||||
scopes: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const translation = {
|
||||
tips: {
|
||||
needLogin: 'Vui lòng đăng nhập để xác thực',
|
||||
notLoggedIn: 'muốn truy cập vào tài khoản Dify Cloud của bạn',
|
||||
loggedIn: 'muốn truy cập thông tin sau từ tài khoản Dify Cloud của bạn.',
|
||||
notLoggedIn: 'Ứng dụng này muốn truy cập vào tài khoản Dify Cloud của bạn',
|
||||
loggedIn: 'Ứng dụng này muốn truy cập thông tin sau từ tài khoản Dify Cloud của bạn.',
|
||||
common: 'Chúng tôi tôn trọng quyền riêng tư của bạn và sẽ chỉ sử dụng thông tin này để cải thiện trải nghiệm của bạn với các công cụ phát triển của chúng tôi.',
|
||||
},
|
||||
scopes: {
|
||||
|
||||
+1
-3
@@ -1,4 +1,3 @@
|
||||
const { basePath, assetPrefix } = require('./utils/var-basePath')
|
||||
const { codeInspectorPlugin } = require('code-inspector-plugin')
|
||||
const withMDX = require('@next/mdx')({
|
||||
extension: /\.mdx?$/,
|
||||
@@ -24,8 +23,7 @@ const remoteImageURLs = [hasSetWebPrefix ? new URL(`${process.env.NEXT_PUBLIC_WE
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
basePath,
|
||||
assetPrefix,
|
||||
basePath: process.env.NEXT_PUBLIC_BASE_PATH || '',
|
||||
webpack: (config, { dev, isServer }) => {
|
||||
if (dev) {
|
||||
config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }))
|
||||
|
||||
@@ -6,12 +6,7 @@ const NAME_SPACE = 'webapp'
|
||||
export const useGetWebAppAccessModeByCode = (code: string | null) => {
|
||||
return useQuery({
|
||||
queryKey: [NAME_SPACE, 'appAccessMode', code],
|
||||
queryFn: () => {
|
||||
if (!code || code.length === 0)
|
||||
return Promise.reject(new Error('App code is required to get access mode'))
|
||||
|
||||
return getAppAccessModeByAppCode(code)
|
||||
},
|
||||
queryFn: () => getAppAccessModeByAppCode(code!),
|
||||
enabled: !!code,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
// export basePath to next.config.js
|
||||
// same as the one exported from var.ts
|
||||
module.exports = {
|
||||
basePath: process.env.NEXT_PUBLIC_BASE_PATH || '',
|
||||
assetPrefix: '',
|
||||
}
|
||||
+1
-1
@@ -118,7 +118,7 @@ export const getVars = (value: string) => {
|
||||
|
||||
// Set the value of basePath
|
||||
// example: /dify
|
||||
export const basePath = ''
|
||||
export const basePath = process.env.NEXT_PUBLIC_BASE_PATH || ''
|
||||
|
||||
export function getMarketplaceUrl(path: string, params?: Record<string, string | undefined>) {
|
||||
const searchParams = new URLSearchParams({ source: encodeURIComponent(window.location.origin) })
|
||||
|
||||
Reference in New Issue
Block a user