Spaces:
Build error
Build error
| 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; | |
| } | |
| interface ListRunsParams { | |
| projectId?: string; | |
| projectName?: string; | |
| executionOrder?: number; | |
| parentRunId?: string; | |
| referenceExampleId?: string; | |
| startTime?: Date; | |
| runType?: string; | |
| error?: boolean; | |
| id?: string[]; | |
| limit?: number; | |
| offset?: 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; | |
| execution_order?: number; | |
| 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; | |
| } | |
| 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 Client { | |
| private apiKey?; | |
| private apiUrl; | |
| private webUrl?; | |
| private caller; | |
| private timeout_ms; | |
| private _tenantId; | |
| constructor(config?: ClientConfig); | |
| static getDefaultClientConfig(): { | |
| apiUrl: string; | |
| apiKey?: string; | |
| webUrl?: string; | |
| }; | |
| private validateApiKeyIfHosted; | |
| private getHostUrl; | |
| private get headers(); | |
| private _getResponse; | |
| private _get; | |
| private _getPaginated; | |
| createRun(run: CreateRunParams): 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, referenceExampleId, startTime, executionOrder, runType, error, id, limit, offset, query, filter, }: 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, projectExtra, upsert, referenceDatasetId, }: { | |
| projectName: string; | |
| projectExtra?: object; | |
| upsert?: boolean; | |
| referenceDatasetId?: string; | |
| }): Promise<TracerSession>; | |
| readProject({ projectId, projectName, }: { | |
| projectId?: string; | |
| projectName?: string; | |
| }): 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>; | |
| 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, }?: { | |
| sourceInfo?: KVMap; | |
| loadChildRuns: boolean; | |
| }): 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 {}; | |