import { AsyncCallerParams } from "./utils/async_caller.js";
import { DataType, Dataset, DatasetShareSchema, Example, ExampleUpdate, Feedback, KVMap, LangChainBaseMessage, Run, RunCreate, RunUpdate, ScoreType, TracerSession, TracerSessionResult, ValueType } from "./schemas.js";
import { RunEvaluator } from "./evaluation/evaluator.js";
interface ClientConfig {
    apiUrl?: string;
    apiKey?: string;
    callerOptions?: AsyncCallerParams;
    timeout_ms?: number;
    webUrl?: string;
    hideInputs?: boolean;
    hideOutputs?: boolean;
    autoBatchTracing?: boolean;
    pendingAutoBatchedRunLimit?: number;
}
interface ListRunsParams {
    projectId?: string | string[];
    projectName?: string | string[];
    traceId?: string;
    executionOrder?: number;
    parentRunId?: string;
    referenceExampleId?: string;
    startTime?: Date;
    runType?: string;
    error?: boolean;
    id?: string[];
    limit?: number;
    query?: string;
    filter?: string;
}
interface UploadCSVParams {
    csvFile: Blob;
    fileName: string;
    inputKeys: string[];
    outputKeys: string[];
    description?: string;
    dataType?: DataType;
    name?: string;
}
interface CreateRunParams {
    name: string;
    inputs: KVMap;
    run_type: string;
    id?: string;
    start_time?: number;
    end_time?: number;
    extra?: KVMap;
    error?: string;
    serialized?: object;
    outputs?: KVMap;
    reference_example_id?: string;
    child_runs?: RunCreate[];
    parent_run_id?: string;
    project_name?: string;
    revision_id?: string;
    trace_id?: string;
    dotted_order?: string;
}
interface ProjectOptions {
    projectName?: string;
    projectId?: string;
}
export type FeedbackSourceType = "model" | "api" | "app";
export type CreateExampleOptions = {
    datasetId?: string;
    datasetName?: string;
    createdAt?: Date;
    exampleId?: string;
};
export declare class Queue<T> {
    items: [T, () => void][];
    get size(): number;
    push(item: T): Promise<void>;
    pop(upToN: number): [T[], () => void];
}
export declare class Client {
    private apiKey?;
    private apiUrl;
    private webUrl?;
    private caller;
    private batchIngestCaller;
    private timeout_ms;
    private _tenantId;
    private hideInputs?;
    private hideOutputs?;
    private tracingSampleRate?;
    private sampledPostUuids;
    private autoBatchTracing;
    private batchEndpointSupported?;
    private autoBatchQueue;
    private pendingAutoBatchedRunLimit;
    private autoBatchTimeout;
    private autoBatchInitialDelayMs;
    private autoBatchAggregationDelayMs;
    constructor(config?: ClientConfig);
    static getDefaultClientConfig(): {
        apiUrl: string;
        apiKey?: string;
        webUrl?: string;
        hideInputs?: boolean;
        hideOutputs?: boolean;
    };
    private getHostUrl;
    private get headers();
    private processInputs;
    private processOutputs;
    private prepareRunCreateOrUpdateInputs;
    private _getResponse;
    private _get;
    private _getPaginated;
    private _getCursorPaginatedList;
    private _filterForSampling;
    private drainAutoBatchQueue;
    private processRunOperation;
    protected batchEndpointIsSupported(): Promise<boolean>;
    createRun(run: CreateRunParams): Promise<void>;
    /**
     * Batch ingest/upsert multiple runs in the Langsmith system.
     * @param runs
     */
    batchIngestRuns({ runCreates, runUpdates, }: {
        runCreates?: RunCreate[];
        runUpdates?: RunUpdate[];
    }): Promise<void>;
    updateRun(runId: string, run: RunUpdate): Promise<void>;
    readRun(runId: string, { loadChildRuns }?: {
        loadChildRuns: boolean;
    }): Promise<Run>;
    getRunUrl({ runId, run, projectOpts, }: {
        runId?: string;
        run?: Run;
        projectOpts?: ProjectOptions;
    }): Promise<string>;
    private _loadChildRuns;
    listRuns({ projectId, projectName, parentRunId, traceId, referenceExampleId, startTime, executionOrder, runType, error, id, query, filter, limit, }: ListRunsParams): AsyncIterable<Run>;
    shareRun(runId: string, { shareId }?: {
        shareId?: string;
    }): Promise<string>;
    unshareRun(runId: string): Promise<void>;
    readRunSharedLink(runId: string): Promise<string | undefined>;
    listSharedRuns(shareToken: string, { runIds, }?: {
        runIds?: string[];
    }): Promise<Run[]>;
    readDatasetSharedSchema(datasetId?: string, datasetName?: string): Promise<DatasetShareSchema>;
    shareDataset(datasetId?: string, datasetName?: string): Promise<DatasetShareSchema>;
    unshareDataset(datasetId: string): Promise<void>;
    readSharedDataset(shareToken: string): Promise<Dataset>;
    createProject({ projectName, description, metadata, upsert, projectExtra, referenceDatasetId, }: {
        projectName: string;
        description?: string | null;
        metadata?: Record<string, any> | null;
        upsert?: boolean;
        projectExtra?: Record<string, any> | null;
        referenceDatasetId?: string | null;
    }): Promise<TracerSession>;
    updateProject(projectId: string, { name, description, metadata, projectExtra, endTime, }: {
        name?: string | null;
        description?: string | null;
        metadata?: Record<string, any> | null;
        projectExtra?: Record<string, any> | null;
        endTime?: string | null;
    }): Promise<TracerSession>;
    hasProject({ projectId, projectName, }: {
        projectId?: string;
        projectName?: string;
    }): Promise<boolean>;
    readProject({ projectId, projectName, includeStats, }: {
        projectId?: string;
        projectName?: string;
        includeStats?: boolean;
    }): Promise<TracerSessionResult>;
    private _getTenantId;
    listProjects({ projectIds, name, nameContains, referenceDatasetId, referenceDatasetName, referenceFree, }?: {
        projectIds?: string[];
        name?: string;
        nameContains?: string;
        referenceDatasetId?: string;
        referenceDatasetName?: string;
        referenceFree?: boolean;
    }): AsyncIterable<TracerSession>;
    deleteProject({ projectId, projectName, }: {
        projectId?: string;
        projectName?: string;
    }): Promise<void>;
    uploadCsv({ csvFile, fileName, inputKeys, outputKeys, description, dataType, name, }: UploadCSVParams): Promise<Dataset>;
    createDataset(name: string, { description, dataType, }?: {
        description?: string;
        dataType?: DataType;
    }): Promise<Dataset>;
    readDataset({ datasetId, datasetName, }: {
        datasetId?: string;
        datasetName?: string;
    }): Promise<Dataset>;
    readDatasetOpenaiFinetuning({ datasetId, datasetName, }: {
        datasetId?: string;
        datasetName?: string;
    }): Promise<any[]>;
    listDatasets({ limit, offset, datasetIds, datasetName, datasetNameContains, }?: {
        limit?: number;
        offset?: number;
        datasetIds?: string[];
        datasetName?: string;
        datasetNameContains?: string;
    }): AsyncIterable<Dataset>;
    deleteDataset({ datasetId, datasetName, }: {
        datasetId?: string;
        datasetName?: string;
    }): Promise<void>;
    createExample(inputs: KVMap, outputs: KVMap, { datasetId, datasetName, createdAt, exampleId }: CreateExampleOptions): Promise<Example>;
    createExamples(props: {
        inputs: Array<KVMap>;
        outputs?: Array<KVMap>;
        sourceRunIds?: Array<string>;
        exampleIds?: Array<string>;
        datasetId?: string;
        datasetName?: string;
    }): Promise<Example[]>;
    createLLMExample(input: string, generation: string | undefined, options: CreateExampleOptions): Promise<Example>;
    createChatExample(input: KVMap[] | LangChainBaseMessage[], generations: KVMap | LangChainBaseMessage | undefined, options: CreateExampleOptions): Promise<Example>;
    readExample(exampleId: string): Promise<Example>;
    listExamples({ datasetId, datasetName, exampleIds, }?: {
        datasetId?: string;
        datasetName?: string;
        exampleIds?: string[];
    }): AsyncIterable<Example>;
    deleteExample(exampleId: string): Promise<void>;
    updateExample(exampleId: string, update: ExampleUpdate): Promise<object>;
    evaluateRun(run: Run | string, evaluator: RunEvaluator, { sourceInfo, loadChildRuns, referenceExample, }?: {
        sourceInfo?: KVMap;
        loadChildRuns: boolean;
        referenceExample?: Example;
    }): Promise<Feedback>;
    createFeedback(runId: string, key: string, { score, value, correction, comment, sourceInfo, feedbackSourceType, sourceRunId, feedbackId, eager, }: {
        score?: ScoreType;
        value?: ValueType;
        correction?: object;
        comment?: string;
        sourceInfo?: object;
        feedbackSourceType?: FeedbackSourceType;
        sourceRunId?: string;
        feedbackId?: string;
        eager?: boolean;
    }): Promise<Feedback>;
    updateFeedback(feedbackId: string, { score, value, correction, comment, }: {
        score?: number | boolean | null;
        value?: number | boolean | string | object | null;
        correction?: object | null;
        comment?: string | null;
    }): Promise<void>;
    readFeedback(feedbackId: string): Promise<Feedback>;
    deleteFeedback(feedbackId: string): Promise<void>;
    listFeedback({ runIds, feedbackKeys, feedbackSourceTypes, }?: {
        runIds?: string[];
        feedbackKeys?: string[];
        feedbackSourceTypes?: FeedbackSourceType[];
    }): AsyncIterable<Feedback>;
}
export {};
