aiChatApi.go 1.8 KB

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