Class N8nChatController

java.lang.Object
com.bytedesk.ai.springai.providers.n8n.N8nChatController

@RestController @RequestMapping("/api/v1/n8n") @ConditionalOnProperty(name="bytedesk.n8n.enabled", havingValue="true", matchIfMissing=false) public class N8nChatController extends Object
RAGFlow Chat Controller https://n8n.io/docs/dev/http_api_reference
  • Field Details

  • Constructor Details

    • N8nChatController

      public N8nChatController()
  • Method Details

    • createChatCompletion

      @PostMapping("/chats/{chatId}/completions") public org.springframework.http.ResponseEntity<?> createChatCompletion(@PathVariable String chatId, @RequestBody N8nChatController.N8nChatRequest request)
      创建聊天完成 - OpenAI 兼容接口
    • createAgentCompletion

      @PostMapping("/agents/{agentId}/completions") public org.springframework.http.ResponseEntity<?> createAgentCompletion(@PathVariable String agentId, @RequestBody N8nChatController.N8nChatRequest request)
      创建代理完成 - OpenAI 兼容接口
    • sendChatMessage

      @PostMapping("/chats/{chatId}/message") public org.springframework.http.ResponseEntity<?> sendChatMessage(@PathVariable String chatId, @RequestBody N8nChatController.N8nMessageRequest request)
      发送简单聊天消息
    • sendAgentMessage

      @PostMapping("/agents/{agentId}/message") public org.springframework.http.ResponseEntity<?> sendAgentMessage(@PathVariable String agentId, @RequestBody N8nChatController.N8nMessageRequest request)
      发送简单代理消息
    • quickChat

      @GetMapping("/chats/{chatId}/quick") public org.springframework.http.ResponseEntity<?> quickChat(@PathVariable String chatId, @RequestParam String content, @RequestParam(required=false,defaultValue="false") Boolean stream)
      快速聊天接口(GET 方式)
    • quickAgentChat

      @GetMapping("/agents/{agentId}/quick") public org.springframework.http.ResponseEntity<?> quickAgentChat(@PathVariable String agentId, @RequestParam String content, @RequestParam(required=false,defaultValue="false") Boolean stream)
      快速代理聊天接口(GET 方式)