openapi 3.1.0.txt 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. openapi: 3.1.0
  2. info:
  3. title: FastAPI - Swagger UI
  4. version: 1.0.0
  5. servers:
  6. - url: "http://192.168.3.10:8501"
  7. description: "测试服务器"
  8. paths:
  9. /api/search_personal:
  10. post:
  11. summary: Search Personal
  12. description: "功能:搜索个人资料库,获取文章列表。输入参数:文章标题。返回数据:包括文章标题的json数据,json数据中的meta对象是文章的列表,分别包括文章的id,title:标题,url:链接"
  13. operationId: search_personal_api_search_personal_post
  14. requestBody:
  15. content:
  16. application/json:
  17. schema:
  18. $ref: '#/components/schemas/SearchRequest'
  19. required: true
  20. responses:
  21. '200':
  22. description: Successful Response
  23. content:
  24. application/json:
  25. schema:
  26. $ref: '#/components/schemas/SearchResponseV2'
  27. '422':
  28. description: Validation Error
  29. content:
  30. application/json:
  31. schema:
  32. $ref: '#/components/schemas/HTTPValidationError'
  33. /api/search:
  34. post:
  35. summary: Search Text
  36. description: "功能:搜索法律法规,获取法律法规的文章列表。输入参数:文章标题。返回数据:包括文章标题的json数据,json数据中的meta对象是文章的列表,分别包括文章的id,title:标题,url:链接, source: 文档来源。json数据中的content对象是文章的部分文本,分别包括切片的id,title:相关文章标题,url:相关文章链接, article_text: 文本内容"
  37. operationId: search_text_api_search_post
  38. requestBody:
  39. content:
  40. application/json:
  41. schema:
  42. $ref: '#/components/schemas/SearchRequest'
  43. required: true
  44. responses:
  45. '200':
  46. description: Successful Response
  47. content:
  48. application/json:
  49. schema:
  50. $ref: '#/components/schemas/SearchResponseV2'
  51. '422':
  52. description: Validation Error
  53. content:
  54. application/json:
  55. schema:
  56. $ref: '#/components/schemas/HTTPValidationError'
  57. /api/get_document/{req}:
  58. get:
  59. summary: Get Document
  60. description: "功能:按照标题获取文章详细内容。输入参数:文章标题。返回数据:包括文章内容的json数据。json对象中的title是文章标题,json对象中的text是文章内容"
  61. operationId: get_document_api_get_document__req__get
  62. parameters:
  63. - name: req
  64. in: path
  65. required: true
  66. schema:
  67. type: string
  68. title: Req
  69. responses:
  70. '200':
  71. description: Successful Response
  72. content:
  73. application/json:
  74. schema:
  75. $ref: '#/components/schemas/GetDocumentResponse'
  76. '422':
  77. description: Validation Error
  78. content:
  79. application/json:
  80. schema:
  81. $ref: '#/components/schemas/HTTPValidationError'
  82. components:
  83. schemas:
  84. EmbeddingRequest:
  85. properties:
  86. action:
  87. type: string
  88. title: Action
  89. data:
  90. items:
  91. $ref: '#/components/schemas/TextData'
  92. type: array
  93. title: Data
  94. type: object
  95. required:
  96. - action
  97. - data
  98. title: EmbeddingRequest
  99. EmbeddingResponse:
  100. properties:
  101. status:
  102. type: string
  103. title: Status
  104. vectors:
  105. items:
  106. $ref: '#/components/schemas/VectorData'
  107. type: array
  108. title: Vectors
  109. type: object
  110. required:
  111. - status
  112. - vectors
  113. title: EmbeddingResponse
  114. GetDocumentRequest:
  115. properties:
  116. action:
  117. type: string
  118. title: Action
  119. title:
  120. type: string
  121. title: Title
  122. type: object
  123. required:
  124. - action
  125. - title
  126. title: GetDocumentRequest
  127. GetDocumentResponse:
  128. properties:
  129. status:
  130. type: string
  131. title: Status
  132. title:
  133. type: string
  134. title: Title
  135. text:
  136. type: string
  137. title: Text
  138. url:
  139. anyOf:
  140. - type: string
  141. - type: 'null'
  142. title: Url
  143. type: object
  144. required:
  145. - status
  146. - title
  147. - text
  148. - url
  149. title: GetDocumentResponse
  150. HTTPValidationError:
  151. properties:
  152. detail:
  153. items:
  154. $ref: '#/components/schemas/ValidationError'
  155. type: array
  156. title: Detail
  157. type: object
  158. title: HTTPValidationError
  159. SearchRequest:
  160. properties:
  161. action:
  162. type: string
  163. title: Action
  164. default: “search”
  165. query:
  166. type: string
  167. title: Query
  168. top_k:
  169. type: integer
  170. title: Top K
  171. default: 20
  172. meta_only:
  173. anyOf:
  174. - type: boolean
  175. - type: 'null'
  176. title: Meta Only
  177. default: false
  178. type: object
  179. required:
  180. - action
  181. - query
  182. title: SearchRequest
  183. SearchResponseV2:
  184. properties:
  185. meta:
  186. items:
  187. $ref: '#/components/schemas/SearchResultMeta'
  188. type: array
  189. title: Meta
  190. content:
  191. items:
  192. $ref: '#/components/schemas/SearchResultContent'
  193. type: array
  194. title: Content
  195. type: object
  196. required:
  197. - meta
  198. - content
  199. title: SearchResponseV2
  200. SearchResultContent:
  201. properties:
  202. id:
  203. type: string
  204. title: Id
  205. title:
  206. type: string
  207. title: Title
  208. article_text:
  209. type: string
  210. title: Article Text
  211. type: object
  212. required:
  213. - id
  214. - title
  215. - article_text
  216. title: SearchResultContent
  217. SearchResultMeta:
  218. properties:
  219. id:
  220. type: string
  221. title: Id
  222. title:
  223. type: string
  224. title: Title
  225. pub_date:
  226. type: string
  227. title: Pub Date
  228. url:
  229. type: string
  230. title: Url
  231. type: object
  232. required:
  233. - id
  234. - title
  235. - pub_date
  236. - url
  237. title: SearchResultMeta
  238. TextData:
  239. properties:
  240. text:
  241. type: string
  242. title: Text
  243. type: object
  244. required:
  245. - text
  246. title: TextData
  247. ValidationError:
  248. properties:
  249. loc:
  250. items:
  251. anyOf:
  252. - type: string
  253. - type: integer
  254. type: array
  255. title: Location
  256. msg:
  257. type: string
  258. title: Message
  259. type:
  260. type: string
  261. title: Error Type
  262. type: object
  263. required:
  264. - loc
  265. - msg
  266. - type
  267. title: ValidationError
  268. VectorData:
  269. properties:
  270. text:
  271. type: string
  272. title: Text
  273. vector:
  274. items:
  275. type: number
  276. type: array
  277. title: Vector
  278. type: object
  279. required:
  280. - text
  281. - vector
  282. title: VectorData