aiChatApi.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package v1
  2. import (
  3. "github.com/gogf/gf/v2/frame/g"
  4. )
  5. type CommonRes struct {
  6. ErrorMsg string `json:"error_msg"`
  7. ErrorCode int64 `json:"error_code"`
  8. Data interface{} `json:"data"`
  9. }
  10. // ChatHistoryReq 历史记录
  11. type ChatHistoryReq struct {
  12. g.Meta `path:"/chatHistory" tags:"AiChat" method:"post" summary:"查询聊天历史记录"`
  13. PageSize int `v:"between:1,20" dc:"每页数据量"`
  14. PageNum int `v:"between:1,20" dc:"页码"`
  15. }
  16. type History struct {
  17. Id string `json:"id" dc:"信息加密id"`
  18. Content string `json:"content" dc:"内容"`
  19. Type int `json:"type" dc:"1:用户提问 2:智能助手回复"`
  20. Useful int `json:"useful" dc:"1:有用 -1:无用 0:暂无评价"`
  21. CreateTime int64 `json:"create_time" dc:"聊天时间"`
  22. }
  23. type ChatHistoryRes struct {
  24. Data []History `json:"data"`
  25. ErrorMsg string `json:"error_msg"`
  26. ErrorCode int64 `json:"error_code"`
  27. }
  28. // EvaluateReq 评价
  29. type EvaluateReq struct {
  30. g.Meta `path:"/evaluate" tags:"AiChat" method:"post" summary:"评价回复的问题"`
  31. MessageId string `v:"required"`
  32. Evaluate int `v:"in:-1,1" dc:"-1:没用;1:有用"`
  33. }
  34. type EvaluateRes struct {
  35. }
  36. // GuessQuestionReq 猜你想问
  37. type GuessQuestionReq struct {
  38. g.Meta `path:"/guessQuestion" tags:"AiChat" method:"post" summary:"获取场景下的猜你想问"`
  39. Href string `v:"required|length:6,16"`
  40. }
  41. type GuessQuestionRes struct {
  42. }
  43. // UsuallyProblemReq 常见问题
  44. type UsuallyProblemReq struct {
  45. g.Meta `path:"/usuallyProblem" tags:"AiChat" method:"post" summary:"获取场景下的常见问题"`
  46. Href string `v:"required|length:6,16"`
  47. }
  48. type UsuallyProblemRes struct {
  49. }