v3-agent-feedback.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-agent-feedback.yaml
  2. post:
  3. summary: 评价一条回答(再次提交即更新)
  4. tags:
  5. - agent-feedback
  6. operationId: post_api_v3_agent_feedback
  7. description: |-
  8. 一人对一条回答只留一条:首次 201,更新 200。点赞的 tags 取 accurate / useful_citations / clear / inspiring,
  9. 点踩的 tags 是原因:citation_wrong / missed / off_topic / incorrect / too_long / too_academic / slow / other;
  10. 只有选了 other 时 comment 才会保存。asked=这条是被主动询问问出来的。
  11. 实现:`V3\AgentFeedbackController@store`
  12. security:
  13. - { }
  14. -
  15. bearerAuth: []
  16. requestBody:
  17. required: true
  18. content:
  19. application/json:
  20. schema:
  21. type: object
  22. properties:
  23. message_id:
  24. type: string
  25. description: 'AG-UI 回答消息 id'
  26. thread_id:
  27. type: string
  28. description: '会话 id(uuid)'
  29. rating:
  30. type: integer
  31. description: '1 赞 / -1 踩(只能是这两个值)'
  32. tags:
  33. type: array
  34. description: 点赞标签或点踩原因
  35. comment:
  36. type: string
  37. description: '选了 other 时的文字说明,最长 1000 字'
  38. asked:
  39. type: boolean
  40. description: 是否主动询问问出来的
  41. device_id:
  42. type: string
  43. description: '设备匿名 id(uuid)。未登录时必填'
  44. client:
  45. type: string
  46. description: 客户端
  47. enum:
  48. - mobile
  49. - web
  50. required:
  51. - message_id
  52. - rating
  53. responses:
  54. 200:
  55. description: 成功
  56. content:
  57. application/json:
  58. schema:
  59. type: object
  60. properties:
  61. data:
  62. type: object
  63. properties:
  64. message_id:
  65. type: string
  66. rating:
  67. type: integer
  68. tags:
  69. type: array
  70. items:
  71. type: string
  72. comment:
  73. type: string
  74. nullable: true
  75. asked:
  76. type: boolean
  77. updated_at:
  78. type: string
  79. 201:
  80. description: '首次评价。响应体与 200 同形'
  81. content:
  82. application/json:
  83. schema:
  84. type: object
  85. properties:
  86. data:
  87. type: object
  88. properties:
  89. message_id:
  90. type: string
  91. rating:
  92. type: integer
  93. tags:
  94. type: array
  95. items:
  96. type: string
  97. comment:
  98. type: string
  99. nullable: true
  100. asked:
  101. type: boolean
  102. updated_at:
  103. type: string
  104. 422:
  105. $ref: '../../main.yaml#/components/responses/ProblemValidation'