controller.go 762 B

1234567891011121314151617181920212223242526272829303132333435
  1. package server
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "github.com/langgenius/dify-plugin-daemon/internal/service"
  5. "github.com/langgenius/dify-plugin-daemon/internal/types/entities/plugin_entities"
  6. "github.com/langgenius/dify-plugin-daemon/internal/types/entities/requests"
  7. )
  8. func HealthCheck(c *gin.Context) {
  9. c.JSON(200, gin.H{"status": "ok"})
  10. }
  11. func InvokeTool(c *gin.Context) {
  12. type request = plugin_entities.InvokePluginRequest[requests.RequestInvokeTool]
  13. BindRequest[request](
  14. c,
  15. func(itr request) {
  16. service.InvokeTool(&itr, c)
  17. },
  18. )
  19. }
  20. func InvokeLLM(c *gin.Context) {
  21. type request = plugin_entities.InvokePluginRequest[requests.RequestInvokeLLM]
  22. BindRequest[request](
  23. c,
  24. func(itr request) {
  25. service.InvokeLLM(&itr, c)
  26. },
  27. )
  28. }