openapi: 3.1.0 info: title: FastAPI - Swagger UI version: 1.0.0 servers: - url: "http://192.168.3.10:8501" description: "测试服务器" paths: /api/search_personal: post: summary: Search Personal description: "功能:搜索个人资料库,获取文章列表。输入参数:文章标题。返回数据:包括文章标题的json数据,json数据中的meta对象是文章的列表,分别包括文章的id,title:标题,url:链接" operationId: search_personal_api_search_personal_post requestBody: content: application/json: schema: $ref: '#/components/schemas/SearchRequest' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/SearchResponseV2' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/search: post: summary: Search Text description: "功能:搜索法律法规,获取法律法规的文章列表。输入参数:文章标题。返回数据:包括文章标题的json数据,json数据中的meta对象是文章的列表,分别包括文章的id,title:标题,url:链接, source: 文档来源。json数据中的content对象是文章的部分文本,分别包括切片的id,title:相关文章标题,url:相关文章链接, article_text: 文本内容" operationId: search_text_api_search_post requestBody: content: application/json: schema: $ref: '#/components/schemas/SearchRequest' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/SearchResponseV2' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/get_document/{req}: get: summary: Get Document description: "功能:按照标题获取文章详细内容。输入参数:文章标题。返回数据:包括文章内容的json数据。json对象中的title是文章标题,json对象中的text是文章内容" operationId: get_document_api_get_document__req__get parameters: - name: req in: path required: true schema: type: string title: Req responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/GetDocumentResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: EmbeddingRequest: properties: action: type: string title: Action data: items: $ref: '#/components/schemas/TextData' type: array title: Data type: object required: - action - data title: EmbeddingRequest EmbeddingResponse: properties: status: type: string title: Status vectors: items: $ref: '#/components/schemas/VectorData' type: array title: Vectors type: object required: - status - vectors title: EmbeddingResponse GetDocumentRequest: properties: action: type: string title: Action title: type: string title: Title type: object required: - action - title title: GetDocumentRequest GetDocumentResponse: properties: status: type: string title: Status title: type: string title: Title text: type: string title: Text url: anyOf: - type: string - type: 'null' title: Url type: object required: - status - title - text - url title: GetDocumentResponse HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError SearchRequest: properties: action: type: string title: Action default: “search” query: type: string title: Query top_k: type: integer title: Top K default: 20 meta_only: anyOf: - type: boolean - type: 'null' title: Meta Only default: false type: object required: - action - query title: SearchRequest SearchResponseV2: properties: meta: items: $ref: '#/components/schemas/SearchResultMeta' type: array title: Meta content: items: $ref: '#/components/schemas/SearchResultContent' type: array title: Content type: object required: - meta - content title: SearchResponseV2 SearchResultContent: properties: id: type: string title: Id title: type: string title: Title article_text: type: string title: Article Text type: object required: - id - title - article_text title: SearchResultContent SearchResultMeta: properties: id: type: string title: Id title: type: string title: Title pub_date: type: string title: Pub Date url: type: string title: Url type: object required: - id - title - pub_date - url title: SearchResultMeta TextData: properties: text: type: string title: Text type: object required: - text title: TextData ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError VectorData: properties: text: type: string title: Text vector: items: type: number type: array title: Vector type: object required: - text - vector title: VectorData