import * as z from "zod/v3";
import { ClosedEnum } from "../../types/enums.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import * as components from "../components/index.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type CreateRerankFallbacks = {
    /**
     * Fallback model identifier
     */
    model: string;
};
/**
 * Retry configuration for the request
 */
export type CreateRerankRetry = {
    /**
     * Number of retry attempts (1-5)
     */
    count?: number | undefined;
    /**
     * HTTP status codes that trigger retry logic
     */
    onCodes?: Array<number> | undefined;
};
export declare const CreateRerankType: {
    readonly ExactMatch: "exact_match";
};
export type CreateRerankType = ClosedEnum<typeof CreateRerankType>;
/**
 * Cache configuration for the request.
 */
export type CreateRerankCache = {
    /**
     * Time to live for cached responses in seconds. Maximum 259200 seconds (3 days).
     */
    ttl?: number | undefined;
    type: CreateRerankType;
};
export declare const CreateRerankLoadBalancerType: {
    readonly WeightBased: "weight_based";
};
export type CreateRerankLoadBalancerType = ClosedEnum<typeof CreateRerankLoadBalancerType>;
export type CreateRerankLoadBalancerModels = {
    /**
     * Model identifier for load balancing
     */
    model: string;
    /**
     * Weight assigned to this model for load balancing
     */
    weight?: number | undefined;
};
export type CreateRerankLoadBalancer1 = {
    type: CreateRerankLoadBalancerType;
    models: Array<CreateRerankLoadBalancerModels>;
};
/**
 * Load balancer configuration for the request.
 */
export type CreateRerankLoadBalancer = CreateRerankLoadBalancer1;
/**
 * Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured.
 */
export type CreateRerankTimeout = {
    /**
     * Timeout value in milliseconds
     */
    callTimeout: number;
};
export type CreateRerankRouterRerankFallbacks = {
    /**
     * Fallback model identifier
     */
    model: string;
};
export declare const CreateRerankRouterRerankType: {
    readonly ExactMatch: "exact_match";
};
export type CreateRerankRouterRerankType = ClosedEnum<typeof CreateRerankRouterRerankType>;
/**
 * Cache configuration for the request.
 */
export type CreateRerankRouterRerankCache = {
    /**
     * Time to live for cached responses in seconds. Maximum 259200 seconds (3 days).
     */
    ttl?: number | undefined;
    type: CreateRerankRouterRerankType;
};
/**
 * Retry configuration for the request
 */
export type CreateRerankRouterRerankRetry = {
    /**
     * Number of retry attempts (1-5)
     */
    count?: number | undefined;
    /**
     * HTTP status codes that trigger retry logic
     */
    onCodes?: Array<number> | undefined;
};
export declare const CreateRerankLoadBalancerRouterRerankType: {
    readonly WeightBased: "weight_based";
};
export type CreateRerankLoadBalancerRouterRerankType = ClosedEnum<typeof CreateRerankLoadBalancerRouterRerankType>;
export type CreateRerankLoadBalancerRouterRerankModels = {
    /**
     * Model identifier for load balancing
     */
    model: string;
    /**
     * Weight assigned to this model for load balancing
     */
    weight?: number | undefined;
};
export type CreateRerankLoadBalancerRouterRerank1 = {
    type: CreateRerankLoadBalancerRouterRerankType;
    models: Array<CreateRerankLoadBalancerRouterRerankModels>;
};
/**
 * Array of models with weights for load balancing requests
 */
export type CreateRerankRouterRerankLoadBalancer = CreateRerankLoadBalancerRouterRerank1;
/**
 * Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured.
 */
export type CreateRerankRouterRerankTimeout = {
    /**
     * Timeout value in milliseconds
     */
    callTimeout: number;
};
export type CreateRerankOrq = {
    /**
     * The name to display on the trace. If not specified, the default system name will be used.
     */
    name?: string | undefined;
    /**
     * Array of fallback models to use if primary model fails
     */
    fallbacks?: Array<CreateRerankRouterRerankFallbacks> | undefined;
    /**
     * Cache configuration for the request.
     */
    cache?: CreateRerankRouterRerankCache | undefined;
    /**
     * Retry configuration for the request
     */
    retry?: CreateRerankRouterRerankRetry | undefined;
    /**
     * Information about the identity making the request. If the identity does not exist, it will be created automatically.
     */
    identity?: components.PublicIdentity | undefined;
    /**
     * @deprecated Use identity instead. Information about the contact making the request.
     *
     * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
     */
    contact?: components.PublicContact | undefined;
    /**
     * Array of models with weights for load balancing requests
     */
    loadBalancer?: CreateRerankLoadBalancerRouterRerank1 | undefined;
    /**
     * Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured.
     */
    timeout?: CreateRerankRouterRerankTimeout | undefined;
};
/**
 * input
 */
export type CreateRerankRequestBody = {
    /**
     * The search query
     */
    query: string;
    /**
     * A list of texts that will be compared to the `query`. For optimal performance we recommend against sending more than 1,000 documents in a single request.
     */
    documents: Array<string>;
    /**
     * The identifier of the model to use
     */
    model: string;
    /**
     * The number of most relevant documents or indices to return, defaults to the length of the documents
     */
    topN?: number | undefined;
    /**
     * The filename of the document to rerank
     */
    filename?: string | null | undefined;
    /**
     * The name to display on the trace. If not specified, the default system name will be used.
     */
    name?: string | undefined;
    /**
     * Array of fallback models to use if primary model fails
     */
    fallbacks?: Array<CreateRerankFallbacks> | undefined;
    /**
     * Retry configuration for the request
     */
    retry?: CreateRerankRetry | undefined;
    /**
     * Cache configuration for the request.
     */
    cache?: CreateRerankCache | undefined;
    /**
     * Load balancer configuration for the request.
     */
    loadBalancer?: CreateRerankLoadBalancer1 | undefined;
    /**
     * Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured.
     */
    timeout?: CreateRerankTimeout | undefined;
    orq?: CreateRerankOrq | undefined;
};
export declare const CreateRerankObject: {
    readonly List: "list";
};
export type CreateRerankObject = ClosedEnum<typeof CreateRerankObject>;
/**
 * The object type, which is always `rerank`.
 */
export declare const CreateRerankRouterRerankObject: {
    readonly Rerank: "rerank";
};
/**
 * The object type, which is always `rerank`.
 */
export type CreateRerankRouterRerankObject = ClosedEnum<typeof CreateRerankRouterRerankObject>;
/**
 * If return_documents is set as false this will return none, if true it will return the documents passed in
 */
export type CreateRerankDocument = {
    /**
     * The text of the document to rerank
     */
    text: string;
};
export type CreateRerankResults = {
    /**
     * The object type, which is always `rerank`.
     */
    object: CreateRerankRouterRerankObject;
    /**
     * Corresponds to the index in the original list of documents to which the ranked document belongs.
     */
    index: number;
    /**
     * Relevance scores are normalized to be in the range [0, 1]. Scores close to 1 indicate a high relevance to the query, and scores closer to 0 indicate low relevance.
     */
    relevanceScore: number;
    /**
     * If return_documents is set as false this will return none, if true it will return the documents passed in
     */
    document?: CreateRerankDocument | undefined;
};
export type CreateRerankUsage = {
    /**
     * The total number of tokens used in the rerank
     */
    totalTokens: number;
};
/**
 * Returns the reranked documents.
 */
export type CreateRerankResponseBody = {
    /**
     * A unique identifier for the rerank.
     */
    id?: string | undefined;
    object: CreateRerankObject;
    /**
     * An ordered list of ranked documents
     */
    results: Array<CreateRerankResults>;
    usage?: CreateRerankUsage | undefined;
};
/** @internal */
export type CreateRerankFallbacks$Outbound = {
    model: string;
};
/** @internal */
export declare const CreateRerankFallbacks$outboundSchema: z.ZodType<CreateRerankFallbacks$Outbound, z.ZodTypeDef, CreateRerankFallbacks>;
export declare function createRerankFallbacksToJSON(createRerankFallbacks: CreateRerankFallbacks): string;
/** @internal */
export type CreateRerankRetry$Outbound = {
    count: number;
    on_codes?: Array<number> | undefined;
};
/** @internal */
export declare const CreateRerankRetry$outboundSchema: z.ZodType<CreateRerankRetry$Outbound, z.ZodTypeDef, CreateRerankRetry>;
export declare function createRerankRetryToJSON(createRerankRetry: CreateRerankRetry): string;
/** @internal */
export declare const CreateRerankType$outboundSchema: z.ZodNativeEnum<typeof CreateRerankType>;
/** @internal */
export type CreateRerankCache$Outbound = {
    ttl: number;
    type: string;
};
/** @internal */
export declare const CreateRerankCache$outboundSchema: z.ZodType<CreateRerankCache$Outbound, z.ZodTypeDef, CreateRerankCache>;
export declare function createRerankCacheToJSON(createRerankCache: CreateRerankCache): string;
/** @internal */
export declare const CreateRerankLoadBalancerType$outboundSchema: z.ZodNativeEnum<typeof CreateRerankLoadBalancerType>;
/** @internal */
export type CreateRerankLoadBalancerModels$Outbound = {
    model: string;
    weight: number;
};
/** @internal */
export declare const CreateRerankLoadBalancerModels$outboundSchema: z.ZodType<CreateRerankLoadBalancerModels$Outbound, z.ZodTypeDef, CreateRerankLoadBalancerModels>;
export declare function createRerankLoadBalancerModelsToJSON(createRerankLoadBalancerModels: CreateRerankLoadBalancerModels): string;
/** @internal */
export type CreateRerankLoadBalancer1$Outbound = {
    type: string;
    models: Array<CreateRerankLoadBalancerModels$Outbound>;
};
/** @internal */
export declare const CreateRerankLoadBalancer1$outboundSchema: z.ZodType<CreateRerankLoadBalancer1$Outbound, z.ZodTypeDef, CreateRerankLoadBalancer1>;
export declare function createRerankLoadBalancer1ToJSON(createRerankLoadBalancer1: CreateRerankLoadBalancer1): string;
/** @internal */
export type CreateRerankLoadBalancer$Outbound = CreateRerankLoadBalancer1$Outbound;
/** @internal */
export declare const CreateRerankLoadBalancer$outboundSchema: z.ZodType<CreateRerankLoadBalancer$Outbound, z.ZodTypeDef, CreateRerankLoadBalancer>;
export declare function createRerankLoadBalancerToJSON(createRerankLoadBalancer: CreateRerankLoadBalancer): string;
/** @internal */
export type CreateRerankTimeout$Outbound = {
    call_timeout: number;
};
/** @internal */
export declare const CreateRerankTimeout$outboundSchema: z.ZodType<CreateRerankTimeout$Outbound, z.ZodTypeDef, CreateRerankTimeout>;
export declare function createRerankTimeoutToJSON(createRerankTimeout: CreateRerankTimeout): string;
/** @internal */
export type CreateRerankRouterRerankFallbacks$Outbound = {
    model: string;
};
/** @internal */
export declare const CreateRerankRouterRerankFallbacks$outboundSchema: z.ZodType<CreateRerankRouterRerankFallbacks$Outbound, z.ZodTypeDef, CreateRerankRouterRerankFallbacks>;
export declare function createRerankRouterRerankFallbacksToJSON(createRerankRouterRerankFallbacks: CreateRerankRouterRerankFallbacks): string;
/** @internal */
export declare const CreateRerankRouterRerankType$outboundSchema: z.ZodNativeEnum<typeof CreateRerankRouterRerankType>;
/** @internal */
export type CreateRerankRouterRerankCache$Outbound = {
    ttl: number;
    type: string;
};
/** @internal */
export declare const CreateRerankRouterRerankCache$outboundSchema: z.ZodType<CreateRerankRouterRerankCache$Outbound, z.ZodTypeDef, CreateRerankRouterRerankCache>;
export declare function createRerankRouterRerankCacheToJSON(createRerankRouterRerankCache: CreateRerankRouterRerankCache): string;
/** @internal */
export type CreateRerankRouterRerankRetry$Outbound = {
    count: number;
    on_codes?: Array<number> | undefined;
};
/** @internal */
export declare const CreateRerankRouterRerankRetry$outboundSchema: z.ZodType<CreateRerankRouterRerankRetry$Outbound, z.ZodTypeDef, CreateRerankRouterRerankRetry>;
export declare function createRerankRouterRerankRetryToJSON(createRerankRouterRerankRetry: CreateRerankRouterRerankRetry): string;
/** @internal */
export declare const CreateRerankLoadBalancerRouterRerankType$outboundSchema: z.ZodNativeEnum<typeof CreateRerankLoadBalancerRouterRerankType>;
/** @internal */
export type CreateRerankLoadBalancerRouterRerankModels$Outbound = {
    model: string;
    weight: number;
};
/** @internal */
export declare const CreateRerankLoadBalancerRouterRerankModels$outboundSchema: z.ZodType<CreateRerankLoadBalancerRouterRerankModels$Outbound, z.ZodTypeDef, CreateRerankLoadBalancerRouterRerankModels>;
export declare function createRerankLoadBalancerRouterRerankModelsToJSON(createRerankLoadBalancerRouterRerankModels: CreateRerankLoadBalancerRouterRerankModels): string;
/** @internal */
export type CreateRerankLoadBalancerRouterRerank1$Outbound = {
    type: string;
    models: Array<CreateRerankLoadBalancerRouterRerankModels$Outbound>;
};
/** @internal */
export declare const CreateRerankLoadBalancerRouterRerank1$outboundSchema: z.ZodType<CreateRerankLoadBalancerRouterRerank1$Outbound, z.ZodTypeDef, CreateRerankLoadBalancerRouterRerank1>;
export declare function createRerankLoadBalancerRouterRerank1ToJSON(createRerankLoadBalancerRouterRerank1: CreateRerankLoadBalancerRouterRerank1): string;
/** @internal */
export type CreateRerankRouterRerankLoadBalancer$Outbound = CreateRerankLoadBalancerRouterRerank1$Outbound;
/** @internal */
export declare const CreateRerankRouterRerankLoadBalancer$outboundSchema: z.ZodType<CreateRerankRouterRerankLoadBalancer$Outbound, z.ZodTypeDef, CreateRerankRouterRerankLoadBalancer>;
export declare function createRerankRouterRerankLoadBalancerToJSON(createRerankRouterRerankLoadBalancer: CreateRerankRouterRerankLoadBalancer): string;
/** @internal */
export type CreateRerankRouterRerankTimeout$Outbound = {
    call_timeout: number;
};
/** @internal */
export declare const CreateRerankRouterRerankTimeout$outboundSchema: z.ZodType<CreateRerankRouterRerankTimeout$Outbound, z.ZodTypeDef, CreateRerankRouterRerankTimeout>;
export declare function createRerankRouterRerankTimeoutToJSON(createRerankRouterRerankTimeout: CreateRerankRouterRerankTimeout): string;
/** @internal */
export type CreateRerankOrq$Outbound = {
    name?: string | undefined;
    fallbacks?: Array<CreateRerankRouterRerankFallbacks$Outbound> | undefined;
    cache?: CreateRerankRouterRerankCache$Outbound | undefined;
    retry?: CreateRerankRouterRerankRetry$Outbound | undefined;
    identity?: components.PublicIdentity$Outbound | undefined;
    contact?: components.PublicContact$Outbound | undefined;
    load_balancer?: CreateRerankLoadBalancerRouterRerank1$Outbound | undefined;
    timeout?: CreateRerankRouterRerankTimeout$Outbound | undefined;
};
/** @internal */
export declare const CreateRerankOrq$outboundSchema: z.ZodType<CreateRerankOrq$Outbound, z.ZodTypeDef, CreateRerankOrq>;
export declare function createRerankOrqToJSON(createRerankOrq: CreateRerankOrq): string;
/** @internal */
export type CreateRerankRequestBody$Outbound = {
    query: string;
    documents: Array<string>;
    model: string;
    top_n?: number | undefined;
    filename?: string | null | undefined;
    name?: string | undefined;
    fallbacks?: Array<CreateRerankFallbacks$Outbound> | undefined;
    retry?: CreateRerankRetry$Outbound | undefined;
    cache?: CreateRerankCache$Outbound | undefined;
    load_balancer?: CreateRerankLoadBalancer1$Outbound | undefined;
    timeout?: CreateRerankTimeout$Outbound | undefined;
    orq?: CreateRerankOrq$Outbound | undefined;
};
/** @internal */
export declare const CreateRerankRequestBody$outboundSchema: z.ZodType<CreateRerankRequestBody$Outbound, z.ZodTypeDef, CreateRerankRequestBody>;
export declare function createRerankRequestBodyToJSON(createRerankRequestBody: CreateRerankRequestBody): string;
/** @internal */
export declare const CreateRerankObject$inboundSchema: z.ZodNativeEnum<typeof CreateRerankObject>;
/** @internal */
export declare const CreateRerankRouterRerankObject$inboundSchema: z.ZodNativeEnum<typeof CreateRerankRouterRerankObject>;
/** @internal */
export declare const CreateRerankDocument$inboundSchema: z.ZodType<CreateRerankDocument, z.ZodTypeDef, unknown>;
export declare function createRerankDocumentFromJSON(jsonString: string): SafeParseResult<CreateRerankDocument, SDKValidationError>;
/** @internal */
export declare const CreateRerankResults$inboundSchema: z.ZodType<CreateRerankResults, z.ZodTypeDef, unknown>;
export declare function createRerankResultsFromJSON(jsonString: string): SafeParseResult<CreateRerankResults, SDKValidationError>;
/** @internal */
export declare const CreateRerankUsage$inboundSchema: z.ZodType<CreateRerankUsage, z.ZodTypeDef, unknown>;
export declare function createRerankUsageFromJSON(jsonString: string): SafeParseResult<CreateRerankUsage, SDKValidationError>;
/** @internal */
export declare const CreateRerankResponseBody$inboundSchema: z.ZodType<CreateRerankResponseBody, z.ZodTypeDef, unknown>;
export declare function createRerankResponseBodyFromJSON(jsonString: string): SafeParseResult<CreateRerankResponseBody, SDKValidationError>;
//# sourceMappingURL=creatererank.d.ts.map