aiChatApi.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. PrevId string `json:"prevId" dc:"当前记录id"`
  11. }
  12. type History struct {
  13. Id string `json:"id" dc:"信息加密id"`
  14. Content string `json:"content" dc:"内容"`
  15. Type int `json:"type" dc:"1:用户提问 2:智能助手回复"`
  16. Useful int `json:"useful" dc:"1:有用 -1:无用 0:暂无评价"`
  17. Actions int `json:"actions" dc:"是否有功能按钮 1:有 0:没有"`
  18. CreateTime int64 `json:"create_time" dc:"聊天时间"`
  19. }
  20. type ChatHistoryRes struct {
  21. Data struct {
  22. HasMore bool `json:"hasMore" dc:"是否有下一页"`
  23. List []History `json:"list" dc:"聊天历史"`
  24. } `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 `json:"messageId" v:"required"`
  32. Evaluate int `json:"evaluate" v:"in:-1,1" dc:"-1:没用;1:有用"`
  33. }
  34. type EvaluateRes struct {
  35. ErrorMsg string `json:"error_msg"`
  36. ErrorCode int64 `json:"error_code"`
  37. Data bool `json:"data" dc:"true:成功 false:失败"`
  38. }
  39. type QuestionRes struct {
  40. ErrorMsg string `json:"error_msg"`
  41. ErrorCode int64 `json:"error_code"`
  42. Data []string `json:"data" dc:"true:成功 false:失败"`
  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. }