chat.go 886 B

12345678910111213141516171819202122232425262728293031323334
  1. package dify
  2. type ChatReq struct {
  3. Query string `json:"query"`
  4. ConversationId string `json:"conversation_id"`
  5. User string `json:"user"`
  6. ResponseMode string `json:"response_mode"`
  7. Files []File `json:"files"`
  8. Inputs interface{} `json:"inputs"`
  9. }
  10. type File struct {
  11. Type string `json:"type"`
  12. TransferMethod string `json:"transfer_method"`
  13. Url string `json:"url"`
  14. }
  15. type ChatResp struct {
  16. Event string `json:"event"`
  17. ConversationId string `json:"conversation_id"`
  18. MessageId string `json:"message_id"`
  19. CreatedAt uint64 `json:"created_at"`
  20. TaskId string `json:"task_id"`
  21. Id string `json:"id"`
  22. Answer string `json:"answer,optional"`
  23. }
  24. type Metadata struct {
  25. }
  26. // GetChatUrl 请求地址
  27. func GetChatUrl() string {
  28. return "/chat-messages"
  29. }