feat: plugin call dify

This commit is contained in:
Yeuoly
2024-07-08 22:37:20 +08:00
parent 603187393a
commit 364df36ac4
9 changed files with 161 additions and 5 deletions

View File

@ -0,0 +1,16 @@
from collections.abc import Generator
from typing import Any
from core.tools.entities.tool_entities import ToolInvokeMessage
from models.account import Tenant
class PluginInvokeService:
@classmethod
def invoke_tool(cls, user_id: str, tenant: Tenant,
tool_provider: str, tool_name: str,
tool_parameters: dict[str, Any]) -> Generator[ToolInvokeMessage]:
"""
Invokes a tool with the given user ID and tool parameters.
"""