mirror of https://github.com/langgenius/dify.git
Merge remote-tracking branch 'origin/feat/r2' into feat/r2
This commit is contained in:
commit
0f10852b6b
|
|
@ -15,7 +15,7 @@ from core.plugin.entities.parameters import (
|
|||
init_frontend_parameter,
|
||||
)
|
||||
from core.tools.entities.common_entities import I18nObject
|
||||
from core.tools.entities.tool_entities import ToolLabelEnum, ToolProviderEntity
|
||||
from core.tools.entities.tool_entities import ToolLabelEnum
|
||||
|
||||
|
||||
class DatasourceProviderType(enum.StrEnum):
|
||||
|
|
@ -124,13 +124,13 @@ class DatasourceEntity(BaseModel):
|
|||
identity: DatasourceIdentity
|
||||
parameters: list[DatasourceParameter] = Field(default_factory=list)
|
||||
description: I18nObject = Field(..., description="The label of the datasource")
|
||||
output_schema: Optional[dict] = None
|
||||
|
||||
@field_validator("parameters", mode="before")
|
||||
@classmethod
|
||||
def set_parameters(cls, v, validation_info: ValidationInfo) -> list[DatasourceParameter]:
|
||||
return v or []
|
||||
|
||||
|
||||
class DatasourceProviderIdentity(BaseModel):
|
||||
author: str = Field(..., description="The author of the tool")
|
||||
name: str = Field(..., description="The name of the tool")
|
||||
|
|
@ -142,11 +142,12 @@ class DatasourceProviderIdentity(BaseModel):
|
|||
description="The tags of the tool",
|
||||
)
|
||||
|
||||
|
||||
|
||||
class DatasourceProviderEntity(BaseModel):
|
||||
"""
|
||||
Datasource provider entity
|
||||
"""
|
||||
|
||||
identity: DatasourceProviderIdentity
|
||||
credentials_schema: list[ProviderConfig] = Field(default_factory=list)
|
||||
oauth_schema: Optional[OAuthSchema] = None
|
||||
|
|
@ -212,7 +213,6 @@ class GetOnlineDocumentPagesRequest(BaseModel):
|
|||
"""
|
||||
|
||||
|
||||
|
||||
class OnlineDocumentPageIcon(BaseModel):
|
||||
"""
|
||||
Online document page icon
|
||||
|
|
@ -284,6 +284,7 @@ class GetWebsiteCrawlRequest(BaseModel):
|
|||
"""
|
||||
Get website crawl request
|
||||
"""
|
||||
|
||||
crawl_parameters: dict = Field(..., description="The crawl parameters")
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from typing import Any, Mapping
|
||||
from collections.abc import Mapping
|
||||
from typing import Any
|
||||
|
||||
from core.datasource.entities.api_entities import DatasourceProviderApiEntity
|
||||
from core.datasource.entities.datasource_entities import (
|
||||
|
|
@ -63,7 +64,7 @@ class PluginDatasourceManager(BasePluginClient):
|
|||
|
||||
response = self._request_with_plugin_daemon_response(
|
||||
"GET",
|
||||
f"plugin/{tenant_id}/management/datasources",
|
||||
f"plugin/{tenant_id}/management/datasource",
|
||||
PluginDatasourceProviderEntity,
|
||||
params={"provider": tool_provider_id.provider_name, "plugin_id": tool_provider_id.plugin_id},
|
||||
transformer=transformer,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,11 @@ from sqlalchemy.orm import Session
|
|||
|
||||
import contexts
|
||||
from configs import dify_config
|
||||
from core.datasource.entities.datasource_entities import DatasourceProviderType, GetOnlineDocumentPagesRequest, GetOnlineDocumentPagesResponse, GetWebsiteCrawlRequest, GetWebsiteCrawlResponse
|
||||
from core.datasource.entities.datasource_entities import (
|
||||
DatasourceProviderType,
|
||||
GetOnlineDocumentPagesResponse,
|
||||
GetWebsiteCrawlResponse,
|
||||
)
|
||||
from core.datasource.online_document.online_document_plugin import OnlineDocumentDatasourcePlugin
|
||||
from core.datasource.website_crawl.website_crawl_plugin import WebsiteCrawlDatasourcePlugin
|
||||
from core.model_runtime.utils.encoders import jsonable_encoder
|
||||
|
|
|
|||
Loading…
Reference in New Issue