plugin_invoke_service.py 503 B

12345678910111213141516
  1. from collections.abc import Generator
  2. from typing import Any
  3. from core.tools.entities.tool_entities import ToolInvokeMessage
  4. from models.account import Tenant
  5. class PluginInvokeService:
  6. @classmethod
  7. def invoke_tool(cls, user_id: str, tenant: Tenant,
  8. tool_provider: str, tool_name: str,
  9. tool_parameters: dict[str, Any]) -> Generator[ToolInvokeMessage]:
  10. """
  11. Invokes a tool with the given user ID and tool parameters.
  12. """