mirror of
https://github.com/langgenius/dify.git
synced 2026-04-22 19:57:40 +08:00
refactor: tool
This commit is contained in:
30
api/core/tools/plugin_tool/plugin_tool_provider.py
Normal file
30
api/core/tools/plugin_tool/plugin_tool_provider.py
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
from core.entities.provider_entities import ProviderConfig
|
||||
from core.tools.__base.tool import Tool
|
||||
from core.tools.__base.tool_provider import ToolProviderController
|
||||
from core.tools.entities.tool_entities import ToolProviderType
|
||||
|
||||
|
||||
class PluginToolProvider(ToolProviderController):
|
||||
@property
|
||||
def provider_type(self) -> ToolProviderType:
|
||||
"""
|
||||
returns the type of the provider
|
||||
|
||||
:return: type of the provider
|
||||
"""
|
||||
return ToolProviderType.PLUGIN
|
||||
|
||||
def get_tool(self, tool_name: str) -> Tool:
|
||||
"""
|
||||
return tool with given name
|
||||
"""
|
||||
return super().get_tool(tool_name)
|
||||
|
||||
def get_credentials_schema(self) -> dict[str, ProviderConfig]:
|
||||
"""
|
||||
get credentials schema
|
||||
"""
|
||||
return super().get_credentials_schema()
|
||||
|
||||
Reference in New Issue
Block a user