import { L as Logger, C as ConsoleLogger, N as NoOpLogger } from './index-D7rKIGrO.js'; export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, S as SpanProcessingExcludeRule, g as getLangWatchLogger, d as getLangWatchTracer } from './implementation-Cbelb5TK.js'; import { z } from 'zod'; import { p as paths, P as PromptResponse, g as CreatePromptBody, U as UpdatePromptBody, T as TagDefinition, h as CreatedTag, o as operations, i as PromptData, F as FetchPolicy, j as Prompt, a as LangWatchSpan, k as components } from './types-CmMOt86P.js'; import openApiCreateClient from 'openapi-fetch'; export { l as attributes } from './types-BvCQH8F1.js'; import '@opentelemetry/sdk-trace-base'; import '@opentelemetry/exporter-trace-otlp-http'; import '@opentelemetry/core'; import '@opentelemetry/api-logs'; import '@opentelemetry/api'; import '@opentelemetry/semantic-conventions'; import '@opentelemetry/semantic-conventions/incubating'; type PromptDependency = string | { version?: string; file?: string; }; type PromptsConfig = { prompts: Record; }; type RuntimeParameters = Record; declare const localPromptConfigSchema: z.ZodObject<{ model: z.ZodString; modelParameters: z.ZodOptional; max_tokens: z.ZodOptional; }, z.core.$loose>>; messages: z.ZodArray; content: z.ZodString; }, z.core.$loose>>; parameters: z.ZodDefault>>; }, z.core.$loose>; type LocalPromptConfig = z.infer; type MaterializedPrompt = { id: string; name: string; version: number; versionId: string; model: string; messages: Array<{ role: "system" | "user" | "assistant"; content: string; }>; prompt: string; temperature?: number; maxTokens?: number; inputs?: any; outputs?: any; parameters: RuntimeParameters; updatedAt: string; }; type PromptsLockEntry = { version: number; versionId: string; materialized: string; }; type PromptsLock = { lockfileVersion: number; prompts: Record; }; /** * Creates a new LangWatch API client. * @param apiKey - The API key or Personal Access Token used for authentication. * Defaults to `LANGWATCH_API_KEY`. * @param endpoint - The endpoint to use for the API client. Defaults to `LANGWATCH_ENDPOINT` * or the internal `DEFAULT_ENDPOINT`. * @param projectId - Project identifier. Required when `apiKey` is a PAT * (`pat-lw-*`). Defaults to `LANGWATCH_PROJECT_ID`. * @returns A new LangWatch API client. */ declare const createLangWatchApiClient: (apiKey?: string, endpoint?: string, projectId?: string | undefined) => openApiCreateClient.Client; type LangwatchApiClient = ReturnType; interface InternalConfig { langwatchApiClient: LangwatchApiClient; logger: Logger; } declare const syncActionSchema: z.ZodEnum<{ created: "created"; updated: "updated"; conflict: "conflict"; up_to_date: "up_to_date"; }>; type SyncAction = z.infer; type AssignTagResult = NonNullable; type ConfigData = NonNullable["content"]["application/json"]["configData"]; interface SyncResult { action: SyncAction; prompt?: PromptResponse; conflictInfo?: { localVersion: number; remoteVersion: number; differences: string[]; remoteConfigData: ConfigData; remoteParameters?: RuntimeParameters; }; } /** * Service for managing prompt resources via the Langwatch API. * Constructor creates a proxy that wraps the service and traces all methods. * * Responsibilities: * - CRUD operations for prompts * - Creating prompt versions * - Error handling with contextual information * * All methods return raw PromptResponse data from the API. */ declare class PromptsApiService { private readonly apiClient; constructor(config?: Pick); /** * Handles API errors by throwing a PromptsApiError with operation context. * @param operation Description of the operation being performed. * @param error The error object returned from the API client. * @throws {PromptsApiError} */ private handleApiError; /** * Fetches all prompts from the API. * @returns Array of raw PromptResponse data. * @throws {PromptsApiError} If the API call fails. */ getAll(): Promise; /** * Fetches a single prompt by its ID. * @param id The prompt's unique identifier. * @param options Optional parameters for the request. * @param options.version Specific version to fetch (numeric string or "latest"). * @param options.tag Tag to fetch (e.g., "production", "staging", or a custom tag). * @returns Raw PromptResponse data. * @throws {PromptsApiError} If the API call fails. */ get: (id: string, options?: { version?: string; tag?: string; }) => Promise; /** * Validates if a prompt exists. * @param id The prompt's unique identifier. * @returns True if prompt exists, false otherwise. * @throws {PromptsApiError} If the API call fails (not 404). */ exists(id: string): Promise; /** * Creates a new prompt. * @param params The prompt creation payload, matching the OpenAPI schema. * @returns Raw PromptResponse data of the created prompt. * @throws {PromptsApiError} If the API call fails. */ create(params: CreatePromptBody): Promise; /** * Updates an existing prompt. * @param id The prompt's unique identifier. * @param params The update payload, matching the OpenAPI schema. * @returns Raw PromptResponse data of the updated prompt. * @throws {PromptsApiError} If the API call fails. */ update(id: string, params: UpdatePromptBody): Promise; /** * Lists all prompt tags (built-in and custom) for the organization. * @returns Array of tag definitions. * @throws {PromptsApiError} If the API call fails. */ listTags(): Promise; /** * Creates a custom prompt tag for the organization. * @param params.name The tag name (must match /^[a-z][a-z0-9_-]*$/). * @returns The created tag. * @throws {PromptsApiError} If the API call fails. */ createTag({ name }: { name: string; }): Promise; /** * Deletes a custom prompt tag by name. * @param tagName The tag name to delete. * @throws {PromptsApiError} If the API call fails. */ deleteTag(tagName: string): Promise; /** * Renames an existing prompt tag. * @param tag The current tag name. * @param name The new tag name. * @throws {PromptsApiError} If the API call fails. */ renameTag({ tag, name }: { tag: string; name: string; }): Promise; assignTag({ id, tag, versionId, }: { id: string; tag: string; versionId: string; }): Promise; /** * Deletes a prompt by its ID. * @param id The prompt's unique identifier. * @throws {PromptsApiError} If the API call fails. */ delete(id: string): Promise<{ success: boolean; }>; /** * Fetches all versions for a given prompt. * @param id The prompt's unique identifier. * @returns Array of raw PromptResponse data for each version. * @throws {PromptsApiError} If the API call fails. */ getVersions(id: string): Promise; /** * Upserts a prompt with local configuration - creates if doesn't exist, updates version if exists. * @param handle The prompt's handle/identifier. * @param config Local prompt configuration. * @returns Object with created flag and raw PromptResponse data. * @throws {PromptsApiError} If the API call fails. */ upsert(handle: string, config: { model: string; modelParameters?: { temperature?: number; max_tokens?: number; }; messages: Array<{ role: "system" | "user" | "assistant"; content: string; }>; parameters?: RuntimeParameters; }): Promise<{ created: boolean; prompt: PromptResponse; }>; /** * Sync a prompt with local content, handling conflicts and version management * You probably don't need to use this method directly. */ sync(params: { name: string; configData: ConfigData; parameters?: RuntimeParameters; localVersion?: number; commitMessage?: string; }): Promise; } declare class FileManager { private static readonly PROMPTS_CONFIG_FILE; private static readonly PROMPTS_LOCK_FILE; private static readonly PROMPTS_DIR; private static readonly MATERIALIZED_DIR; private static _projectRoot; /** Reset the cached project root. Tests use this to exercise different cwds. */ static _resetProjectRootCache(): void; private static readonly PROJECT_MARKERS; private static hasProjectMarker; private static findProjectRoot; static getPromptsConfigPath(): string; static getPromptsLockPath(): string; static getPromptsDir(): string; static getMaterializedDir(): string; static ensureDirectories(): void; static loadPromptsConfig(): PromptsConfig; static savePromptsConfig(config: PromptsConfig): void; static initializePromptsConfig(): { created: boolean; path: string; }; static loadPromptsLock: () => PromptsLock; static savePromptsLock(lock: PromptsLock): void; static initializePromptsLock(): { created: boolean; path: string; }; static loadLocalPrompt: (filePath: string) => LocalPromptConfig; static saveMaterializedPrompt(name: string, prompt: MaterializedPrompt): string; static getLocalPromptFiles: () => string[]; static promptNameFromPath(filePath: string): string; static cleanupOrphanedMaterializedFiles(currentDependencies: Set): string[]; static updateLockEntry(lock: PromptsLock, name: string, prompt: MaterializedPrompt, materializedPath: string): void; static removeFromLock(lock: PromptsLock, names: string[]): void; static addToGitignore(entry: string): { added: boolean; existed: boolean; }; } interface LocalPromptsServiceConfig { fileManager?: typeof FileManager; logger?: Logger; } /** * Service for retrieving prompts from local filesystem sources. * * Searches for prompts in the following priority order: * 1. Explicit file mapping in prompts.json config * 2. Materialized path from prompts-lock.json * 3. Direct file scanning in prompts directory */ declare class LocalPromptsService { private readonly fileManager; private readonly logger; constructor(config?: LocalPromptsServiceConfig); /** * Retrieves a prompt using the configured search strategy. * Tries each source in priority order until found or all sources exhausted. */ get(handleOrId: string): Promise; /** * Searches for prompt using explicit file mapping in prompts.json. * Looks for dependencies with a 'file' property pointing to a specific path. */ private getFromConfig; /** * Searches for prompt using materialized path from lock file. * Lock file contains resolved paths for prompts that have been synced/materialized. */ private getFromLockFile; /** * Searches for prompt by scanning all .prompt.yaml files in prompts directory. * Extracts prompt name from file path and matches against the requested handle. * This is the fallback method when explicit mappings don't exist. */ private getFromLocalFiles; /** * Get dependency from config */ private getDependencyFromConfig; /** * Converts LocalPromptConfig to PromptData format */ private convertToPromptData; } /** * Options for fetching a prompt. */ interface GetPromptOptions { /** Specific version to fetch */ version?: string; /** Tag to fetch (e.g., "production", "staging", or a custom tag) */ tag?: string; /** Fetch policy to use */ fetchPolicy?: FetchPolicy; /** Cache TTL in minutes (only used with CACHE_TTL policy) */ cacheTtlMinutes?: number; } interface PromptsFacadeDependencies { promptsApiService: PromptsApiService; localPromptsService: LocalPromptsService; } /** * Facade for prompt operations in the LangWatch SDK. * Provides a simplified interface for common prompt management tasks. */ declare class PromptsFacade implements Pick { private readonly promptsApiService; private readonly localPromptsService; private readonly cache; readonly tags: { assign(id: string, params: { tag: string; versionId: string; }): Promise; list(): Promise; create(params: { name: string; }): Promise; delete(tagName: string): Promise; rename(oldName: string, newName: string): Promise; }; constructor(config: InternalConfig & PromptsFacadeDependencies); /** * Creates a new prompt. * @param data The prompt creation payload. * @returns The created Prompt instance. * @throws {PromptsError} If the API call fails. */ create(data: CreatePromptBody): Promise; /** * Retrieves a prompt by handle or ID. * * Supports shorthand `handle:tag` syntax — e.g. `get("pizza-prompt:production")`. * Shorthand is parsed server-side; the SDK passes the string through as-is. * * @param handleOrId The prompt's handle, unique identifier, or `handle:tag` shorthand. * @param options Optional parameters for the request. * @returns The Prompt instance. * @throws {PromptsError} If the prompt is not found or the API call fails. */ get(handleOrId: string, options?: GetPromptOptions): Promise; private getMaterializedFirst; private getAlwaysFetch; private getMaterializedOnly; private buildCacheKey; private getCacheTtl; /** * Retrieves all prompts. * @returns Array of Prompt instances. * @throws {PromptsError} If the API call fails. */ getAll(): Promise; /** * Updates an existing prompt. * @param handleOrId The prompt's handle or unique identifier. * @param newData The update payload. * @returns The updated Prompt instance. * @throws {PromptsError} If the API call fails. */ update(handleOrId: string, newData: UpdatePromptBody): Promise; get delete(): (id: string) => Promise<{ success: boolean; }>; /** * Delegated method to the prompts API service. */ get sync(): (params: { name: string; configData: ConfigData; parameters?: RuntimeParameters; localVersion?: number; commitMessage?: string; }) => Promise; } /** * Types for the Dataset API */ /** * A column type definition for a dataset. */ type DatasetColumnType = { /** Column name */ name: string; /** Column data type */ type: string; }; /** * Metadata for a dataset. */ type DatasetMetadata = { /** Unique dataset identifier */ id: string; /** Human-readable dataset name */ name: string; /** URL-safe slug */ slug: string; /** Column type definitions */ columnTypes: DatasetColumnType[]; /** When the dataset was created */ createdAt?: string; /** When the dataset was last updated */ updatedAt?: string; /** URL to view this dataset on the LangWatch platform */ platformUrl?: string; }; /** * A single entry in a dataset. */ type DatasetEntry = Record> = { /** Unique identifier for this entry */ id: string; /** The dataset this entry belongs to */ datasetId: string; /** The project this entry belongs to */ projectId: string; /** The actual data for this entry */ entry: T; /** When this entry was created */ createdAt: string; /** When this entry was last updated */ updatedAt: string; }; /** * A dataset containing metadata and entries. */ type Dataset = Record> = DatasetMetadata & { /** Array of dataset entries */ entries: DatasetEntry[]; }; /** * Options for getting a dataset. */ type GetDatasetOptions = { /** Skip tracing for this operation */ ignoreTracing?: boolean; }; /** * Options for listing datasets. */ type ListDatasetsOptions = { /** Page number (1-based) */ page?: number; /** Number of items per page */ limit?: number; }; /** * Pagination metadata returned by paginated API endpoints. */ type Pagination = { /** Current page number (1-based) */ page: number; /** Number of items per page */ limit: number; /** Total number of items across all pages */ total: number; /** Total number of pages */ totalPages: number; }; /** * A dataset in a list response, including record count. */ type DatasetListItem = DatasetMetadata & { /** Number of records in the dataset */ recordCount: number; }; /** * Paginated response wrapper for dataset endpoints. */ type PaginatedResponse = { data: T[]; pagination: Pagination; }; /** * API response for listing datasets. */ type ListDatasetsApiResponse = PaginatedResponse; /** * Options for creating a dataset. */ type CreateDatasetOptions = { /** Dataset name */ name: string; /** Column type definitions (defaults to empty array) */ columnTypes?: DatasetColumnType[]; }; /** * Options for updating a dataset. */ type UpdateDatasetOptions = { /** New dataset name */ name?: string; /** New column type definitions */ columnTypes?: DatasetColumnType[]; }; /** * API response for a record. */ type DatasetRecordResponse = { id: string; datasetId: string; projectId: string; entry: Record; createdAt: string; updatedAt: string; }; /** * API response for batch create records. */ type BatchCreateRecordsResponse = { data: DatasetRecordResponse[]; }; /** * API response for deleting records. */ type DeleteRecordsResponse = { deletedCount: number; }; /** * API response for uploading a file. * Covers both upload-to-existing (records) and create-from-file (recordsCreated, datasetId) responses. */ type UploadResponse = { dataset?: DatasetMetadata; records?: DatasetRecordResponse[]; recordsCreated?: number; datasetId?: string; }; /** * Options for listing records in a dataset. */ type ListRecordsOptions = { /** Page number (1-based) */ page?: number; /** Number of items per page */ limit?: number; }; /** * API response for listing records in a dataset. */ type ListRecordsApiResponse = PaginatedResponse; /** * API response for creating a dataset from a file upload. */ type CreateFromUploadResponse = DatasetMetadata & { /** Number of records created from the uploaded file */ recordsCreated: number; }; type DatasetsFacadeConfig = { langwatchApiClient: LangwatchApiClient; logger: Logger; endpoint: string; apiKey: string; }; /** * Facade for dataset operations in the LangWatch SDK. * Provides a simplified interface for managing datasets, records, and file uploads. * * @example * ```typescript * const langwatch = new LangWatch({ apiKey: "your-api-key" }); * * // List all datasets * const datasets = await langwatch.datasets.list(); * * // Get a dataset by slug or ID * const dataset = await langwatch.datasets.get("my-dataset"); * * // Create a new dataset * const newDataset = await langwatch.datasets.create({ * name: "my-dataset", * columnTypes: [{ name: "input", type: "string" }], * }); * * // Update a dataset * const updated = await langwatch.datasets.update("my-dataset", { name: "new-name" }); * * // Delete a dataset * const archived = await langwatch.datasets.delete("my-dataset"); * * // Create records * const records = await langwatch.datasets.createRecords("my-dataset", [ * { input: "hello", output: "world" }, * ]); * * // Update a record * const record = await langwatch.datasets.updateRecord("my-dataset", "rec-1", { input: "updated" }); * * // Delete records * const result = await langwatch.datasets.deleteRecords("my-dataset", ["rec-1", "rec-2"]); * * // Upload a file (append to existing or create new) * const uploadResult = await langwatch.datasets.upload("my-dataset", file); * * // Upload with replace strategy (delete all records first) * await langwatch.datasets.upload("my-dataset", file, { ifExists: "replace" }); * ``` */ declare class DatasetsFacade { #private; constructor(config: DatasetsFacadeConfig); /** * Lists all datasets for the project, with optional pagination. * * @param options - Pagination options (page, limit) * @returns Paginated list of datasets with metadata */ list: (options?: ListDatasetsOptions) => Promise; /** * Creates a new dataset. * * @param options - Dataset creation options (name, columnTypes) * @returns The created dataset metadata */ create: (options: CreateDatasetOptions) => Promise; /** * Fetches a dataset by its slug or ID, returning metadata and entries. * * @param slugOrId - The slug or ID of the dataset to fetch * @param options - Optional configuration * @returns The dataset with metadata and entries * * @example * ```typescript * // Get dataset by slug * const dataset = await langwatch.datasets.get("product-qa"); * * // Typed dataset * type MyDatasetEntry = { input: string; expected_output: string; }; * const dataset = await langwatch.datasets.get("my-dataset"); * * // Iterate over entries * for (const entry of dataset.entries) { * console.log(entry.entry.input); * } * ``` */ get: = Record>(slugOrId: string, options?: GetDatasetOptions) => Promise>; /** * Updates a dataset by its slug or ID. * * @param slugOrId - The slug or ID of the dataset to update * @param options - Fields to update (name, columnTypes) * @returns The updated dataset metadata */ update: (slugOrId: string, options: UpdateDatasetOptions) => Promise; /** * Deletes (archives) a dataset by its slug or ID. * * @param slugOrId - The slug or ID of the dataset to delete * @returns The archived dataset metadata */ delete: (slugOrId: string) => Promise; /** * Creates records in a dataset in batch. * * @param slugOrId - The slug or ID of the dataset * @param entries - Array of record entries to create * @returns The created records with IDs */ createRecords: (slugOrId: string, entries: Record[]) => Promise; /** * Updates a single record in a dataset. * * @param slugOrId - The slug or ID of the dataset * @param recordId - The ID of the record to update * @param entry - The updated entry data * @returns The updated record */ updateRecord: (slugOrId: string, recordId: string, entry: Record) => Promise; /** * Deletes records from a dataset by IDs. * * @param slugOrId - The slug or ID of the dataset * @param recordIds - Array of record IDs to delete * @returns Object with the count of deleted records */ deleteRecords: (slugOrId: string, recordIds: string[]) => Promise; /** * Lists records in a dataset with optional pagination. * * @param slugOrId - The slug or ID of the dataset * @param options - Pagination options (page, limit) * @returns Paginated list of records * * @example * ```typescript * // List first page of records * const result = await langwatch.datasets.listRecords("my-dataset"); * * // With pagination * const page2 = await langwatch.datasets.listRecords("my-dataset", { page: 2, limit: 25 }); * ``` */ listRecords: (slugOrId: string, options?: ListRecordsOptions) => Promise; /** * Uploads a file to a dataset with a configurable strategy for handling existing datasets. * * Strategies: * - `"append"` (default): Upload to existing dataset; if not found, create a new one. * - `"replace"`: Delete all existing records, then upload; if not found, create a new one. * - `"error"`: Throw a 409 error if the dataset already exists; if not found, create a new one. * * @param slugOrId - The slug or ID of the dataset * @param file - The file to upload (File or Blob) * @param options - Upload options including the ifExists strategy * @returns The upload result * * @example * ```typescript * const file = new File(["input,output\nhello,world"], "data.csv", { type: "text/csv" }); * * // Append to existing or create new * await langwatch.datasets.upload("my-dataset", file); * * // Replace all records * await langwatch.datasets.upload("my-dataset", file, { ifExists: "replace" }); * * // Fail if dataset already exists * await langwatch.datasets.upload("my-dataset", file, { ifExists: "error" }); * ``` */ upload: (slugOrId: string, file: File | Blob, options?: { ifExists?: "append" | "replace" | "error"; }) => Promise; } /** * Errors for the Dataset API */ /** * Base error for all dataset operations. */ declare class DatasetError extends Error { constructor(message: string); } /** * Thrown when a dataset is not found (404). */ declare class DatasetNotFoundError extends DatasetError { constructor(slugOrId: string); } /** * Error from the Dataset API with operation context. * Aligns with PromptsApiError pattern: includes operation and originalError fields. */ declare class DatasetApiError extends DatasetError { readonly status: number; readonly operation: string; readonly originalError?: unknown; constructor(message: string, status: number, operation: string, originalError?: unknown); } /** * Thrown for client-side validation failures (e.g. empty name, no update fields, empty entries). * Distinguished from DatasetApiError which represents server-side errors. */ declare class DatasetValidationError extends DatasetError { constructor(message: string); } /** * Thrown when a dataset operation exceeds the plan limit (403). * The message includes the upgrade/subscription URL from the server. */ declare class DatasetPlanLimitError extends DatasetError { readonly limitType: string; readonly current?: number; readonly max?: number; constructor(message: string, originalError?: unknown); } /** * Types for the Experiments API * * These types define the structure for batch experiments, including * logging metrics, running evaluators, and managing targets. */ /** * Status of an evaluation result */ type EvaluationStatus$1 = "processed" | "error" | "skipped"; /** * Target types for batch evaluations */ type TargetType = "prompt" | "agent" | "custom"; /** * Metadata for targets - used for comparison charts */ type TargetMetadata = Record; declare const targetInfoSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; type: z.ZodDefault>; metadata: z.ZodOptional>>>; }, z.core.$strip>; declare const evaluationResultSchema: z.ZodObject<{ name: z.ZodString; evaluator: z.ZodString; trace_id: z.ZodString; status: z.ZodEnum<{ error: "error"; processed: "processed"; skipped: "skipped"; }>; data: z.ZodOptional>>; score: z.ZodOptional>; passed: z.ZodOptional>; details: z.ZodOptional>; index: z.ZodOptional>; label: z.ZodOptional>; cost: z.ZodOptional>; duration: z.ZodOptional>; error_type: z.ZodOptional>; traceback: z.ZodOptional>>; target_id: z.ZodOptional>; }, z.core.$strip>; /** * Information about a registered target */ type TargetInfo = z.infer; /** * Result of an evaluation */ type EvaluationResult$1 = z.infer; /** * Options for initializing an experiment */ type ExperimentInitOptions = { /** Custom run ID (auto-generated if not provided) */ runId?: string; /** Number of parallel threads for submit() */ threads?: number; }; /** * Options for the log() method */ type LogOptions = { /** * Row index in the dataset. * Optional when called inside withTarget() - will be auto-inferred from context. */ index?: number; /** Additional data/inputs for the evaluation */ data?: Record; /** Numeric score (typically 0-1) */ score?: number; /** Whether the evaluation passed */ passed?: boolean; /** Label/category for the result */ label?: string; /** Human-readable description of the result */ details?: string; /** Status of the evaluation */ status?: EvaluationStatus$1; /** Duration in milliseconds */ duration?: number; /** Cost amount in USD */ cost?: number; /** Error if one occurred */ error?: Error; /** * Target name for multi-target comparisons. * Optional when called inside withTarget() - will be auto-inferred from context. */ target?: string; /** Metadata for the target (only used on first call per target) */ metadata?: TargetMetadata; }; /** * Options for the evaluate() method (built-in evaluators) */ type EvaluateOptions$1 = { /** * Row index in the dataset. * Optional when called inside withTarget() - will be auto-inferred from context. */ index?: number; /** Data to pass to the evaluator */ data: Record; /** Evaluator settings */ settings?: Record; /** Human-readable name for the evaluation */ name?: string; /** Whether to run as a guardrail */ asGuardrail?: boolean; /** * Target name for multi-target comparisons. * Optional when called inside withTarget() - will be auto-inferred from context. */ target?: string; /** Metadata for the target */ metadata?: TargetMetadata; }; /** * Context passed to the run() callback */ type RunContext = { /** Current index in the dataset */ index: number; /** The dataset item */ item: T; /** The span for this iteration (for custom instrumentation) */ span: LangWatchSpan; }; /** * Options for the run() method */ type RunOptions = { /** Number of concurrent executions (default: 4) */ concurrency?: number; }; /** * Callback function for run() */ type RunCallback = (context: RunContext) => Promise | void; /** * Context passed to the withTarget() callback */ type TargetContext = { /** The LangWatch span for this target execution */ span: LangWatchSpan; /** The trace ID for this target execution */ traceId: string; /** The span ID for this target execution */ spanId: string; }; /** * Callback function for withTarget() */ type TargetCallback = (context: TargetContext) => Promise | R; /** * Result from withTarget() including captured metrics */ type TargetResult = { /** The return value from the callback */ result: R; /** Duration in milliseconds (automatically captured) */ duration: number; /** Cost in USD (captured from span if available) */ cost?: number; /** The trace ID for this execution */ traceId: string; /** The span ID for this execution */ spanId: string; }; /** * Experiment - Main class for running batch experiments * * Provides a clean API for running experiments over datasets with: * - Automatic tracing per iteration * - Parallel execution with concurrency control * - Batched result sending * - Built-in evaluator support * - Multi-target comparison with withTarget() context isolation */ /** * Experiment session for running batch experiments */ declare class Experiment { readonly name: string; readonly runId: string; readonly experimentSlug: string; private readonly apiClient; private readonly endpoint; private readonly apiKey; private readonly logger; private readonly concurrency; private initialized; private createdAtMs; private total; private progress; private batch; private lastSentMs; private pendingFlush; private flushTimeout; private cumulativeEvaluations; private cumulativeEntries; private runUrl; private targets; private currentTraceId; private currentIndex; private iterationUsedWithTarget; private evaluationUsesTargets; private constructor(); /** * Initialize an evaluation session */ static init(name: string, options: { apiClient: LangwatchApiClient; endpoint: string; apiKey: string; logger: Logger; } & ExperimentInitOptions): Promise; /** * Initialize the evaluation by creating/getting the experiment */ private initialize; /** * Run evaluation over a dataset with a callback * * @param dataset - Array of items to evaluate * @param callback - Function called for each item with { item, index, span } * @param options - Concurrency options * * @example * ```typescript * await evaluation.run(dataset, async ({ item, index, span }) => { * const response = await myAgent(item.question); * evaluation.log('accuracy', { index, score: 0.95 }); * }, { concurrency: 4 }); * ``` */ run(dataset: T[], callback: RunCallback, options?: RunOptions): Promise; /** * Execute a single item in the dataset */ private executeItem; /** * Log a custom metric result * * @param metric - Name of the metric * @param options - Metric options including index, score, passed, etc. * * If called inside a withTarget() block, the target and index are automatically * inferred from the context and don't need to be specified. * * @example * ```typescript * // Explicit target (outside withTarget) * evaluation.log('accuracy', { index, score: 0.95, target: 'gpt-4' }); * * // Implicit target (inside withTarget) * await evaluation.withTarget('gpt-4', { model: 'openai/gpt-4' }, async () => { * evaluation.log('accuracy', { score: 0.95 }); // target and index auto-inferred * }); * ``` */ log(metric: string, options: LogOptions): void; /** * Run a built-in evaluator * * @param evaluatorSlug - The evaluator identifier (e.g., 'ragas/faithfulness') * @param options - Evaluator options including data and settings * * If called inside a withTarget() block, the target and index are automatically * inferred from the context and don't need to be specified. * * @example * ```typescript * // Inside withTarget() - target and index auto-inferred * await evaluation.withTarget('gpt-4', { model: 'openai/gpt-4' }, async () => { * await evaluation.evaluate('ragas/faithfulness', { * data: { input, output, contexts }, * }); * }); * * // Or explicit index/target * await evaluation.evaluate('ragas/faithfulness', { * index, * data: { input, output, contexts }, * target: 'gpt-4', * }); * ``` */ evaluate(evaluatorSlug: string, options: EvaluateOptions$1): Promise; /** * Execute code within a target context with automatic tracing * * Creates a new span for this target execution and sets up context * so that log() calls inside the callback automatically use this target. * Duration and output are captured automatically. * * This creates a dataset entry per target (like Evaluations V3), enabling * proper per-target latency and cost tracking. * * @param targetName - Unique identifier for the target * @param metadata - Optional metadata for comparison (e.g., { model: 'gpt-4' }) * @param callback - Function to execute within the target context * @returns The callback result along with captured metrics * * @example * ```typescript * await evaluation.run(dataset, async ({ item, index }) => { * // Compare GPT-4 and Claude on the same input * const [gpt4Result, claudeResult] = await Promise.all([ * evaluation.withTarget('gpt-4', { model: 'openai/gpt-4' }, async () => { * const response = await openai.chat(item.question); * evaluation.log('quality', { score: 0.95 }); // target auto-inferred * return response; * }), * evaluation.withTarget('claude-3', { model: 'anthropic/claude-3' }, async () => { * const response = await anthropic.messages(item.question); * evaluation.log('quality', { score: 0.85 }); // target auto-inferred * return response; * }), * ]); * }); * ``` */ withTarget(targetName: string, metadata: TargetMetadata | null, callback: TargetCallback): Promise>; withTarget(targetName: string, callback: TargetCallback): Promise>; /** * Register a target for multi-target comparison */ private registerTarget; /** * Schedule a debounced send */ private scheduleSend; /** * Print a CI-friendly summary and optionally exit with code 1 on failure. * * Mirrors `ExperimentRunResult.printSummary` for parity — SDK-driven experiments * can now fail CI builds the same way platform experiments do. * * @param exitOnFailure - If true (default), calls `process.exit(1)` when any evaluation failed. * * @example * ```typescript * const experiment = await langwatch.experiments.init("ci-quality-check"); * await experiment.run(dataset, async ({ item, index }) => { * const response = await myLLM(item.input); * await experiment.evaluate("ragas/faithfulness", { index, data: { input: item.input, output: response } }); * }); * experiment.printSummary(); * ``` */ printSummary(exitOnFailure?: boolean): void; /** * Send current batch to the API */ private sendBatch; /** * Flush all pending data */ private flush; /** * Serialize a dataset item for the API */ private serializeItem; /** * Get trace ID from current OpenTelemetry context */ private getTraceIdFromContext; /** * Get span ID from current OpenTelemetry context */ private getSpanIdFromContext; } /** * Types for platform-configured experiments (Experiments Workbench) */ /** * Summary of a completed experiment run */ type ExperimentRunSummary = { runId?: string; totalCells?: number; completedCells?: number; failedCells?: number; duration?: number; runUrl?: string; timestamps?: { startedAt: number; finishedAt?: number; stoppedAt?: number; }; targets?: Array<{ targetId: string; name: string; passed: number; failed: number; avgLatency: number; totalCost: number; }>; evaluators?: Array<{ evaluatorId: string; name: string; passed: number; failed: number; passRate: number; avgScore?: number; }>; totalPassed?: number; totalFailed?: number; passRate?: number; totalCost?: number; }; /** * Options for running a platform experiment */ type RunExperimentOptions = { /** * Polling interval in milliseconds (default: 2000) */ pollInterval?: number; /** * Maximum time to wait for completion in milliseconds (default: 600000 = 10 minutes) */ timeout?: number; /** * Callback for progress updates */ onProgress?: (progress: number, total: number) => void; }; /** * Final result of a platform experiment run */ type ExperimentRunResult = { runId: string; status: "completed" | "failed" | "stopped"; passed: number; failed: number; passRate: number; duration: number; runUrl: string; summary: ExperimentRunSummary; /** * Print a CI-friendly summary of the results * @param exitOnFailure - If true (default), calls process.exit(1) when there are failures */ printSummary: (exitOnFailure?: boolean) => void; /** * Human-readable string representation */ toString: () => string; }; /** * ExperimentsFacade - Entry point for the experiments API * * Provides: * - `init()` method to create experiment sessions (SDK-defined experiments) * - `run()` method to execute platform-configured experiments (Experiments Workbench) */ type ExperimentsFacadeConfig = { langwatchApiClient: LangwatchApiClient; endpoint: string; apiKey: string; logger: Logger; }; /** * Facade for creating experiment sessions and running platform-configured experiments */ declare class ExperimentsFacade { private readonly config; constructor(config: ExperimentsFacadeConfig); /** * Initialize a new experiment session (SDK-defined) * * @param name - Name of the experiment (used as slug) * @param options - Optional configuration * @returns An initialized Experiment instance * * @example * ```typescript * const experiment = await langwatch.experiments.init('my-experiment'); * * await experiment.run(dataset, async ({ item, index }) => { * const response = await myAgent(item.question); * experiment.log('accuracy', { index, score: 0.95 }); * }); * ``` */ init(name: string, options?: ExperimentInitOptions): Promise; /** * Run a platform-configured experiment (Experiments Workbench) * * This runs an experiment that was configured in the LangWatch platform. * The method automatically prints a summary and exits with code 1 on failure * (unless `exitOnFailure: false` is passed). * * @param slug - The slug of the experiment (found in the experiment URL) * @param options - Optional configuration * @returns The experiment results including pass rate and summary * * @example * ```typescript * import { LangWatch } from "langwatch"; * * const langwatch = new LangWatch(); * * const result = await langwatch.experiments.run("my-experiment-slug"); * result.printSummary(); * ``` */ run(slug: string, options?: RunExperimentOptions): Promise; /** * Run an experiment and wait for completion using polling */ private runWithPolling; /** * Start an experiment run */ private startRun; /** * Get the status of a run */ private getRunStatus; /** * Build the result object from API response */ private buildResult; private sleep; /** * Replace the domain of a URL with a new base URL, preserving the path */ private replaceUrlDomain; } /** * Errors for the Experiments API */ /** * Base error for experiment-related issues */ declare class ExperimentError extends Error { constructor(message: string); } /** * Thrown when initialization fails */ declare class ExperimentInitError extends ExperimentError { readonly cause?: Error | undefined; constructor(message: string, cause?: Error | undefined); } /** * Thrown when API calls fail */ declare class ExperimentApiError extends ExperimentError { readonly statusCode?: number | undefined; readonly cause?: Error | undefined; constructor(message: string, statusCode?: number | undefined, cause?: Error | undefined); } /** * Thrown when target metadata conflicts */ declare class TargetMetadataConflictError extends ExperimentError { readonly targetName: string; readonly existingMetadata: Record; readonly newMetadata: Record; constructor(targetName: string, existingMetadata: Record, newMetadata: Record); } /** * Thrown when an evaluator call fails */ declare class EvaluatorError extends ExperimentError { readonly evaluatorSlug: string; readonly cause?: Error | undefined; constructor(evaluatorSlug: string, message: string, cause?: Error | undefined); } /** * Types for the Evaluations API (Online Evaluations / Guardrails) * * These types define the structure for running evaluators and guardrails * in real-time against LLM inputs/outputs. */ /** * Status of an evaluation result */ type EvaluationStatus = "processed" | "skipped" | "error"; /** * Cost information from an evaluation */ type EvaluationCost = { currency: string; amount: number; }; /** * Result returned from running an evaluator */ type EvaluationResult = { /** Status of the evaluation */ status: EvaluationStatus; /** Whether the evaluation passed (for guardrails) */ passed?: boolean; /** Numeric score (typically 0-1) */ score?: number; /** Human-readable details about the result */ details?: string; /** Label/category for the result */ label?: string; /** Cost of running the evaluation */ cost?: EvaluationCost; }; /** * Options for the evaluate() method */ type EvaluateOptions = { /** Data to pass to the evaluator (input, output, contexts, etc.) */ data: Record; /** Human-readable name for this evaluation */ name?: string; /** Evaluator-specific settings */ settings?: Record; /** Whether to run as a guardrail (affects error handling) */ asGuardrail?: boolean; }; /** * EvaluationsFacade - Entry point for the Evaluations API (Online Evaluations / Guardrails) * * Provides an API for running evaluators and guardrails in real-time against LLM inputs/outputs. * * @example * ```typescript * const langwatch = new LangWatch({ apiKey: "your-api-key" }); * * // Run a guardrail * const guardrail = await langwatch.evaluations.evaluate("presidio/pii_detection", { * data: { input: userInput, output: generatedResponse }, * name: "PII Detection", * asGuardrail: true, * settings: {}, * }); * * if (!guardrail.passed) { * return "I'm sorry, I can't do that."; * } * ``` */ type EvaluationsFacadeConfig = { endpoint: string; apiKey: string; logger: Logger; }; declare class EvaluationsFacade { #private; constructor(config: EvaluationsFacadeConfig); /** * Run an evaluator or guardrail against provided data * * Creates an OpenTelemetry span attached to the current trace context, * calls the LangWatch evaluation API, and returns the result. * * @param slug - The evaluator slug (e.g., "presidio/pii_detection", "langevals/llm_boolean") * @param options - Evaluation options including data, name, settings, and asGuardrail flag * @returns The evaluation result with status, passed, score, details, label, and cost * * @example * ```typescript * // Run as a guardrail (synchronous evaluation that can block responses) * const guardrail = await langwatch.evaluations.evaluate("presidio/pii_detection", { * data: { input: userInput, output: generatedResponse }, * name: "PII Detection Guardrail", * asGuardrail: true, * }); * * if (!guardrail.passed) { * console.log("PII detected:", guardrail.details); * return "Sorry, I cannot process that request."; * } * ``` * * @example * ```typescript * // Run as an online evaluation (async scoring for monitoring) * const result = await langwatch.evaluations.evaluate("langevals/llm_boolean", { * data: { input: question, output: response }, * name: "Quality Check", * settings: { prompt: "Check if the response answers the question." }, * }); * * console.log("Score:", result.score); * console.log("Details:", result.details); * ``` */ evaluate: (slug: string, options: EvaluateOptions) => Promise; } /** * Error classes for the Evaluations API */ /** * Base error for evaluation operations */ declare class EvaluationError extends Error { constructor(message: string); } /** * Error when an evaluator call fails */ declare class EvaluatorCallError extends EvaluationError { readonly evaluatorSlug: string; readonly statusCode?: number; constructor(evaluatorSlug: string, message: string, statusCode?: number); } /** * Error when evaluator is not found */ declare class EvaluatorNotFoundError extends EvaluationError { readonly evaluatorSlug: string; constructor(evaluatorSlug: string); } /** * Error from the evaluations API */ declare class EvaluationsApiError extends EvaluationError { readonly statusCode: number; constructor(message: string, statusCode: number); } type EvaluatorResponse = NonNullable[number] & { /** URL to view this evaluator on the LangWatch platform */ platformUrl?: string; }; type EvaluatorField = EvaluatorResponse["fields"][number]; type CreateEvaluatorBody = NonNullable["content"]["application/json"]; type UpdateEvaluatorBody = NonNullable["content"]["application/json"]; type DeleteEvaluatorResponse = paths["/api/evaluators/{id}"]["delete"]["responses"]["200"]["content"]["application/json"]; /** * Service for retrieving evaluator resources via the LangWatch API. * * Provides read-only access to project evaluators with computed fields. */ declare class EvaluatorsApiService { private readonly apiClient; constructor(config?: Pick); private handleApiError; /** * Fetches all evaluators for the project. */ getAll(): Promise; /** * Fetches a single evaluator by its ID or slug. */ get(idOrSlug: string): Promise; /** * Creates a new evaluator. */ create(params: CreateEvaluatorBody): Promise; /** * Updates an evaluator by its ID. */ update(id: string, params: UpdateEvaluatorBody): Promise; /** * Deletes (archives) an evaluator by its ID. */ delete(id: string): Promise; } declare class EvaluatorsApiError extends Error { readonly operation: string; readonly originalError?: unknown | undefined; constructor(message: string, operation: string, originalError?: unknown | undefined); } type ScenarioResponse = NonNullable[number] & { /** URL to view this scenario on the LangWatch platform */ platformUrl?: string; }; type CreateScenarioBody = NonNullable["content"]["application/json"]; type UpdateScenarioBody = NonNullable["content"]["application/json"]; type DeleteScenarioResponse = paths["/api/scenarios/{id}"]["delete"]["responses"]["200"]["content"]["application/json"]; declare class ScenariosApiService { private readonly apiClient; constructor(config?: Pick); private handleApiError; getAll(): Promise; get(id: string): Promise; create(params: CreateScenarioBody): Promise; update(id: string, params: UpdateScenarioBody): Promise; delete(id: string): Promise; } type SuiteResponse = NonNullable[number] & { /** URL to view this suite on the LangWatch platform */ platformUrl?: string; }; type CreateSuiteBody = NonNullable["content"]["application/json"]; type UpdateSuiteBody = NonNullable["content"]["application/json"]; type SuiteRunResult = paths["/api/suites/{id}/run"]["post"]["responses"]["200"]["content"]["application/json"]; declare class SuitesApiService { private readonly apiClient; constructor(config?: Pick); private handleApiError; getAll(): Promise; get(id: string): Promise; create(params: CreateSuiteBody): Promise; update(id: string, params: UpdateSuiteBody): Promise; duplicate(id: string): Promise; run(id: string, idempotencyKey?: string): Promise; delete(id: string): Promise<{ id: string; archived: boolean; }>; } type WorkflowResponse = NonNullable[number]; type WorkflowDeleteResponse = paths["/api/workflows/{id}"]["delete"]["responses"]["200"]["content"]["application/json"]; declare class WorkflowsApiService { private readonly apiClient; constructor(config?: Pick); private handleApiError; getAll(): Promise; get(id: string): Promise; delete(id: string): Promise; } interface AgentResponse { id: string; name: string; type: string; config: Record | null; createdAt: string; updatedAt: string; platformUrl?: string; } interface AgentListResponse { data: AgentResponse[]; pagination: { page: number; limit: number; total: number; totalPages: number; }; } declare class AgentsApiService { private readonly apiClient; constructor(config?: Pick); private handleApiError; list(params?: { page?: number; limit?: number; }): Promise; get(id: string): Promise; create(params: { name: string; type: string; config: Record; workflowId?: string; }): Promise; update(id: string, params: { name?: string; type?: string; config?: Record; }): Promise; delete(id: string): Promise<{ id: string; name: string; }>; } type AnnotationResponse = components["schemas"]["Annotation"]; type CreateAnnotationBody = NonNullable["content"]["application/json"]; declare class AnnotationsApiService { private readonly apiClient; constructor(config?: Pick); private handleApiError; getAll(): Promise; get(id: string): Promise; getByTrace(traceId: string): Promise; create(traceId: string, params: CreateAnnotationBody): Promise; delete(id: string): Promise<{ status?: string; message?: string; }>; } interface DashboardSummary { id: string; name: string; order: number; graphCount: number; createdAt: string; updatedAt: string; platformUrl?: string; } interface DashboardDetail { id: string; name: string; order: number; graphs: unknown[]; createdAt: string; updatedAt: string; platformUrl?: string; } declare class DashboardsApiService { private readonly apiClient; constructor(config?: Pick); private handleApiError; list(): Promise<{ data: DashboardSummary[]; }>; get(id: string): Promise; create(params: { name: string; }): Promise; rename(id: string, params: { name: string; }): Promise; delete(id: string): Promise<{ id: string; name: string; }>; } type ModelProvidersListResponse = paths["/api/model-providers"]["get"]["responses"]["200"]["content"]["application/json"]; type UpdateModelProviderBody = NonNullable["content"]["application/json"]; declare class ModelProvidersApiService { private readonly apiClient; constructor(config?: Pick); private handleApiError; list(): Promise; set(provider: string, params: UpdateModelProviderBody): Promise; } type AnalyticsTimeseriesBody = NonNullable["content"]["application/json"]; type AnalyticsTimeseriesResponse = paths["/api/analytics/timeseries"]["post"]["responses"]["200"]["content"]["application/json"]; declare class AnalyticsApiService { private readonly apiClient; constructor(config?: Pick); private handleApiError; timeseries(params: AnalyticsTimeseriesBody): Promise; } type TriggerResponse = NonNullable[number]; type CreateTriggerBody = NonNullable["content"]["application/json"]; type UpdateTriggerBody = NonNullable["content"]["application/json"]; type TriggerDeleteResponse = paths["/api/triggers/{id}"]["delete"]["responses"]["200"]["content"]["application/json"]; declare class TriggersApiService { private readonly apiClient; constructor(config?: Pick); private handleApiError; getAll(): Promise; get(id: string): Promise; create(params: CreateTriggerBody): Promise; update(id: string, params: UpdateTriggerBody): Promise; delete(id: string): Promise; } type GraphResponse = NonNullable[number]; type CreateGraphBody = NonNullable["content"]["application/json"]; type UpdateGraphBody = NonNullable["content"]["application/json"]; type GraphDeleteResponse = paths["/api/graphs/{id}"]["delete"]["responses"]["200"]["content"]["application/json"]; declare class GraphsApiService { private readonly apiClient; constructor(config?: Pick); private handleApiError; getAll(dashboardId?: string): Promise; get(id: string): Promise; create(params: CreateGraphBody): Promise; update(id: string, params: UpdateGraphBody): Promise; delete(id: string): Promise; } type SimulationRunsListResponse = paths["/api/simulation-runs"]["get"]["responses"]["200"]["content"]["application/json"]; type SimulationRunResponse = paths["/api/simulation-runs/{scenarioRunId}"]["get"]["responses"]["200"]["content"]["application/json"]; type SimulationRunsBatchesListResponse = paths["/api/simulation-runs/batches/list"]["get"]["responses"]["200"]["content"]["application/json"]; type SimulationRunsListParams = NonNullable; type SimulationRunsBatchesListParams = paths["/api/simulation-runs/batches/list"]["get"]["parameters"]["query"]; declare class SimulationRunsApiService { private readonly apiClient; constructor(config?: Pick); private handleApiError; getAll(params?: SimulationRunsListParams): Promise; get(scenarioRunId: string): Promise; listBatches(params: SimulationRunsBatchesListParams): Promise; } interface MonitorResponse { id: string; name: string; slug: string; checkType: string; enabled: boolean; executionMode: string; sample: number; level: string; evaluatorId: string | null; preconditions: unknown[]; parameters: Record; mappings: Record; threadIdleTimeout: number | null; createdAt: string; updatedAt: string; } interface CreateMonitorBody { name: string; checkType: string; executionMode?: string; sample?: number; level?: string; preconditions?: unknown[]; parameters?: Record; mappings?: Record; } interface UpdateMonitorBody { name?: string; enabled?: boolean; executionMode?: string; sample?: number; preconditions?: unknown[]; parameters?: Record; mappings?: Record; } interface MonitorDeleteResponse { id: string; deleted: boolean; } declare class MonitorsApiService { private readonly apiKey; private readonly endpoint; constructor(config?: { apiKey?: string; endpoint?: string; }); private request; getAll(): Promise; get(id: string): Promise; create(body: CreateMonitorBody): Promise; update(id: string, body: UpdateMonitorBody): Promise; toggle(id: string, enabled: boolean): Promise; delete(id: string): Promise; } interface SecretResponse { id: string; projectId: string; name: string; createdAt: string; updatedAt: string; } interface SecretDeleteResponse { id: string; deleted: boolean; } declare class SecretsApiService { private readonly apiKey; private readonly endpoint; constructor(config?: { apiKey?: string; endpoint?: string; }); private request; getAll(): Promise; get(id: string): Promise; create(body: { name: string; value: string; }): Promise; update(id: string, body: { value: string; }): Promise; delete(id: string): Promise; } interface GetTraceParams { includeSpans?: boolean; } type GetTraceResponse = NonNullable; declare class TracesFacade { #private; constructor(config: InternalConfig); get(traceId: string, params?: GetTraceParams): Promise; } interface LangWatchConstructorOptions { apiKey?: string; endpoint?: string; options?: { logger?: Logger; }; } declare class LangWatch { #private; private readonly config; readonly prompts: PromptsFacade; readonly traces: TracesFacade; readonly datasets: DatasetsFacade; /** * Run experiments on LangWatch platform or via SDK. * * Platform experiments (CI/CD): * ```typescript * const result = await langwatch.experiments.run("my-experiment-slug"); * result.printSummary(); * ``` * * SDK-defined experiments: * ```typescript * const experiment = await langwatch.experiments.init("my-experiment"); * // ... run evaluators using experiment.evaluate() * ``` */ readonly experiments: ExperimentsFacade; /** * Run evaluators and guardrails in real-time (Online Evaluations). * * @example * ```typescript * const guardrail = await langwatch.evaluations.evaluate("presidio/pii_detection", { * data: { input: userInput, output: generatedResponse }, * name: "PII Detection", * asGuardrail: true, * }); * * if (!guardrail.passed) { * return "I'm sorry, I can't do that."; * } * ``` */ readonly evaluations: EvaluationsFacade; readonly evaluators: EvaluatorsApiService; readonly scenarios: ScenariosApiService; readonly suites: SuitesApiService; readonly workflows: WorkflowsApiService; readonly agents: AgentsApiService; readonly annotations: AnnotationsApiService; readonly dashboards: DashboardsApiService; readonly modelProviders: ModelProvidersApiService; readonly analytics: AnalyticsApiService; readonly triggers: TriggersApiService; readonly graphs: GraphsApiService; readonly simulationRuns: SimulationRunsApiService; readonly monitors: MonitorsApiService; readonly secrets: SecretsApiService; constructor(options?: LangWatchConstructorOptions); get apiClient(): LangwatchApiClient; } declare const logger: { ConsoleLogger: typeof ConsoleLogger; NoOpLogger: typeof NoOpLogger; }; export { type BatchCreateRecordsResponse, type CreateDatasetOptions, type CreateEvaluatorBody, type CreateFromUploadResponse, type Dataset, DatasetApiError, type DatasetColumnType, type DatasetEntry, DatasetError, type DatasetListItem, type DatasetMetadata, DatasetNotFoundError, DatasetPlanLimitError, type DatasetRecordResponse, DatasetValidationError, DatasetsFacade, type DeleteRecordsResponse, type EvaluateOptions, type EvaluationCost, EvaluationError, type EvaluationResult, type EvaluationStatus, EvaluationsApiError, EvaluationsFacade, EvaluatorCallError, EvaluatorError, type EvaluatorField, EvaluatorNotFoundError, type EvaluatorResponse, EvaluatorsApiError, EvaluatorsApiService, Experiment, ExperimentApiError, ExperimentError, type EvaluateOptions$1 as ExperimentEvaluateOptions, type EvaluationResult$1 as ExperimentEvaluationResult, type EvaluationStatus$1 as ExperimentEvaluationStatus, ExperimentInitError, type ExperimentInitOptions, ExperimentsFacade, FetchPolicy, type GetDatasetOptions, type GetPromptOptions, LangWatch, type ListDatasetsApiResponse, type ListDatasetsOptions, type ListRecordsApiResponse, type ListRecordsOptions, type LogOptions, type PaginatedResponse, type Pagination, type RunCallback, type RunContext, type RunOptions, type TargetInfo, type TargetMetadata, TargetMetadataConflictError, type TargetType, type UpdateDatasetOptions, type UploadResponse, logger };