Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

RerankOptions.md

101 lines2.2 KB

Defined in: packages/ai/src/types.ts:2270

Options passed to a RerankAdapter. Documents reach the adapter already serialized to strings — the rerank() activity stringifies object documents and maps results back to the original elements, so adapters never deal with the caller's document type.

Type Parameters

TProviderOptions

TProviderOptions extends object = Record<string, unknown>

Properties

abortSignal?

optional abortSignal?: AbortSignal;

Defined in: packages/ai/src/types.ts:2283

Forwarded to the provider request for cancellation.


documents

documents: string[];

Defined in: packages/ai/src/types.ts:2277

Documents to rerank, pre-serialized to strings by the activity.


logger

logger: InternalLogger;

Defined in: packages/ai/src/types.ts:2289

Internal logger threaded from the rerank() entry point. Adapters must call logger.request() before the provider call and logger.errors() in catch blocks.


model

model: string;

Defined in: packages/ai/src/types.ts:2273


modelOptions?

optional modelOptions?: TProviderOptions;

Defined in: packages/ai/src/types.ts:2281

Provider-specific options forwarded by the rerank() activity.


query

query: string;

Defined in: packages/ai/src/types.ts:2275

The search query documents are scored against.


topN?

optional topN?: number;

Defined in: packages/ai/src/types.ts:2279

Return only the top N results. Passed through to the provider.