Files
dify-plugin-daemon/cmd/commandline/plugin/templates/python/tool.py
T
2024-11-13 20:38:47 +08:00

12 lines
376 B
Python

from collections.abc import Generator
from typing import Any
from dify_plugin import Tool
from dify_plugin.entities.tool import ToolInvokeMessage
class {{ .PluginName | SnakeToCamel }}Tool(Tool):
def _invoke(self, tool_parameters: dict[str, Any]) -> Generator[ToolInvokeMessage]:
yield self.create_json_message({
"result": "Hello, world!"
})