v2-ai-model.yaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-ai-model.yaml
  2. get:
  3. summary: '列出 ai-model'
  4. tags:
  5. - ai-model
  6. operationId: get_api_v2_ai_model
  7. description: 实现:`AiModelController@index`
  8. parameters:
  9. -
  10. name: view
  11. in: query
  12. schema:
  13. type: string
  14. enum:
  15. - all
  16. - studio
  17. - usable
  18. - chat
  19. -
  20. name: name
  21. in: query
  22. schema:
  23. type: string
  24. -
  25. name: user_id
  26. in: query
  27. schema:
  28. type: string
  29. -
  30. name: keyword
  31. in: query
  32. schema:
  33. type: string
  34. -
  35. name: order
  36. in: query
  37. schema:
  38. type: string
  39. default: created_at
  40. -
  41. name: dir
  42. in: query
  43. schema:
  44. type: string
  45. default: asc
  46. -
  47. name: offset
  48. in: query
  49. schema:
  50. type: string
  51. -
  52. name: limit
  53. in: query
  54. schema:
  55. type: string
  56. -
  57. name: search
  58. in: query
  59. description: 搜索关键字
  60. schema:
  61. type: string
  62. responses:
  63. 200:
  64. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  65. content:
  66. application/json:
  67. schema:
  68. type: object
  69. properties:
  70. ok:
  71. type: boolean
  72. message:
  73. type: string
  74. data:
  75. type: object
  76. properties:
  77. rows:
  78. type: array
  79. items:
  80. type: object
  81. properties: { uid: { type: string }, name: { type: string }, description: { type: string }, url: { type: string }, model: { type: string }, privacy: { type: string }, owner_id: { type: integer }, editor_id: { type: integer }, created_at: { type: string }, updated_at: { type: string }, user: { type: string }, key: { type: string }, system_prompt: { type: string } }
  82. count:
  83. type: integer
  84. 401:
  85. $ref: '../../main.yaml#/components/responses/Unauthorized'
  86. 422:
  87. $ref: '../../main.yaml#/components/responses/ValidationError'
  88. post:
  89. summary: '新建 ai-model'
  90. tags:
  91. - ai-model
  92. operationId: post_api_v2_ai_model
  93. description: 实现:`AiModelController@store`
  94. requestBody:
  95. required: false
  96. content:
  97. application/json:
  98. schema:
  99. type: object
  100. properties:
  101. studio_name:
  102. type: string
  103. name:
  104. type: string
  105. privacy:
  106. type: string
  107. default: private
  108. responses:
  109. 200:
  110. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  111. content:
  112. application/json:
  113. schema:
  114. type: object
  115. properties:
  116. ok:
  117. type: boolean
  118. message:
  119. type: string
  120. data:
  121. type: object
  122. properties:
  123. uid:
  124. type: string
  125. name:
  126. type: string
  127. description:
  128. type: string
  129. url:
  130. type: string
  131. model:
  132. type: string
  133. privacy:
  134. type: string
  135. owner_id:
  136. type: integer
  137. editor_id:
  138. type: integer
  139. created_at:
  140. type: string
  141. updated_at:
  142. type: string
  143. user:
  144. type: string
  145. key:
  146. type: string
  147. system_prompt:
  148. type: string
  149. 401:
  150. $ref: '../../main.yaml#/components/responses/Unauthorized'
  151. 422:
  152. $ref: '../../main.yaml#/components/responses/ValidationError'