# 重排序

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/rerank:
    post:
      summary: 重排序
      deprecated: false
      description: |-
        给定一个提示，该模型将返回一个或多个预测的完成，并且还可以返回每个位置的替代标记的概率。

        为提供的提示和参数创建完成

        官方文档：https://docs.siliconflow.cn/cn/api-reference/rerank/create-rerank
      tags:
        - Rerank 重排序模型
      parameters:
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Accept
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Authorization
          in: header
          description: ''
          required: false
          example: Bearer {{YOUR_API_KEY}}
          schema:
            type: string
        - name: X-Forwarded-Host
          in: header
          description: ''
          required: false
          example: localhost:5173
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                documents:
                  type: array
                  items:
                    type: string
                query:
                  type: string
                top_n:
                  type: integer
                instruct:
                  type: string
              required:
                - model
                - documents
                - query
                - top_n
                - instruct
              x-apifox-orders:
                - model
                - documents
                - query
                - top_n
                - instruct
            example:
              model: qwen3-rerank
              documents:
                - 文本排序模型广泛用于搜索引擎 and 推荐系统中，它们根据文本相关性对候选文本进行排序
                - 量子计算是计算科学的一个前沿领域
                - 预训练语言模型的发展给文本排序模型带来了新的进展
              query: 什么是文本排序模型
              top_n: 2
              instruct: >-
                Given a web search query, retrieve relevant passages that answer
                the query.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  object:
                    type: string
                  created:
                    type: integer
                  choices:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                        message:
                          type: object
                          properties:
                            role:
                              type: string
                            content:
                              type: string
                          required:
                            - role
                            - content
                          x-apifox-orders:
                            - role
                            - content
                        finish_reason:
                          type: string
                      x-apifox-orders:
                        - index
                        - message
                        - finish_reason
                  usage:
                    type: object
                    properties:
                      prompt_tokens:
                        type: integer
                      completion_tokens:
                        type: integer
                      total_tokens:
                        type: integer
                    required:
                      - prompt_tokens
                      - completion_tokens
                      - total_tokens
                    x-apifox-orders:
                      - prompt_tokens
                      - completion_tokens
                      - total_tokens
                required:
                  - id
                  - object
                  - created
                  - choices
                  - usage
                x-apifox-orders:
                  - id
                  - object
                  - created
                  - choices
                  - usage
              examples:
                '1':
                  summary: OK
                  value:
                    id: chatcmpl-123
                    object: chat.completion
                    created: 1677652288
                    choices:
                      - index: 0
                        message:
                          role: assistant
                          content: |-


                            Hello there, how may I assist you today?
                        finish_reason: stop
                    usage:
                      prompt_tokens: 9
                      completion_tokens: 12
                      total_tokens: 21
                '2':
                  summary: 成功示例
                  value:
                    results:
                      - document:
                          text: 文本排序模型广泛用于搜索引擎 and 推荐系统中，它们根据文本相关性对候选文本进行排序
                        index: 0
                        relevance_score: 0.915543128021105
                      - document:
                          text: 预训练语言模型的发展给文本排序模型带来了新的进展
                        index: 2
                        relevance_score: 0.7576691095659295
                    usage:
                      prompt_tokens: 107
                      completion_tokens: 0
                      total_tokens: 107
                      prompt_tokens_details:
                        cached_tokens: 0
                        text_tokens: 0
                        audio_tokens: 0
                        image_tokens: 0
                      completion_tokens_details:
                        text_tokens: 0
                        audio_tokens: 0
                        reasoning_tokens: 0
                      input_tokens: 0
                      output_tokens: 0
                      input_tokens_details: null
          headers: {}
          x-apifox-name: OK
      security:
        - bearer: []
      x-apifox-folder: Rerank 重排序模型
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/8227283/apis/api-453794026-run
components:
  schemas: {}
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
servers: []
security:
  - bearer: []

```
