mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +08:00
Merge remote-tracking branch 'origin/main' into feat/trigger
This commit is contained in:
@ -1416,8 +1416,6 @@ class DocumentService:
|
||||
# check document limit
|
||||
assert isinstance(current_user, Account)
|
||||
assert current_user.current_tenant_id is not None
|
||||
assert knowledge_config.data_source
|
||||
assert knowledge_config.data_source.info_list
|
||||
|
||||
features = FeatureService.get_features(current_user.current_tenant_id)
|
||||
|
||||
@ -1448,7 +1446,7 @@ class DocumentService:
|
||||
DocumentService.check_documents_upload_quota(count, features)
|
||||
|
||||
# if dataset is empty, update dataset data_source_type
|
||||
if not dataset.data_source_type:
|
||||
if not dataset.data_source_type and knowledge_config.data_source:
|
||||
dataset.data_source_type = knowledge_config.data_source.info_list.data_source_type
|
||||
|
||||
if not dataset.indexing_technique:
|
||||
@ -1494,6 +1492,10 @@ class DocumentService:
|
||||
documents.append(document)
|
||||
batch = document.batch
|
||||
else:
|
||||
# When creating new documents, data_source must be provided
|
||||
if not knowledge_config.data_source:
|
||||
raise ValueError("Data source is required when creating new documents")
|
||||
|
||||
batch = time.strftime("%Y%m%d%H%M%S") + str(100000 + secrets.randbelow(exclusive_upper_bound=900000))
|
||||
# save process rule
|
||||
if not dataset_process_rule:
|
||||
|
||||
@ -92,16 +92,6 @@ class EnterpriseService:
|
||||
|
||||
return ret
|
||||
|
||||
@classmethod
|
||||
def get_app_access_mode_by_code(cls, app_code: str) -> WebAppSettings:
|
||||
if not app_code:
|
||||
raise ValueError("app_code must be provided.")
|
||||
params = {"appCode": app_code}
|
||||
data = EnterpriseRequest.send_request("GET", "/webapp/access-mode/code", params=params)
|
||||
if not data:
|
||||
raise ValueError("No data found.")
|
||||
return WebAppSettings.model_validate(data)
|
||||
|
||||
@classmethod
|
||||
def update_app_access_mode(cls, app_id: str, access_mode: str):
|
||||
if not app_id:
|
||||
|
||||
@ -1265,8 +1265,8 @@ class RagPipelineService:
|
||||
)
|
||||
providers_map = {provider.plugin_id: provider.to_dict() for provider in providers}
|
||||
|
||||
plugin_manifests = marketplace.batch_fetch_plugin_manifests(plugin_ids)
|
||||
plugin_manifests_map = {manifest.plugin_id: manifest for manifest in plugin_manifests}
|
||||
plugin_manifests = marketplace.batch_fetch_plugin_by_ids(plugin_ids)
|
||||
plugin_manifests_map = {manifest["plugin_id"]: manifest for manifest in plugin_manifests}
|
||||
|
||||
installed_plugin_list = []
|
||||
uninstalled_plugin_list = []
|
||||
@ -1276,14 +1276,7 @@ class RagPipelineService:
|
||||
else:
|
||||
plugin_manifest = plugin_manifests_map.get(plugin_id)
|
||||
if plugin_manifest:
|
||||
uninstalled_plugin_list.append(
|
||||
{
|
||||
"plugin_id": plugin_id,
|
||||
"name": plugin_manifest.name,
|
||||
"icon": plugin_manifest.icon,
|
||||
"plugin_unique_identifier": plugin_manifest.latest_package_identifier,
|
||||
}
|
||||
)
|
||||
uninstalled_plugin_list.append(plugin_manifest)
|
||||
|
||||
# Build recommended plugins list
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user