import type { CompletionRequest } from '../types/messages.js'; import type { NexusResponse } from '../types/response.js'; /** The part of a client that self-consistency needs. */ export interface ConsistencyClient { /** Runs one completion. */ complete(request: CompletionRequest): Promise; } /** Options for `completeWithSelfConsistency()`. */ export interface SelfConsistencyOptions { /** Answers sampled. Defaults to 3. */ samples?: number; /** Samples requested at once. Defaults to 2. */ maxConcurrency?: number; /** Sampling temperature for each sample. Defaults to the request's, or 0.2. */ temperature?: number; /** Top-p for each sample. Defaults to the request's, or 0.3. */ topP?: number; /** Picks the answer. Defaults to the one most similar to the others. */ judge?: (responses: NexusResponse[]) => Promise | NexusResponse; } /** * Samples several answers and returns the one they agree with most. Survives failed samples as long * as one succeeds. */ export declare function completeWithSelfConsistency(client: ConsistencyClient, request: CompletionRequest, options?: SelfConsistencyOptions): Promise; /** The response whose text is most similar to the others'. */ export declare function selectMostConsistent(responses: NexusResponse[]): NexusResponse; /** Jaccard similarity of two texts' terms, from 0 to 1. */ export declare function textSimilarity(a: string, b: string): number;