tool_service.go 690 B

123456789101112131415161718192021222324
  1. package plugin_daemon
  2. import (
  3. "github.com/langgenius/dify-plugin-daemon/internal/core/session_manager"
  4. "github.com/langgenius/dify-plugin-daemon/internal/types/entities/plugin_entities"
  5. "github.com/langgenius/dify-plugin-daemon/internal/types/entities/requests"
  6. "github.com/langgenius/dify-plugin-daemon/internal/utils/stream"
  7. )
  8. func InvokeTool(
  9. session *session_manager.Session,
  10. request *requests.RequestInvokeTool,
  11. ) (
  12. *stream.StreamResponse[plugin_entities.ToolResponseChunk], error,
  13. ) {
  14. return genericInvokePlugin[requests.RequestInvokeTool, plugin_entities.ToolResponseChunk](
  15. session,
  16. request,
  17. 128,
  18. PLUGIN_ACCESS_TYPE_TOOL,
  19. PLUGIN_ACCESS_ACTION_INVOKE_TOOL,
  20. )
  21. }