Class DifyChatController

java.lang.Object
com.bytedesk.ai.springai.providers.dify.DifyChatController

@RestController @RequestMapping("/api/v1/dify") @ConditionalOnProperty(name="bytedesk.dify.enabled", havingValue="true", matchIfMissing=false) public class DifyChatController extends Object
Dify Chat Controller https://docs.dify.ai/zh-hans/guides/application-publishing/developing-with-apis
  • Field Details

  • Constructor Details

    • DifyChatController

      public DifyChatController()
  • Method Details

    • chat

      @PostMapping("/chat") public org.springframework.http.ResponseEntity<?> chat(@RequestBody DifyRequest request)
      发送对话消息
    • completion

      @PostMapping("/completion") public org.springframework.http.ResponseEntity<?> completion(@RequestBody DifyRequest request)
      发送文本补全消息
    • getMessages

      @GetMapping("/messages") public org.springframework.http.ResponseEntity<?> getMessages(@RequestParam String conversationId, @RequestParam String user, @RequestParam(required=false) String firstId, @RequestParam(required=false) Integer limit)
      获取对话历史
    • getConversations

      @GetMapping("/conversations") public org.springframework.http.ResponseEntity<?> getConversations(@RequestParam String user, @RequestParam(required=false) String lastId, @RequestParam(required=false) Integer limit, @RequestParam(required=false) Boolean pinned)
      获取对话列表
    • deleteConversation

      @DeleteMapping("/conversations/{conversationId}") public org.springframework.http.ResponseEntity<?> deleteConversation(@PathVariable String conversationId, @RequestParam String user)
      删除对话
    • renameConversation

      @PostMapping("/conversations/{conversationId}/name") public org.springframework.http.ResponseEntity<?> renameConversation(@PathVariable String conversationId, @RequestBody DifyRequest request)
      重命名对话
    • simpleChat

      @GetMapping("/chat") public org.springframework.http.ResponseEntity<?> simpleChat(@RequestParam String query, @RequestParam(required=false) String user, @RequestParam(required=false) String conversationId)
      简单对话接口(兼容旧版本)