langwatch 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/{chunk-F7BVJW3S.js → chunk-E35GFO25.js} +16 -3
- package/dist/chunk-E35GFO25.js.map +1 -0
- package/dist/{chunk-2GKEMCKT.mjs → chunk-FXCZARU3.mjs} +16 -3
- package/dist/{chunk-2GKEMCKT.mjs.map → chunk-FXCZARU3.mjs.map} +1 -1
- package/dist/{chunk-AYPQNLCC.mjs → chunk-OAAGWSLX.mjs} +2 -2
- package/dist/{chunk-M3DSPR5S.mjs → chunk-P65KWWFU.mjs} +2 -2
- package/dist/{chunk-M3DSPR5S.mjs.map → chunk-P65KWWFU.mjs.map} +1 -1
- package/dist/{chunk-MAO3SIBB.js → chunk-PDTYQM5C.js} +2 -2
- package/dist/{chunk-MAO3SIBB.js.map → chunk-PDTYQM5C.js.map} +1 -1
- package/dist/{chunk-DLZCOUXC.js → chunk-TQJS5H5P.js} +12 -12
- package/dist/{chunk-DLZCOUXC.js.map → chunk-TQJS5H5P.js.map} +1 -1
- package/dist/cli/bundle.js +957 -451
- package/dist/{implementation-BXVPzwOt.d.mts → implementation-CMJfitMa.d.mts} +1 -1
- package/dist/{implementation-DJ-JveZl.d.ts → implementation-CaKFOMnp.d.ts} +1 -1
- package/dist/index.d.mts +80 -8
- package/dist/index.d.ts +80 -8
- package/dist/index.js +195 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +120 -19
- package/dist/index.mjs.map +1 -1
- package/dist/observability-sdk/index.d.mts +3 -3
- package/dist/observability-sdk/index.d.ts +3 -3
- package/dist/observability-sdk/index.js +4 -4
- package/dist/observability-sdk/index.js.map +1 -1
- package/dist/observability-sdk/index.mjs +8 -8
- package/dist/observability-sdk/instrumentation/langchain/index.d.mts +1 -1
- package/dist/observability-sdk/instrumentation/langchain/index.d.ts +1 -1
- package/dist/observability-sdk/instrumentation/langchain/index.js +4 -4
- package/dist/observability-sdk/instrumentation/langchain/index.mjs +1 -1
- package/dist/observability-sdk/setup/node/index.js +3 -3
- package/dist/observability-sdk/setup/node/index.mjs +2 -2
- package/dist/{types-CpT3iEIj.d.ts → types-0leNdzy4.d.ts} +581 -23
- package/dist/{types--ExXvd26.d.mts → types-DNjiOkpS.d.mts} +581 -23
- package/package.json +1 -1
- package/dist/chunk-F7BVJW3S.js.map +0 -1
- /package/dist/{chunk-AYPQNLCC.mjs.map → chunk-OAAGWSLX.mjs.map} +0 -0
|
@@ -6,7 +6,7 @@ import { Logger, LogRecord, LoggerProvider } from '@opentelemetry/api-logs';
|
|
|
6
6
|
import { V as VAL_GEN_AI_SYSTEMS, a as VAL_GEN_AI_FINISH_REASONS } from './values-1yj9l0Sa.mjs';
|
|
7
7
|
import { b as SemConvLogRecordAttributes, a as SemConvAttributes } from './types-CoS5PmeU.mjs';
|
|
8
8
|
import { TracerProvider } from '@opentelemetry/api';
|
|
9
|
-
import { j as LangWatchTracer } from './types
|
|
9
|
+
import { j as LangWatchTracer } from './types-DNjiOkpS.mjs';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* A BatchSpanProcessor subclass that filters spans before export by
|
|
@@ -6,7 +6,7 @@ import { Logger, LogRecord, LoggerProvider } from '@opentelemetry/api-logs';
|
|
|
6
6
|
import { V as VAL_GEN_AI_SYSTEMS, a as VAL_GEN_AI_FINISH_REASONS } from './values-1yj9l0Sa.js';
|
|
7
7
|
import { b as SemConvLogRecordAttributes, a as SemConvAttributes } from './types-CoS5PmeU.js';
|
|
8
8
|
import { TracerProvider } from '@opentelemetry/api';
|
|
9
|
-
import { j as LangWatchTracer } from './types-
|
|
9
|
+
import { j as LangWatchTracer } from './types-0leNdzy4.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* A BatchSpanProcessor subclass that filters spans before export by
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { L as Logger, C as ConsoleLogger, N as NoOpLogger } from './index-D7rKIGrO.mjs';
|
|
2
|
-
export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, S as SpanProcessingExcludeRule, g as getLangWatchLogger, a as getLangWatchTracer } from './implementation-
|
|
2
|
+
export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, S as SpanProcessingExcludeRule, g as getLangWatchLogger, a as getLangWatchTracer } from './implementation-CMJfitMa.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import openApiCreateClient from 'openapi-fetch';
|
|
5
|
-
import { p as paths, P as PromptResponse, C as CreatePromptBody, U as UpdatePromptBody, T as TagDefinition, a as CreatedTag, o as operations, b as PromptData, F as FetchPolicy, c as Prompt, L as LangWatchSpan, d as components } from './types
|
|
5
|
+
import { p as paths, P as PromptResponse, C as CreatePromptBody, U as UpdatePromptBody, T as TagDefinition, a as CreatedTag, o as operations, b as PromptData, F as FetchPolicy, c as Prompt, L as LangWatchSpan, d as components } from './types-DNjiOkpS.mjs';
|
|
6
6
|
export { l as attributes } from './types-CoS5PmeU.mjs';
|
|
7
7
|
import { LangWatchHandledErrorReason, LangWatchHandledErrorShape } from '@langwatch/handled-error/langwatch-handled-error';
|
|
8
8
|
export { LangWatchHandledErrorReason, LangWatchHandledErrorShape } from '@langwatch/handled-error/langwatch-handled-error';
|
|
@@ -1157,6 +1157,16 @@ type ExperimentRunSummary = {
|
|
|
1157
1157
|
passRate?: number;
|
|
1158
1158
|
totalCost?: number;
|
|
1159
1159
|
};
|
|
1160
|
+
/**
|
|
1161
|
+
* Experiment-only run options: the workflow evaluate endpoint has no such field.
|
|
1162
|
+
*/
|
|
1163
|
+
type ExperimentConcurrencyOptions = {
|
|
1164
|
+
/**
|
|
1165
|
+
* Cells (one row against one target) run at once for this run only, 1 to 24; the
|
|
1166
|
+
* experiment's saved setting is untouched. Defaults to the server's. 1 runs them in order.
|
|
1167
|
+
*/
|
|
1168
|
+
concurrency?: number;
|
|
1169
|
+
};
|
|
1160
1170
|
/**
|
|
1161
1171
|
* Options for running a platform experiment
|
|
1162
1172
|
*/
|
|
@@ -1173,6 +1183,11 @@ type RunExperimentOptions = {
|
|
|
1173
1183
|
* Callback for progress updates
|
|
1174
1184
|
*/
|
|
1175
1185
|
onProgress?: (progress: number, total: number) => void;
|
|
1186
|
+
/**
|
|
1187
|
+
* Version of the experiment's saved dataset to run. Overrides the version the
|
|
1188
|
+
* experiment pins; without either, the run saves and reads the current content.
|
|
1189
|
+
*/
|
|
1190
|
+
datasetVersion?: number;
|
|
1176
1191
|
};
|
|
1177
1192
|
/**
|
|
1178
1193
|
* Inputs that override a platform experiment or workflow run on the server.
|
|
@@ -1304,13 +1319,13 @@ declare class ExperimentsFacade {
|
|
|
1304
1319
|
* summary and exits with code 1 on failure, unless `exitOnFailure: false`.
|
|
1305
1320
|
* @param slug - The slug of the experiment (found in the experiment URL)
|
|
1306
1321
|
*/
|
|
1307
|
-
run(slug: string, options?: RunExperimentOptions): Promise<ExperimentRunResult>;
|
|
1322
|
+
run(slug: string, options?: RunExperimentOptions & ExperimentConcurrencyOptions): Promise<ExperimentRunResult>;
|
|
1308
1323
|
/**
|
|
1309
1324
|
* Run a platform experiment and return per-row structured results.
|
|
1310
1325
|
* @param slug - The slug of the experiment (found in the experiment URL)
|
|
1311
1326
|
* @param options - Optional inputs and polling configuration
|
|
1312
1327
|
*/
|
|
1313
|
-
runWithResults(slug: string, options?: RunWithResultsOptions): Promise<ExperimentRunWithResults>;
|
|
1328
|
+
runWithResults(slug: string, options?: RunWithResultsOptions & ExperimentConcurrencyOptions): Promise<ExperimentRunWithResults>;
|
|
1314
1329
|
/**
|
|
1315
1330
|
* Run an experiment and wait for completion using polling
|
|
1316
1331
|
*/
|
|
@@ -1488,6 +1503,15 @@ type EvaluatorField = EvaluatorResponse["fields"][number];
|
|
|
1488
1503
|
type CreateEvaluatorBody = NonNullable<paths["/api/v1/evaluators"]["post"]["requestBody"]>["content"]["application/json"];
|
|
1489
1504
|
type UpdateEvaluatorBody = NonNullable<paths["/api/v1/evaluators/{id}"]["put"]["requestBody"]>["content"]["application/json"];
|
|
1490
1505
|
type DeleteEvaluatorResponse = paths["/api/v1/evaluators/{id}"]["delete"]["responses"]["200"]["content"]["application/json"];
|
|
1506
|
+
/** Which version of an evaluator to read: a deploy label such as `production`, or a number. */
|
|
1507
|
+
type EvaluatorVersionSelector = {
|
|
1508
|
+
label?: string;
|
|
1509
|
+
version?: number;
|
|
1510
|
+
};
|
|
1511
|
+
/** An evaluator's versions, newest first, and where each deploy label points. */
|
|
1512
|
+
type EvaluatorVersionsResponse = paths["/api/v1/evaluators/{evaluatorId}/versions"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
1513
|
+
/** A deploy label after it was moved. */
|
|
1514
|
+
type EvaluatorLabelResponse = paths["/api/v1/evaluators/{evaluatorId}/labels/{label}"]["put"]["responses"]["200"]["content"]["application/json"];
|
|
1491
1515
|
|
|
1492
1516
|
/**
|
|
1493
1517
|
* Service for retrieving evaluator resources via the LangWatch API.
|
|
@@ -1503,9 +1527,10 @@ declare class EvaluatorsApiService {
|
|
|
1503
1527
|
*/
|
|
1504
1528
|
getAll(): Promise<EvaluatorResponse[]>;
|
|
1505
1529
|
/**
|
|
1506
|
-
* Fetches a single evaluator by its ID or slug
|
|
1530
|
+
* Fetches a single evaluator by its ID or slug, at the latest version unless a `label` or a
|
|
1531
|
+
* `version` is asked for. The slug also takes a suffix: `toxicity:production` or `toxicity:2`.
|
|
1507
1532
|
*/
|
|
1508
|
-
get(idOrSlug: string): Promise<EvaluatorResponse>;
|
|
1533
|
+
get(idOrSlug: string, selector?: EvaluatorVersionSelector): Promise<EvaluatorResponse>;
|
|
1509
1534
|
/**
|
|
1510
1535
|
* Creates a new evaluator.
|
|
1511
1536
|
*/
|
|
@@ -1518,6 +1543,15 @@ declare class EvaluatorsApiService {
|
|
|
1518
1543
|
* Deletes (archives) an evaluator by its ID.
|
|
1519
1544
|
*/
|
|
1520
1545
|
delete(id: string): Promise<DeleteEvaluatorResponse>;
|
|
1546
|
+
/** Every version of the evaluator, newest first, with the labels on each. */
|
|
1547
|
+
listVersions(id: string): Promise<EvaluatorVersionsResponse>;
|
|
1548
|
+
/** Points a deploy label, such as `production`, at one of the evaluator's versions. */
|
|
1549
|
+
assignLabel(id: string, label: string, version: number): Promise<EvaluatorLabelResponse>;
|
|
1550
|
+
/** Removes a deploy label from the evaluator. */
|
|
1551
|
+
removeLabel(id: string, label: string): Promise<{
|
|
1552
|
+
label: string;
|
|
1553
|
+
removed: true;
|
|
1554
|
+
}>;
|
|
1521
1555
|
}
|
|
1522
1556
|
|
|
1523
1557
|
declare class EvaluatorsApiError extends Error {
|
|
@@ -1823,7 +1857,31 @@ interface AgentResponse {
|
|
|
1823
1857
|
/** Why the agent cannot be run with this key; null when it can. */
|
|
1824
1858
|
notSelectableReason?: "owned_by_another_person" | null;
|
|
1825
1859
|
parameters?: AgentParameterSpec[];
|
|
1860
|
+
/** The version this read shows: the latest unless a label or a version was asked for. */
|
|
1861
|
+
version?: number | null;
|
|
1862
|
+
/** The deploy labels and the version each one points at. */
|
|
1863
|
+
labels?: {
|
|
1864
|
+
label: string;
|
|
1865
|
+
version: number;
|
|
1866
|
+
}[];
|
|
1867
|
+
createdBy?: {
|
|
1868
|
+
id: string;
|
|
1869
|
+
name: string | null;
|
|
1870
|
+
} | null;
|
|
1871
|
+
updatedBy?: {
|
|
1872
|
+
id: string;
|
|
1873
|
+
name: string | null;
|
|
1874
|
+
} | null;
|
|
1826
1875
|
}
|
|
1876
|
+
/** Which version of an agent to read: a deploy label such as `production`, or a number. */
|
|
1877
|
+
type AgentVersionSelector = {
|
|
1878
|
+
label?: string;
|
|
1879
|
+
version?: number;
|
|
1880
|
+
};
|
|
1881
|
+
/** An agent's versions, newest first, and where each deploy label points. */
|
|
1882
|
+
type AgentVersionsResponse = paths["/api/v1/agents/{agentId}/versions"]["get"]["responses"][200]["content"]["application/json"];
|
|
1883
|
+
/** A deploy label after it was moved. */
|
|
1884
|
+
type AgentLabelResponse = paths["/api/v1/agents/{agentId}/labels/{label}"]["put"]["responses"][200]["content"]["application/json"];
|
|
1827
1885
|
interface AgentListResponse {
|
|
1828
1886
|
data: AgentResponse[];
|
|
1829
1887
|
pagination: {
|
|
@@ -1847,17 +1905,22 @@ declare class AgentsApiService {
|
|
|
1847
1905
|
page?: number;
|
|
1848
1906
|
limit?: number;
|
|
1849
1907
|
}): Promise<AgentListResponse>;
|
|
1850
|
-
|
|
1908
|
+
/** Reads the latest version unless a `label` or a `version` is asked for. */
|
|
1909
|
+
get(id: string, selector?: AgentVersionSelector): Promise<AgentResponse>;
|
|
1851
1910
|
create(params: {
|
|
1852
1911
|
name: string;
|
|
1853
1912
|
type: string;
|
|
1854
1913
|
config: Record<string, unknown>;
|
|
1855
1914
|
workflowId?: string;
|
|
1915
|
+
/** Recorded on version 1. */
|
|
1916
|
+
commitMessage?: string;
|
|
1856
1917
|
}): Promise<AgentResponse>;
|
|
1857
1918
|
update(id: string, params: {
|
|
1858
1919
|
name?: string;
|
|
1859
1920
|
type?: string;
|
|
1860
1921
|
config?: Record<string, unknown>;
|
|
1922
|
+
/** Recorded on the version this update appends. */
|
|
1923
|
+
commitMessage?: string;
|
|
1861
1924
|
}): Promise<AgentResponse>;
|
|
1862
1925
|
delete(id: string): Promise<{
|
|
1863
1926
|
id: string;
|
|
@@ -1874,6 +1937,15 @@ declare class AgentsApiService {
|
|
|
1874
1937
|
* test suite, and the answer carries the run ids to follow.
|
|
1875
1938
|
*/
|
|
1876
1939
|
test(id: string): Promise<AgentTestRunResponse>;
|
|
1940
|
+
/** Every version of the agent, newest first, with the labels on each. */
|
|
1941
|
+
listVersions(id: string): Promise<AgentVersionsResponse>;
|
|
1942
|
+
/** Points a deploy label, such as `production`, at one of the agent's versions. */
|
|
1943
|
+
assignLabel(id: string, label: string, version: number): Promise<AgentLabelResponse>;
|
|
1944
|
+
/** Removes a deploy label from the agent. */
|
|
1945
|
+
removeLabel(id: string, label: string): Promise<{
|
|
1946
|
+
label: string;
|
|
1947
|
+
removed: true;
|
|
1948
|
+
}>;
|
|
1877
1949
|
}
|
|
1878
1950
|
|
|
1879
1951
|
type AnnotationResponse = components["schemas"]["Annotation"];
|
|
@@ -3672,4 +3744,4 @@ declare const logger: {
|
|
|
3672
3744
|
NoOpLogger: typeof NoOpLogger;
|
|
3673
3745
|
};
|
|
3674
3746
|
|
|
3675
|
-
export { type ArchivedProject, type ArchivedTeam, type BatchCreateRecordsResponse, type BudgetOnBreach, type BudgetScopeKind, type BudgetWindow, ComparisonError, type ComparisonMetric, type ComparisonOptions, type ComparisonStatus, type ComparisonVerdict, type CreateDatasetOptions, type CreateEvaluatorBody, type CreateFromUploadResponse, type CreateGatewayBudgetInput, type CreateGatewayBudgetScope, type CreateLangWatchFetchOptions, type CreateProjectInput, type CreateVirtualKeyInput, type CreateWebhookEndpointInput, type Dataset, DatasetApiError, type DatasetColumnType, type DatasetEntry, DatasetError, type DatasetListItem, type DatasetMetadata, DatasetNotFoundError, DatasetPlanLimitError, type DatasetRecordResponse, DatasetValidationError, DatasetsFacade, type DeleteRecordsResponse, type EmittedEvent, type EmittedEventsPage, type EndUserCap, type EndUserSpend, type EvaluateOptions, type EvaluationCost, EvaluationError, type EvaluationResult, type EvaluationStatus, EvaluationsApiError, EvaluationsFacade, EvaluatorCallError, EvaluatorError, type EvaluatorField, EvaluatorNotFoundError, type EvaluatorResponse, EvaluatorsApiError, EvaluatorsApiService, Experiment, ExperimentApiError, ExperimentError, type ExperimentEvaluateOptions, type ExperimentEvaluationResult, type ExperimentEvaluationStatus, ExperimentInitError, type ExperimentInitOptions, type ExperimentRowResult, type ExperimentRunWithResults, ExperimentsFacade, FetchPolicy, type GatewayBudget, type GatewayBudgetPage, GatewayBudgetsApiError, GatewayBudgetsApiService, type GetDatasetOptions, type GetPromptOptions, IDEMPOTENCY_KEY_HEADER, IDEMPOTENT_REPLAY_HEADER, type IdempotentCreateOptions, LangWatch, LangWatchApiError, type LangWatchFetch, LangWatchHandledError, LangWatchRedirectError, type ListDatasetsApiResponse, type ListDatasetsOptions, type ListRecordsApiResponse, type ListRecordsOptions, type ListTeamsResponse, type LogOptions, type MutationOptions, type PaginatedProjects, type PaginatedResponse, type Pagination, type Project, type ProjectWithServiceKey, ProjectsApiError, ProjectsApiService, type RunCallback, type RunContext, type RunOptions, type RunWithResultsOptions, type SpendEvent, type SpendEventStatus, SpendEventsApiError, SpendEventsApiService, type SpendEventsPage, type SpendFilterOptions, type SpendGroupBy, type SpendReplayResult, type SpendSummariesOptions, type SpendSummariesPage, type SpendSummaryRow, type SpendSummaryStatus, type TargetInfo, type TargetMetadata, TargetMetadataConflictError, type TargetType, type Team, type TeamMember, type TeamPagination, TeamsApiError, TeamsApiService, type UpdateDatasetOptions, type UpdateGatewayBudgetInput, type UpdateProjectInput, type UpdateVirtualKeyInput, type UpdateWebhookEndpointInput, type UploadResponse, type VerifyWebhookSignatureOptions, type VirtualKey, type VirtualKeyBudgetInput, type VirtualKeyPage, type VirtualKeyRoutingMode, type VirtualKeyScope, type VirtualKeyScopeType, type VirtualKeySpendSummary, type VirtualKeyWithSecret, VirtualKeysApiError, VirtualKeysApiService, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_SIGNATURE_DEFAULT_TOLERANCE_SECONDS, WEBHOOK_SIGNATURE_HEADER, type WebhookDeliveryPage, type WebhookDeliveryRecord, type WebhookEndpointHealth, type WebhookEndpointSummary, type WebhookEndpointWithSecret, type WebhookEventType, type WebhookSignatureFailureCode, WebhookSignatureVerificationError, type WebhookTestResult, WebhooksApiError, WebhooksApiService, createLangWatchFetch, isLangWatchHandledError, langwatchFetch, logger, verifyWebhookSignature };
|
|
3747
|
+
export { type ArchivedProject, type ArchivedTeam, type BatchCreateRecordsResponse, type BudgetOnBreach, type BudgetScopeKind, type BudgetWindow, ComparisonError, type ComparisonMetric, type ComparisonOptions, type ComparisonStatus, type ComparisonVerdict, type CreateDatasetOptions, type CreateEvaluatorBody, type CreateFromUploadResponse, type CreateGatewayBudgetInput, type CreateGatewayBudgetScope, type CreateLangWatchFetchOptions, type CreateProjectInput, type CreateVirtualKeyInput, type CreateWebhookEndpointInput, type Dataset, DatasetApiError, type DatasetColumnType, type DatasetEntry, DatasetError, type DatasetListItem, type DatasetMetadata, DatasetNotFoundError, DatasetPlanLimitError, type DatasetRecordResponse, DatasetValidationError, DatasetsFacade, type DeleteRecordsResponse, type EmittedEvent, type EmittedEventsPage, type EndUserCap, type EndUserSpend, type EvaluateOptions, type EvaluationCost, EvaluationError, type EvaluationResult, type EvaluationStatus, EvaluationsApiError, EvaluationsFacade, EvaluatorCallError, EvaluatorError, type EvaluatorField, EvaluatorNotFoundError, type EvaluatorResponse, EvaluatorsApiError, EvaluatorsApiService, Experiment, ExperimentApiError, type ExperimentConcurrencyOptions, ExperimentError, type ExperimentEvaluateOptions, type ExperimentEvaluationResult, type ExperimentEvaluationStatus, ExperimentInitError, type ExperimentInitOptions, type ExperimentRowResult, type ExperimentRunWithResults, ExperimentsFacade, FetchPolicy, type GatewayBudget, type GatewayBudgetPage, GatewayBudgetsApiError, GatewayBudgetsApiService, type GetDatasetOptions, type GetPromptOptions, IDEMPOTENCY_KEY_HEADER, IDEMPOTENT_REPLAY_HEADER, type IdempotentCreateOptions, LangWatch, LangWatchApiError, type LangWatchFetch, LangWatchHandledError, LangWatchRedirectError, type ListDatasetsApiResponse, type ListDatasetsOptions, type ListRecordsApiResponse, type ListRecordsOptions, type ListTeamsResponse, type LogOptions, type MutationOptions, type PaginatedProjects, type PaginatedResponse, type Pagination, type Project, type ProjectWithServiceKey, ProjectsApiError, ProjectsApiService, type RunCallback, type RunContext, type RunOptions, type RunWithResultsOptions, type SpendEvent, type SpendEventStatus, SpendEventsApiError, SpendEventsApiService, type SpendEventsPage, type SpendFilterOptions, type SpendGroupBy, type SpendReplayResult, type SpendSummariesOptions, type SpendSummariesPage, type SpendSummaryRow, type SpendSummaryStatus, type TargetInfo, type TargetMetadata, TargetMetadataConflictError, type TargetType, type Team, type TeamMember, type TeamPagination, TeamsApiError, TeamsApiService, type UpdateDatasetOptions, type UpdateGatewayBudgetInput, type UpdateProjectInput, type UpdateVirtualKeyInput, type UpdateWebhookEndpointInput, type UploadResponse, type VerifyWebhookSignatureOptions, type VirtualKey, type VirtualKeyBudgetInput, type VirtualKeyPage, type VirtualKeyRoutingMode, type VirtualKeyScope, type VirtualKeyScopeType, type VirtualKeySpendSummary, type VirtualKeyWithSecret, VirtualKeysApiError, VirtualKeysApiService, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_SIGNATURE_DEFAULT_TOLERANCE_SECONDS, WEBHOOK_SIGNATURE_HEADER, type WebhookDeliveryPage, type WebhookDeliveryRecord, type WebhookEndpointHealth, type WebhookEndpointSummary, type WebhookEndpointWithSecret, type WebhookEventType, type WebhookSignatureFailureCode, WebhookSignatureVerificationError, type WebhookTestResult, WebhooksApiError, WebhooksApiService, createLangWatchFetch, isLangWatchHandledError, langwatchFetch, logger, verifyWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { L as Logger, C as ConsoleLogger, N as NoOpLogger } from './index-D7rKIGrO.js';
|
|
2
|
-
export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, S as SpanProcessingExcludeRule, g as getLangWatchLogger, a as getLangWatchTracer } from './implementation-
|
|
2
|
+
export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, S as SpanProcessingExcludeRule, g as getLangWatchLogger, a as getLangWatchTracer } from './implementation-CaKFOMnp.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import openApiCreateClient from 'openapi-fetch';
|
|
5
|
-
import { p as paths, P as PromptResponse, C as CreatePromptBody, U as UpdatePromptBody, T as TagDefinition, a as CreatedTag, o as operations, b as PromptData, F as FetchPolicy, c as Prompt, L as LangWatchSpan, d as components } from './types-
|
|
5
|
+
import { p as paths, P as PromptResponse, C as CreatePromptBody, U as UpdatePromptBody, T as TagDefinition, a as CreatedTag, o as operations, b as PromptData, F as FetchPolicy, c as Prompt, L as LangWatchSpan, d as components } from './types-0leNdzy4.js';
|
|
6
6
|
export { l as attributes } from './types-CoS5PmeU.js';
|
|
7
7
|
import { LangWatchHandledErrorReason, LangWatchHandledErrorShape } from '@langwatch/handled-error/langwatch-handled-error';
|
|
8
8
|
export { LangWatchHandledErrorReason, LangWatchHandledErrorShape } from '@langwatch/handled-error/langwatch-handled-error';
|
|
@@ -1157,6 +1157,16 @@ type ExperimentRunSummary = {
|
|
|
1157
1157
|
passRate?: number;
|
|
1158
1158
|
totalCost?: number;
|
|
1159
1159
|
};
|
|
1160
|
+
/**
|
|
1161
|
+
* Experiment-only run options: the workflow evaluate endpoint has no such field.
|
|
1162
|
+
*/
|
|
1163
|
+
type ExperimentConcurrencyOptions = {
|
|
1164
|
+
/**
|
|
1165
|
+
* Cells (one row against one target) run at once for this run only, 1 to 24; the
|
|
1166
|
+
* experiment's saved setting is untouched. Defaults to the server's. 1 runs them in order.
|
|
1167
|
+
*/
|
|
1168
|
+
concurrency?: number;
|
|
1169
|
+
};
|
|
1160
1170
|
/**
|
|
1161
1171
|
* Options for running a platform experiment
|
|
1162
1172
|
*/
|
|
@@ -1173,6 +1183,11 @@ type RunExperimentOptions = {
|
|
|
1173
1183
|
* Callback for progress updates
|
|
1174
1184
|
*/
|
|
1175
1185
|
onProgress?: (progress: number, total: number) => void;
|
|
1186
|
+
/**
|
|
1187
|
+
* Version of the experiment's saved dataset to run. Overrides the version the
|
|
1188
|
+
* experiment pins; without either, the run saves and reads the current content.
|
|
1189
|
+
*/
|
|
1190
|
+
datasetVersion?: number;
|
|
1176
1191
|
};
|
|
1177
1192
|
/**
|
|
1178
1193
|
* Inputs that override a platform experiment or workflow run on the server.
|
|
@@ -1304,13 +1319,13 @@ declare class ExperimentsFacade {
|
|
|
1304
1319
|
* summary and exits with code 1 on failure, unless `exitOnFailure: false`.
|
|
1305
1320
|
* @param slug - The slug of the experiment (found in the experiment URL)
|
|
1306
1321
|
*/
|
|
1307
|
-
run(slug: string, options?: RunExperimentOptions): Promise<ExperimentRunResult>;
|
|
1322
|
+
run(slug: string, options?: RunExperimentOptions & ExperimentConcurrencyOptions): Promise<ExperimentRunResult>;
|
|
1308
1323
|
/**
|
|
1309
1324
|
* Run a platform experiment and return per-row structured results.
|
|
1310
1325
|
* @param slug - The slug of the experiment (found in the experiment URL)
|
|
1311
1326
|
* @param options - Optional inputs and polling configuration
|
|
1312
1327
|
*/
|
|
1313
|
-
runWithResults(slug: string, options?: RunWithResultsOptions): Promise<ExperimentRunWithResults>;
|
|
1328
|
+
runWithResults(slug: string, options?: RunWithResultsOptions & ExperimentConcurrencyOptions): Promise<ExperimentRunWithResults>;
|
|
1314
1329
|
/**
|
|
1315
1330
|
* Run an experiment and wait for completion using polling
|
|
1316
1331
|
*/
|
|
@@ -1488,6 +1503,15 @@ type EvaluatorField = EvaluatorResponse["fields"][number];
|
|
|
1488
1503
|
type CreateEvaluatorBody = NonNullable<paths["/api/v1/evaluators"]["post"]["requestBody"]>["content"]["application/json"];
|
|
1489
1504
|
type UpdateEvaluatorBody = NonNullable<paths["/api/v1/evaluators/{id}"]["put"]["requestBody"]>["content"]["application/json"];
|
|
1490
1505
|
type DeleteEvaluatorResponse = paths["/api/v1/evaluators/{id}"]["delete"]["responses"]["200"]["content"]["application/json"];
|
|
1506
|
+
/** Which version of an evaluator to read: a deploy label such as `production`, or a number. */
|
|
1507
|
+
type EvaluatorVersionSelector = {
|
|
1508
|
+
label?: string;
|
|
1509
|
+
version?: number;
|
|
1510
|
+
};
|
|
1511
|
+
/** An evaluator's versions, newest first, and where each deploy label points. */
|
|
1512
|
+
type EvaluatorVersionsResponse = paths["/api/v1/evaluators/{evaluatorId}/versions"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
1513
|
+
/** A deploy label after it was moved. */
|
|
1514
|
+
type EvaluatorLabelResponse = paths["/api/v1/evaluators/{evaluatorId}/labels/{label}"]["put"]["responses"]["200"]["content"]["application/json"];
|
|
1491
1515
|
|
|
1492
1516
|
/**
|
|
1493
1517
|
* Service for retrieving evaluator resources via the LangWatch API.
|
|
@@ -1503,9 +1527,10 @@ declare class EvaluatorsApiService {
|
|
|
1503
1527
|
*/
|
|
1504
1528
|
getAll(): Promise<EvaluatorResponse[]>;
|
|
1505
1529
|
/**
|
|
1506
|
-
* Fetches a single evaluator by its ID or slug
|
|
1530
|
+
* Fetches a single evaluator by its ID or slug, at the latest version unless a `label` or a
|
|
1531
|
+
* `version` is asked for. The slug also takes a suffix: `toxicity:production` or `toxicity:2`.
|
|
1507
1532
|
*/
|
|
1508
|
-
get(idOrSlug: string): Promise<EvaluatorResponse>;
|
|
1533
|
+
get(idOrSlug: string, selector?: EvaluatorVersionSelector): Promise<EvaluatorResponse>;
|
|
1509
1534
|
/**
|
|
1510
1535
|
* Creates a new evaluator.
|
|
1511
1536
|
*/
|
|
@@ -1518,6 +1543,15 @@ declare class EvaluatorsApiService {
|
|
|
1518
1543
|
* Deletes (archives) an evaluator by its ID.
|
|
1519
1544
|
*/
|
|
1520
1545
|
delete(id: string): Promise<DeleteEvaluatorResponse>;
|
|
1546
|
+
/** Every version of the evaluator, newest first, with the labels on each. */
|
|
1547
|
+
listVersions(id: string): Promise<EvaluatorVersionsResponse>;
|
|
1548
|
+
/** Points a deploy label, such as `production`, at one of the evaluator's versions. */
|
|
1549
|
+
assignLabel(id: string, label: string, version: number): Promise<EvaluatorLabelResponse>;
|
|
1550
|
+
/** Removes a deploy label from the evaluator. */
|
|
1551
|
+
removeLabel(id: string, label: string): Promise<{
|
|
1552
|
+
label: string;
|
|
1553
|
+
removed: true;
|
|
1554
|
+
}>;
|
|
1521
1555
|
}
|
|
1522
1556
|
|
|
1523
1557
|
declare class EvaluatorsApiError extends Error {
|
|
@@ -1823,7 +1857,31 @@ interface AgentResponse {
|
|
|
1823
1857
|
/** Why the agent cannot be run with this key; null when it can. */
|
|
1824
1858
|
notSelectableReason?: "owned_by_another_person" | null;
|
|
1825
1859
|
parameters?: AgentParameterSpec[];
|
|
1860
|
+
/** The version this read shows: the latest unless a label or a version was asked for. */
|
|
1861
|
+
version?: number | null;
|
|
1862
|
+
/** The deploy labels and the version each one points at. */
|
|
1863
|
+
labels?: {
|
|
1864
|
+
label: string;
|
|
1865
|
+
version: number;
|
|
1866
|
+
}[];
|
|
1867
|
+
createdBy?: {
|
|
1868
|
+
id: string;
|
|
1869
|
+
name: string | null;
|
|
1870
|
+
} | null;
|
|
1871
|
+
updatedBy?: {
|
|
1872
|
+
id: string;
|
|
1873
|
+
name: string | null;
|
|
1874
|
+
} | null;
|
|
1826
1875
|
}
|
|
1876
|
+
/** Which version of an agent to read: a deploy label such as `production`, or a number. */
|
|
1877
|
+
type AgentVersionSelector = {
|
|
1878
|
+
label?: string;
|
|
1879
|
+
version?: number;
|
|
1880
|
+
};
|
|
1881
|
+
/** An agent's versions, newest first, and where each deploy label points. */
|
|
1882
|
+
type AgentVersionsResponse = paths["/api/v1/agents/{agentId}/versions"]["get"]["responses"][200]["content"]["application/json"];
|
|
1883
|
+
/** A deploy label after it was moved. */
|
|
1884
|
+
type AgentLabelResponse = paths["/api/v1/agents/{agentId}/labels/{label}"]["put"]["responses"][200]["content"]["application/json"];
|
|
1827
1885
|
interface AgentListResponse {
|
|
1828
1886
|
data: AgentResponse[];
|
|
1829
1887
|
pagination: {
|
|
@@ -1847,17 +1905,22 @@ declare class AgentsApiService {
|
|
|
1847
1905
|
page?: number;
|
|
1848
1906
|
limit?: number;
|
|
1849
1907
|
}): Promise<AgentListResponse>;
|
|
1850
|
-
|
|
1908
|
+
/** Reads the latest version unless a `label` or a `version` is asked for. */
|
|
1909
|
+
get(id: string, selector?: AgentVersionSelector): Promise<AgentResponse>;
|
|
1851
1910
|
create(params: {
|
|
1852
1911
|
name: string;
|
|
1853
1912
|
type: string;
|
|
1854
1913
|
config: Record<string, unknown>;
|
|
1855
1914
|
workflowId?: string;
|
|
1915
|
+
/** Recorded on version 1. */
|
|
1916
|
+
commitMessage?: string;
|
|
1856
1917
|
}): Promise<AgentResponse>;
|
|
1857
1918
|
update(id: string, params: {
|
|
1858
1919
|
name?: string;
|
|
1859
1920
|
type?: string;
|
|
1860
1921
|
config?: Record<string, unknown>;
|
|
1922
|
+
/** Recorded on the version this update appends. */
|
|
1923
|
+
commitMessage?: string;
|
|
1861
1924
|
}): Promise<AgentResponse>;
|
|
1862
1925
|
delete(id: string): Promise<{
|
|
1863
1926
|
id: string;
|
|
@@ -1874,6 +1937,15 @@ declare class AgentsApiService {
|
|
|
1874
1937
|
* test suite, and the answer carries the run ids to follow.
|
|
1875
1938
|
*/
|
|
1876
1939
|
test(id: string): Promise<AgentTestRunResponse>;
|
|
1940
|
+
/** Every version of the agent, newest first, with the labels on each. */
|
|
1941
|
+
listVersions(id: string): Promise<AgentVersionsResponse>;
|
|
1942
|
+
/** Points a deploy label, such as `production`, at one of the agent's versions. */
|
|
1943
|
+
assignLabel(id: string, label: string, version: number): Promise<AgentLabelResponse>;
|
|
1944
|
+
/** Removes a deploy label from the agent. */
|
|
1945
|
+
removeLabel(id: string, label: string): Promise<{
|
|
1946
|
+
label: string;
|
|
1947
|
+
removed: true;
|
|
1948
|
+
}>;
|
|
1877
1949
|
}
|
|
1878
1950
|
|
|
1879
1951
|
type AnnotationResponse = components["schemas"]["Annotation"];
|
|
@@ -3672,4 +3744,4 @@ declare const logger: {
|
|
|
3672
3744
|
NoOpLogger: typeof NoOpLogger;
|
|
3673
3745
|
};
|
|
3674
3746
|
|
|
3675
|
-
export { type ArchivedProject, type ArchivedTeam, type BatchCreateRecordsResponse, type BudgetOnBreach, type BudgetScopeKind, type BudgetWindow, ComparisonError, type ComparisonMetric, type ComparisonOptions, type ComparisonStatus, type ComparisonVerdict, type CreateDatasetOptions, type CreateEvaluatorBody, type CreateFromUploadResponse, type CreateGatewayBudgetInput, type CreateGatewayBudgetScope, type CreateLangWatchFetchOptions, type CreateProjectInput, type CreateVirtualKeyInput, type CreateWebhookEndpointInput, type Dataset, DatasetApiError, type DatasetColumnType, type DatasetEntry, DatasetError, type DatasetListItem, type DatasetMetadata, DatasetNotFoundError, DatasetPlanLimitError, type DatasetRecordResponse, DatasetValidationError, DatasetsFacade, type DeleteRecordsResponse, type EmittedEvent, type EmittedEventsPage, type EndUserCap, type EndUserSpend, type EvaluateOptions, type EvaluationCost, EvaluationError, type EvaluationResult, type EvaluationStatus, EvaluationsApiError, EvaluationsFacade, EvaluatorCallError, EvaluatorError, type EvaluatorField, EvaluatorNotFoundError, type EvaluatorResponse, EvaluatorsApiError, EvaluatorsApiService, Experiment, ExperimentApiError, ExperimentError, type ExperimentEvaluateOptions, type ExperimentEvaluationResult, type ExperimentEvaluationStatus, ExperimentInitError, type ExperimentInitOptions, type ExperimentRowResult, type ExperimentRunWithResults, ExperimentsFacade, FetchPolicy, type GatewayBudget, type GatewayBudgetPage, GatewayBudgetsApiError, GatewayBudgetsApiService, type GetDatasetOptions, type GetPromptOptions, IDEMPOTENCY_KEY_HEADER, IDEMPOTENT_REPLAY_HEADER, type IdempotentCreateOptions, LangWatch, LangWatchApiError, type LangWatchFetch, LangWatchHandledError, LangWatchRedirectError, type ListDatasetsApiResponse, type ListDatasetsOptions, type ListRecordsApiResponse, type ListRecordsOptions, type ListTeamsResponse, type LogOptions, type MutationOptions, type PaginatedProjects, type PaginatedResponse, type Pagination, type Project, type ProjectWithServiceKey, ProjectsApiError, ProjectsApiService, type RunCallback, type RunContext, type RunOptions, type RunWithResultsOptions, type SpendEvent, type SpendEventStatus, SpendEventsApiError, SpendEventsApiService, type SpendEventsPage, type SpendFilterOptions, type SpendGroupBy, type SpendReplayResult, type SpendSummariesOptions, type SpendSummariesPage, type SpendSummaryRow, type SpendSummaryStatus, type TargetInfo, type TargetMetadata, TargetMetadataConflictError, type TargetType, type Team, type TeamMember, type TeamPagination, TeamsApiError, TeamsApiService, type UpdateDatasetOptions, type UpdateGatewayBudgetInput, type UpdateProjectInput, type UpdateVirtualKeyInput, type UpdateWebhookEndpointInput, type UploadResponse, type VerifyWebhookSignatureOptions, type VirtualKey, type VirtualKeyBudgetInput, type VirtualKeyPage, type VirtualKeyRoutingMode, type VirtualKeyScope, type VirtualKeyScopeType, type VirtualKeySpendSummary, type VirtualKeyWithSecret, VirtualKeysApiError, VirtualKeysApiService, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_SIGNATURE_DEFAULT_TOLERANCE_SECONDS, WEBHOOK_SIGNATURE_HEADER, type WebhookDeliveryPage, type WebhookDeliveryRecord, type WebhookEndpointHealth, type WebhookEndpointSummary, type WebhookEndpointWithSecret, type WebhookEventType, type WebhookSignatureFailureCode, WebhookSignatureVerificationError, type WebhookTestResult, WebhooksApiError, WebhooksApiService, createLangWatchFetch, isLangWatchHandledError, langwatchFetch, logger, verifyWebhookSignature };
|
|
3747
|
+
export { type ArchivedProject, type ArchivedTeam, type BatchCreateRecordsResponse, type BudgetOnBreach, type BudgetScopeKind, type BudgetWindow, ComparisonError, type ComparisonMetric, type ComparisonOptions, type ComparisonStatus, type ComparisonVerdict, type CreateDatasetOptions, type CreateEvaluatorBody, type CreateFromUploadResponse, type CreateGatewayBudgetInput, type CreateGatewayBudgetScope, type CreateLangWatchFetchOptions, type CreateProjectInput, type CreateVirtualKeyInput, type CreateWebhookEndpointInput, type Dataset, DatasetApiError, type DatasetColumnType, type DatasetEntry, DatasetError, type DatasetListItem, type DatasetMetadata, DatasetNotFoundError, DatasetPlanLimitError, type DatasetRecordResponse, DatasetValidationError, DatasetsFacade, type DeleteRecordsResponse, type EmittedEvent, type EmittedEventsPage, type EndUserCap, type EndUserSpend, type EvaluateOptions, type EvaluationCost, EvaluationError, type EvaluationResult, type EvaluationStatus, EvaluationsApiError, EvaluationsFacade, EvaluatorCallError, EvaluatorError, type EvaluatorField, EvaluatorNotFoundError, type EvaluatorResponse, EvaluatorsApiError, EvaluatorsApiService, Experiment, ExperimentApiError, type ExperimentConcurrencyOptions, ExperimentError, type ExperimentEvaluateOptions, type ExperimentEvaluationResult, type ExperimentEvaluationStatus, ExperimentInitError, type ExperimentInitOptions, type ExperimentRowResult, type ExperimentRunWithResults, ExperimentsFacade, FetchPolicy, type GatewayBudget, type GatewayBudgetPage, GatewayBudgetsApiError, GatewayBudgetsApiService, type GetDatasetOptions, type GetPromptOptions, IDEMPOTENCY_KEY_HEADER, IDEMPOTENT_REPLAY_HEADER, type IdempotentCreateOptions, LangWatch, LangWatchApiError, type LangWatchFetch, LangWatchHandledError, LangWatchRedirectError, type ListDatasetsApiResponse, type ListDatasetsOptions, type ListRecordsApiResponse, type ListRecordsOptions, type ListTeamsResponse, type LogOptions, type MutationOptions, type PaginatedProjects, type PaginatedResponse, type Pagination, type Project, type ProjectWithServiceKey, ProjectsApiError, ProjectsApiService, type RunCallback, type RunContext, type RunOptions, type RunWithResultsOptions, type SpendEvent, type SpendEventStatus, SpendEventsApiError, SpendEventsApiService, type SpendEventsPage, type SpendFilterOptions, type SpendGroupBy, type SpendReplayResult, type SpendSummariesOptions, type SpendSummariesPage, type SpendSummaryRow, type SpendSummaryStatus, type TargetInfo, type TargetMetadata, TargetMetadataConflictError, type TargetType, type Team, type TeamMember, type TeamPagination, TeamsApiError, TeamsApiService, type UpdateDatasetOptions, type UpdateGatewayBudgetInput, type UpdateProjectInput, type UpdateVirtualKeyInput, type UpdateWebhookEndpointInput, type UploadResponse, type VerifyWebhookSignatureOptions, type VirtualKey, type VirtualKeyBudgetInput, type VirtualKeyPage, type VirtualKeyRoutingMode, type VirtualKeyScope, type VirtualKeyScopeType, type VirtualKeySpendSummary, type VirtualKeyWithSecret, VirtualKeysApiError, VirtualKeysApiService, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_SIGNATURE_DEFAULT_TOLERANCE_SECONDS, WEBHOOK_SIGNATURE_HEADER, type WebhookDeliveryPage, type WebhookDeliveryRecord, type WebhookEndpointHealth, type WebhookEndpointSummary, type WebhookEndpointWithSecret, type WebhookEventType, type WebhookSignatureFailureCode, WebhookSignatureVerificationError, type WebhookTestResult, WebhooksApiError, WebhooksApiService, createLangWatchFetch, isLangWatchHandledError, langwatchFetch, logger, verifyWebhookSignature };
|