Skip to content

Commit

Permalink
Merge pull request #121 from tryAGI/bot/update-openapi_202412012117
Browse files Browse the repository at this point in the history
feat:No changes made in the pull request.
  • Loading branch information
github-actions[bot] authored Dec 1, 2024
2 parents 1a72530 + 717584a commit 2459991
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/libs/Cohere/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8532,26 +8532,26 @@ paths:
code: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\nfunc main() {\n\tco := client.NewClient()\n\n\tresp, err := co.Rerank(\n\t\tcontext.TODO(),\n\t\t&cohere.RerankRequest{\n\t\t\tQuery: \"What is the capital of the United States?\",\n\t\t\tDocuments: []*cohere.RerankRequestDocumentsItem{\n\t\t\t\t{String: \"Carson City is the capital city of the American state of Nevada.\"},\n\t\t\t\t{String: \"The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.\"},\n\t\t\t\t{String: \"Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.\"},\n\t\t\t\t{String: \"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.\"},\n\t\t\t},\n\t\t\tModel: cohere.String(\"rerank-english-v3.0\"),\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp)\n}\n"
- sdk: typescript
name: Cohere TypeScript SDK
code: "const { CohereClient } = require('cohere-ai');\n\nconst cohere = new CohereClient({});\n\n(async () => {\n const rerank = await cohere.rerank({\n documents: [\n { text: 'Carson City is the capital city of the American state of Nevada.' },\n {\n text: 'The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.',\n },\n {\n text: 'Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.',\n },\n {\n text: '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.',\n },\n {\n text: '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.',\n },\n ],\n query: 'What is the capital of the United States?',\n topN: 3,\n model: 'rerank-english-v3.0',\n });\n\n console.log(rerank);\n})();\n"
code: "const { CohereClient } = require('cohere-ai');\n\nconst cohere = new CohereClient({});\n\n(async () => {\n const rerank = await cohere.rerank({\n documents: [\n { text: 'Carson City is the capital city of the American state of Nevada.' },\n {\n text: 'The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.',\n },\n {\n text: 'Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.',\n },\n {\n text: '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.',\n },\n {\n text: 'Capital punishment 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.',\n },\n ],\n query: 'What is the capital of the United States?',\n topN: 3,\n model: 'rerank-english-v3.0',\n });\n\n console.log(rerank);\n})();\n"
- sdk: python
name: Sync
code: "import cohere\n\nco = cohere.Client()\n\ndocs = [\n \"Carson City is the capital city of the American state of Nevada.\",\n \"The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.\",\n \"Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.\",\n \"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.\",\n \"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.\",\n]\n\nresponse = co.rerank(\n model=\"rerank-english-v3.0\",\n query=\"What is the capital of the United States?\",\n documents=docs,\n top_n=3,\n)\nprint(response)\n"
code: "import cohere\n\nco = cohere.Client()\n\ndocs = [\n \"Carson City is the capital city of the American state of Nevada.\",\n \"The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.\",\n \"Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.\",\n \"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.\",\n \"Capital punishment 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.\",\n]\n\nresponse = co.rerank(\n model=\"rerank-english-v3.0\",\n query=\"What is the capital of the United States?\",\n documents=docs,\n top_n=3,\n)\nprint(response)\n"
- sdk: python
name: Async
code: "import cohere\nimport asyncio\n\nco = cohere.AsyncClient()\n\ndocs = [\n \"Carson City is the capital city of the American state of Nevada.\",\n \"The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.\",\n \"Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.\",\n \"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.\",\n \"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.\",\n]\n\n\nasync def main():\n response = await co.rerank(\n model=\"rerank-english-v2.0\",\n query=\"What is the capital of the United States?\",\n documents=docs,\n top_n=3,\n )\n print(response)\n\n\nasyncio.run(main())\n"
code: "import cohere\nimport asyncio\n\nco = cohere.AsyncClient()\n\ndocs = [\n \"Carson City is the capital city of the American state of Nevada.\",\n \"The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.\",\n \"Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.\",\n \"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.\",\n \"Capital punishment 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.\",\n]\n\n\nasync def main():\n response = await co.rerank(\n model=\"rerank-english-v2.0\",\n query=\"What is the capital of the United States?\",\n documents=docs,\n top_n=3,\n )\n print(response)\n\n\nasyncio.run(main())\n"
- sdk: java
name: Cohere java SDK
code: "/* (C)2024 */\nimport com.cohere.api.Cohere;\nimport com.cohere.api.requests.RerankRequest;\nimport com.cohere.api.types.RerankRequestDocumentsItem;\nimport com.cohere.api.types.RerankResponse;\nimport java.util.List;\n\npublic class RerankPost {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n RerankResponse response =\n cohere.rerank(\n RerankRequest.builder()\n .query(\"What is the capital of the United States?\")\n .documents(\n List.of(\n RerankRequestDocumentsItem.of(\n \"Carson City is the capital city of the\"\n + \" American state of Nevada.\"),\n RerankRequestDocumentsItem.of(\n \"The Commonwealth of the Northern Mariana\"\n + \" Islands is a group of islands in\"\n + \" the Pacific Ocean. Its capital is\"\n + \" Saipan.\"),\n RerankRequestDocumentsItem.of(\n \"Capitalization or capitalisation in\"\n + \" English grammar is the use of a\"\n + \" capital letter at the start of a\"\n + \" word. English usage varies from\"\n + \" capitalization in other\"\n + \" languages.\"),\n RerankRequestDocumentsItem.of(\n \"Washington, D.C. (also known as simply\"\n + \" Washington or D.C., and officially\"\n + \" as the District of Columbia) is the\"\n + \" capital of the United States. It is\"\n + \" a federal district.\"),\n RerankRequestDocumentsItem.of(\n \"Capital punishment (the death penalty) has\"\n + \" existed in the United States since\"\n + \" beforethe United States was a\"\n + \" country. As of 2017, capital\"\n + \" punishment is legal in 30 of the 50\"\n + \" states.\")))\n .model(\"rerank-english-v3.0\")\n .topN(3)\n .build());\n\n System.out.println(response);\n }\n}\n"
code: "/* (C)2024 */\nimport com.cohere.api.Cohere;\nimport com.cohere.api.requests.RerankRequest;\nimport com.cohere.api.types.RerankRequestDocumentsItem;\nimport com.cohere.api.types.RerankResponse;\nimport java.util.List;\n\npublic class RerankPost {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n RerankResponse response =\n cohere.rerank(\n RerankRequest.builder()\n .query(\"What is the capital of the United States?\")\n .documents(\n List.of(\n RerankRequestDocumentsItem.of(\n \"Carson City is the capital city of the\"\n + \" American state of Nevada.\"),\n RerankRequestDocumentsItem.of(\n \"The Commonwealth of the Northern Mariana\"\n + \" Islands is a group of islands in\"\n + \" the Pacific Ocean. Its capital is\"\n + \" Saipan.\"),\n RerankRequestDocumentsItem.of(\n \"Capitalization or capitalisation in\"\n + \" English grammar is the use of a\"\n + \" capital letter at the start of a\"\n + \" word. English usage varies from\"\n + \" capitalization in other\"\n + \" languages.\"),\n RerankRequestDocumentsItem.of(\n \"Washington, D.C. (also known as simply\"\n + \" Washington or D.C., and officially\"\n + \" as the District of Columbia) is the\"\n + \" capital of the United States. It is\"\n + \" a federal district.\"),\n RerankRequestDocumentsItem.of(\n \"Capital punishment has\"\n + \" existed in the United States since\"\n + \" beforethe United States was a\"\n + \" country. As of 2017, capital\"\n + \" punishment is legal in 30 of the 50\"\n + \" states.\")))\n .model(\"rerank-english-v3.0\")\n .topN(3)\n .build());\n\n System.out.println(response);\n }\n}\n"
- sdk: curl
name: cURL
code: "curl --request POST \\\n --url https://api.cohere.com/v1/rerank \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"model\": \"rerank-english-v3.0\",\n \"query\": \"What is the capital of the United States?\",\n \"top_n\": 3,\n \"documents\": [\"Carson City is the capital city of the American state of Nevada.\",\n \"The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.\",\n \"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.\",\n \"Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.\",\n \"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.\"]\n }'"
code: "curl --request POST \\\n --url https://api.cohere.com/v1/rerank \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"model\": \"rerank-english-v3.0\",\n \"query\": \"What is the capital of the United States?\",\n \"top_n\": 3,\n \"documents\": [\"Carson City is the capital city of the American state of Nevada.\",\n \"The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.\",\n \"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.\",\n \"Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.\",\n \"Capital punishment 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.\"]\n }'"
request:
documents:
- text: Carson City is the capital city of the American state of Nevada.
- text: The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.
- text: Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.
- text: '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.'
- text: '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.'
- text: 'Capital punishment 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.'
query: What is the capital of the United States?
top_n: 3
model: rerank-english-v3.0
Expand Down Expand Up @@ -8712,7 +8712,7 @@ paths:
- The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.
- Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.
- '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.'
- 'Capital punishment 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.'
query: What is the capital of the United States?
top_n: 3
model: rerank-english-v3.0
Expand Down

0 comments on commit 2459991

Please sign in to comment.