v2-chat-messages.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-chat-messages.yaml
  2. get:
  3. summary: '列出 chat-messages'
  4. tags:
  5. - chat-messages
  6. operationId: get_api_v2_chat_messages
  7. description: 实现:`ChatMessageController@index`
  8. parameters:
  9. -
  10. name: chat
  11. in: query
  12. schema:
  13. type: string
  14. -
  15. name: limit
  16. in: query
  17. schema:
  18. type: string
  19. -
  20. name: search
  21. in: query
  22. description: 搜索关键字
  23. schema:
  24. type: string
  25. -
  26. name: order
  27. in: query
  28. description: 排序字段
  29. schema:
  30. type: string
  31. -
  32. name: dir
  33. in: query
  34. description: 排序方向
  35. schema:
  36. type: string
  37. enum:
  38. - desc
  39. - asc
  40. -
  41. name: offset
  42. in: query
  43. description: 从第几条记录开始提取
  44. schema:
  45. type: number
  46. responses:
  47. 200:
  48. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  49. content:
  50. application/json:
  51. schema:
  52. type: object
  53. properties:
  54. ok:
  55. type: boolean
  56. message:
  57. type: string
  58. data:
  59. type: object
  60. properties:
  61. rows:
  62. type: array
  63. items:
  64. type: object
  65. properties: { id: { type: integer }, chat_id: { type: integer }, parent_id: { type: integer }, session_id: { type: integer }, role: { type: string }, content: { type: string }, model_name: { type: string }, tool_calls: { type: string }, tool_call_id: { type: integer }, is_active: { type: boolean }, created_at: { type: string }, updated_at: { type: string } }
  66. count:
  67. type: integer
  68. 401:
  69. $ref: '../../main.yaml#/components/responses/Unauthorized'
  70. 422:
  71. $ref: '../../main.yaml#/components/responses/ValidationError'
  72. post:
  73. summary: '新建 chat-messages'
  74. tags:
  75. - chat-messages
  76. operationId: post_api_v2_chat_messages
  77. description: 实现:`ChatMessageController@store`
  78. responses:
  79. 200:
  80. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  81. content:
  82. application/json:
  83. schema:
  84. type: object
  85. properties:
  86. ok:
  87. type: boolean
  88. message:
  89. type: string
  90. data:
  91. type: object
  92. properties:
  93. id:
  94. type: integer
  95. chat_id:
  96. type: integer
  97. parent_id:
  98. type: integer
  99. session_id:
  100. type: integer
  101. role:
  102. type: string
  103. content:
  104. type: string
  105. model_name:
  106. type: string
  107. tool_calls:
  108. type: string
  109. tool_call_id:
  110. type: integer
  111. is_active:
  112. type: boolean
  113. created_at:
  114. type: string
  115. updated_at:
  116. type: string
  117. 401:
  118. $ref: '../../main.yaml#/components/responses/Unauthorized'
  119. 422:
  120. $ref: '../../main.yaml#/components/responses/ValidationError'