mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-22 18:35:29 -04:00
5858fe715e
Signed-off-by: -LAN- <laipz8200@outlook.com>
21 lines
524 B
Python
21 lines
524 B
Python
from collections.abc import Generator
|
|
|
|
from dify_plugin.entities.tool import ToolInvokeMessage
|
|
from dify_plugin.interfaces.tool import Tool
|
|
|
|
|
|
class Summary(Tool):
|
|
def _invoke(
|
|
self, tool_parameters: dict
|
|
) -> Generator[ToolInvokeMessage, None, None]:
|
|
response = self.session.model.summary.invoke(
|
|
text="Hello, world!",
|
|
instruction="Summarize the text",
|
|
)
|
|
|
|
yield self.create_json_message(
|
|
{
|
|
"data": response,
|
|
}
|
|
)
|