Open History to see the last commit
1---
2id: RerankOptions
3title: RerankOptions
4---
5
6Defined in: packages/ai/src/types.ts:2188
7
8Options passed to a [RerankAdapter](RerankAdapter.md). Documents reach the adapter
9already serialized to strings — the `rerank()` activity stringifies object
10documents and maps results back to the original elements, so adapters never
11deal with the caller's document type.
12
13## Type Parameters
14
15### TProviderOptions
16
17`TProviderOptions` *extends* `object` = `Record`\<`string`, `unknown`\>
18
19## Properties
20
21### abortSignal?
22
23```ts
24optional abortSignal?: AbortSignal;
25```
26
27Defined in: packages/ai/src/types.ts:2201
28
29Forwarded to the provider request for cancellation.
30
31***
32
33### documents
34
35```ts
36documents: string[];
37```
38
39Defined in: packages/ai/src/types.ts:2195
40
41Documents to rerank, pre-serialized to strings by the activity.
42
43***
44
45### logger
46
47```ts
48logger: InternalLogger;
49```
50
51Defined in: packages/ai/src/types.ts:2207
52
53Internal logger threaded from the rerank() entry point. Adapters must call
54logger.request() before the provider call and logger.errors() in catch
55blocks.
56
57***
58
59### model
60
61```ts
62model: string;
63```
64
65Defined in: packages/ai/src/types.ts:2191
66
67***
68
69### modelOptions?
70
71```ts
72optional modelOptions?: TProviderOptions;
73```
74
75Defined in: packages/ai/src/types.ts:2199
76
77Provider-specific options forwarded by the rerank() activity.
78
79***
80
81### query
82
83```ts
84query: string;
85```
86
87Defined in: packages/ai/src/types.ts:2193
88
89The search query documents are scored against.
90
91***
92
93### topN?
94
95```ts
96optional topN?: number;
97```
98
99Defined in: packages/ai/src/types.ts:2197
100
101Return only the top N results. Passed through to the provider.