Cohere
    Cohere
    • 关于 Cohere
    • 团队和角色
    • 版本控制
    • 错误
    • 协同生成(Co.Generate)
      POST
    • 协同嵌入(Co.Embed)
      POST
    • 协同聊天(Co.Chat (Beta))
      POST
    • 协同分类(Co.Classify)
      POST
    • 协同分词(Co.Tokenize)
      POST
    • 协同合并分词(Co.Detokenize)
      POST
    • 协同语言检测(Co.Detect_language)
      POST
    • 协同摘要(Co.Summarize)
      POST
    • 协同重新排序(Co.Rerank)
      POST

      协同重新排序(Co.Rerank)

      开发环境
      https://api.cohere.ai/v1
      开发环境
      https://api.cohere.ai/v1
      POST
      https://api.cohere.ai/v1/rerank
      该接口接受一个查询和一个文本列表,并生成一个有序数组,其中每个文本都分配了一个相关性分数。
      请求示例请求示例
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST 'https://api.cohere.ai/v1/rerank' \
      --header 'Content-Type: application/json' \
      --data-raw '{
        "return_documents": false,
        "max_chunks_per_doc": 10,
        "model": "rerank-english-v2.0",
        "query": "What is the capital of the United States?",
        "documents": [
          "Carson City is the capital city of the American state of Nevada.",
          "The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.",
          "Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district.",
          "Capital punishment (the death penalty) has existed in the United States since beforethe United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states."
        ]
      }'
      响应示例响应示例
      {
        "id": "string",
        "results": [
          {
            "document": {
              "text": "string"
            },
            "index": 0,
            "relevance_score": 0
          }
        ],
        "meta": {
          "api_version": {
            "version": "string",
            "is_deprecated": true,
            "is_experimental": true
          },
          "warnings": [
            "string"
          ]
        }
      }

      请求参数

      Body 参数application/json

      示例

      返回响应

      🟢200成功
      application/json
      Body

      修改于 2023-10-31 08:53:56
      上一页
      协同摘要(Co.Summarize)
      Built with