> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiapi.xiaoliu.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建重排序

> 对多个示例文档根据与查询的相关性进行重新排序



## OpenAPI

````yaml /api-reference/rerank/cteate-rerank.json POST /v1/rerank
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
  description: API 文档，支持绘图、语音生成、视频生成、音乐生成等多种 AIGC 接口。
servers:
  - url: https://aiapi.xiaoliu.fun
    description: 生产服务器
security:
  - bearerAuth: []
paths:
  /v1/rerank:
    post:
      tags:
        - 重排序模型
      summary: 创建重排序
      description: 对多个示例文档根据与查询的相关性进行重新排序
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                query:
                  type: string
                top_n:
                  type: integer
                documents:
                  type: array
                  items:
                    type: string
              required:
                - model
                - query
                - documents
      responses:
        '200':
          description: 成功响应
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                        relevance_score:
                          type: number
                  usage:
                    type: object
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````