From ca0979dd431649454acae6976c2de87ff9ebe90b Mon Sep 17 00:00:00 2001 From: Dongyu Li <544104925@qq.com> Date: Mon, 23 Jun 2025 15:18:15 +0800 Subject: [PATCH] feat(datasource): update fetch_datasource_provider --- api/core/plugin/impl/datasource.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/core/plugin/impl/datasource.py b/api/core/plugin/impl/datasource.py index 6fad564dd4..a2351a19da 100644 --- a/api/core/plugin/impl/datasource.py +++ b/api/core/plugin/impl/datasource.py @@ -7,12 +7,13 @@ from core.datasource.entities.datasource_entities import ( OnlineDocumentPagesMessage, WebsiteCrawlMessage, ) -from core.plugin.entities.plugin import GenericProviderID, ToolProviderID +from core.plugin.entities.plugin import GenericProviderID, ToolProviderID, DatasourceProviderID from core.plugin.entities.plugin_daemon import ( PluginBasicBooleanResponse, PluginDatasourceProviderEntity, ) from core.plugin.impl.base import BasePluginClient +from services.tools.tools_transform_service import ToolTransformService class PluginDatasourceManager(BasePluginClient): @@ -40,6 +41,8 @@ class PluginDatasourceManager(BasePluginClient): ) local_file_datasource_provider = PluginDatasourceProviderEntity(**self._get_local_file_datasource_provider()) + # for provider in response: + # ToolTransformService.repack_provider(tenant_id=tenant_id, provider=provider) all_response = [local_file_datasource_provider] + response for provider in all_response: @@ -58,7 +61,7 @@ class PluginDatasourceManager(BasePluginClient): if provider_id == "langgenius/file/file": return PluginDatasourceProviderEntity(**self._get_local_file_datasource_provider()) - tool_provider_id = ToolProviderID(provider_id) + tool_provider_id = DatasourceProviderID(provider_id) def transformer(json_response: dict[str, Any]) -> dict: data = json_response.get("data")