import * as z from "zod/v4"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import * as models from "../index.js"; export type CreateRerankGlobals = { /** * The app identifier should be your app's URL and is used as the primary identifier for rankings. * * @remarks * This is used to track API usage per application. */ httpReferer?: string | undefined; /** * The app display name allows you to customize how your app appears in OpenRouter's dashboard. * * @remarks */ appTitle?: string | undefined; /** * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. * * @remarks */ appCategories?: string | undefined; }; /** * Rerank request input */ export type CreateRerankRequestBody = { /** * The list of documents to rerank */ documents: Array; /** * The rerank model to use */ model: string; provider?: models.ProviderPreferences | null | undefined; /** * The search query to rerank documents against */ query: string; /** * Number of most relevant documents to return */ topN?: number | undefined; }; export type CreateRerankRequest = { /** * The app identifier should be your app's URL and is used as the primary identifier for rankings. * * @remarks * This is used to track API usage per application. */ httpReferer?: string | undefined; /** * The app display name allows you to customize how your app appears in OpenRouter's dashboard. * * @remarks */ appTitle?: string | undefined; /** * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. * * @remarks */ appCategories?: string | undefined; requestBody: CreateRerankRequestBody; }; /** * The document object containing the original text */ export type Document = { /** * The document text */ text: string; }; /** * A single rerank result */ export type Result = { /** * The document object containing the original text */ document: Document; /** * Index of the document in the original input list */ index: number; /** * Relevance score of the document to the query */ relevanceScore: number; }; /** * Usage statistics */ export type CreateRerankUsage = { /** * Cost of the request in credits */ cost?: number | undefined; /** * Number of search units consumed (Cohere billing) */ searchUnits?: number | undefined; /** * Total number of tokens used */ totalTokens?: number | undefined; }; /** * Rerank response containing ranked results */ export type CreateRerankResponseBody = { /** * Unique identifier for the rerank response (ORID format) */ id?: string | undefined; /** * The model used for reranking */ model: string; /** * The provider that served the rerank request */ provider?: string | undefined; /** * List of rerank results sorted by relevance */ results: Array; /** * Usage statistics */ usage?: CreateRerankUsage | undefined; }; export type CreateRerankResponse = CreateRerankResponseBody | string; /** @internal */ export type CreateRerankRequestBody$Outbound = { documents: Array; model: string; provider?: models.ProviderPreferences$Outbound | null | undefined; query: string; top_n?: number | undefined; }; /** @internal */ export declare const CreateRerankRequestBody$outboundSchema: z.ZodType; export declare function createRerankRequestBodyToJSON(createRerankRequestBody: CreateRerankRequestBody): string; /** @internal */ export type CreateRerankRequest$Outbound = { "HTTP-Referer"?: string | undefined; appTitle?: string | undefined; appCategories?: string | undefined; RequestBody: CreateRerankRequestBody$Outbound; }; /** @internal */ export declare const CreateRerankRequest$outboundSchema: z.ZodType; export declare function createRerankRequestToJSON(createRerankRequest: CreateRerankRequest): string; /** @internal */ export declare const Document$inboundSchema: z.ZodType; export declare function documentFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Result$inboundSchema: z.ZodType; export declare function resultFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreateRerankUsage$inboundSchema: z.ZodType; export declare function createRerankUsageFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreateRerankResponseBody$inboundSchema: z.ZodType; export declare function createRerankResponseBodyFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreateRerankResponse$inboundSchema: z.ZodType; export declare function createRerankResponseFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=creatererank.d.ts.map