TypeScript SDKAPI ReferenceOperations
CreateRerankRequestBody - TypeScript SDK
CreateRerankRequestBody - TypeScript SDK
CreateRerankRequestBody type definition
Rerank request input
Example Usage
1 import { CreateRerankRequestBody } from "@openrouter/sdk/models/operations"; 2 3 let value: CreateRerankRequestBody = { 4 documents: [ 5 "Paris is the capital of France.", 6 "Berlin is the capital of Germany.", 7 ], 8 model: "cohere/rerank-v3.5", 9 query: "What is the capital of France?", 10 };
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
documents | operations.Document[] | ✔️ | The list of documents to rerank. Documents may be plain strings, or structured objects with text and/or image for multimodal models. | [ “Paris is the capital of France.”, “Berlin is the capital of Germany.” ] |
model | string | ✔️ | The rerank model to use | cohere/rerank-v3.5 |
provider | models.ProviderPreferences | ➖ | N/A | {"allow_fallbacks": true} |
query | string | ✔️ | The search query to rerank documents against | What is the capital of France? |
topN | number | ➖ | Number of most relevant documents to return | 3 |