Feat/workflow phase2 (#4687)

This commit is contained in:
Yeuoly
2024-05-27 22:01:11 +08:00
committed by GitHub
parent 45deaee762
commit e852a21634
139 changed files with 5997 additions and 779 deletions

View File

@@ -3,13 +3,13 @@ from typing import Any, Optional
from pydantic import BaseModel
from core.tools.entities.api_entities import UserToolProviderCredentials
from core.tools.entities.tool_entities import (
ToolParameter,
ToolProviderCredentials,
ToolProviderIdentity,
ToolProviderType,
)
from core.tools.entities.user_entities import UserToolProviderCredentials
from core.tools.errors import ToolNotFoundError, ToolParameterValidationError, ToolProviderCredentialValidationError
from core.tools.tool.tool import Tool
@@ -67,7 +67,7 @@ class ToolProviderController(BaseModel, ABC):
return tool.parameters
@property
def app_type(self) -> ToolProviderType:
def provider_type(self) -> ToolProviderType:
"""
returns the type of the provider
@@ -197,26 +197,4 @@ class ToolProviderController(BaseModel, ABC):
default_value = str(default_value)
credentials[credential_name] = default_value
def validate_credentials(self, credentials: dict[str, Any]) -> None:
"""
validate the credentials of the provider
:param tool_name: the name of the tool, defined in `get_tools`
:param credentials: the credentials of the tool
"""
# validate credentials format
self.validate_credentials_format(credentials)
# validate credentials
self._validate_credentials(credentials)
@abstractmethod
def _validate_credentials(self, credentials: dict[str, Any]) -> None:
"""
validate the credentials of the provider
:param tool_name: the name of the tool, defined in `get_tools`
:param credentials: the credentials of the tool
"""
pass