aiChatApi.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. CreateTime int64 `json:"create_time" dc:"聊天时间"`
  18. }
  19. type ChatHistoryRes struct {
  20. Data []History `json:"data"`
  21. ErrorMsg string `json:"error_msg"`
  22. ErrorCode int64 `json:"error_code"`
  23. }
  24. // EvaluateReq 评价
  25. type EvaluateReq struct {
  26. g.Meta `path:"/evaluate" tags:"AiChat" method:"post" summary:"评价回复的问题"`
  27. MessageId string `json:"messageId" v:"required"`
  28. Evaluate int `json:"evaluate" v:"in:-1,1" dc:"-1:没用;1:有用"`
  29. }
  30. type EvaluateRes struct {
  31. ErrorMsg string `json:"error_msg"`
  32. ErrorCode int64 `json:"error_code"`
  33. Data bool `json:"data" dc:"true:成功 false:失败"`
  34. }
  35. type QuestionRes struct {
  36. ErrorMsg string `json:"error_msg"`
  37. ErrorCode int64 `json:"error_code"`
  38. Data []string `json:"data" dc:"true:成功 false:失败"`
  39. }
  40. // UsuallyProblemReq 常见问题
  41. type UsuallyProblemReq struct {
  42. g.Meta `path:"/usuallyProblem" tags:"AiChat" method:"post" summary:"获取场景下的常见问题"`
  43. Href string `json:"href" v:"url"`
  44. }