langwatch 2.2.0 → 2.3.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/{types-RkiBQZ9j.d.mts → braid-baggage-span-processor-CBNdRYKr.d.mts} +28 -1
- package/dist/{types-RkiBQZ9j.d.ts → braid-baggage-span-processor-CBNdRYKr.d.ts} +28 -1
- package/dist/{chunk-OAAGWSLX.mjs → chunk-5TNHAT3S.mjs} +101 -4
- package/dist/chunk-5TNHAT3S.mjs.map +1 -0
- package/dist/{chunk-TQJS5H5P.js → chunk-FQJHCT5Y.js} +111 -14
- package/dist/chunk-FQJHCT5Y.js.map +1 -0
- package/dist/{chunk-PDTYQM5C.js → chunk-HWKTHOMP.js} +58 -3
- package/dist/chunk-HWKTHOMP.js.map +1 -0
- package/dist/{chunk-P65KWWFU.mjs → chunk-IMUFSW7Z.mjs} +58 -3
- package/dist/chunk-IMUFSW7Z.mjs.map +1 -0
- package/dist/{chunk-XQ4CP2JK.mjs → chunk-MCWJ3AWF.mjs} +1 -1
- package/dist/{chunk-WDUUAIG3.js → chunk-PDYPOYVZ.js} +1 -1
- package/dist/{chunk-WDUUAIG3.js.map → chunk-PDYPOYVZ.js.map} +1 -1
- package/dist/cli/bundle.js +691 -421
- package/dist/{implementation-CaKFOMnp.d.ts → implementation-BparHh-q.d.ts} +1 -1
- package/dist/{implementation-CMJfitMa.d.mts → implementation-CrBgn1V6.d.mts} +1 -1
- package/dist/index.d.mts +47 -4
- package/dist/index.d.ts +47 -4
- package/dist/index.js +168 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +138 -8
- package/dist/index.mjs.map +1 -1
- package/dist/observability-sdk/index.d.mts +27 -6
- package/dist/observability-sdk/index.d.ts +27 -6
- package/dist/observability-sdk/index.js +13 -3
- package/dist/observability-sdk/index.js.map +1 -1
- package/dist/observability-sdk/index.mjs +12 -2
- 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/setup/node/index.d.mts +39 -3
- package/dist/observability-sdk/setup/node/index.d.ts +39 -3
- package/dist/observability-sdk/setup/node/index.js +9 -3
- package/dist/observability-sdk/setup/node/index.js.map +1 -1
- package/dist/observability-sdk/setup/node/index.mjs +10 -4
- package/dist/{types-0leNdzy4.d.ts → types-BXcB5Uov.d.ts} +255 -12
- package/dist/{types-DNjiOkpS.d.mts → types-D_MsVA5r.d.mts} +255 -12
- package/package.json +1 -1
- package/dist/chunk-OAAGWSLX.mjs.map +0 -1
- package/dist/chunk-P65KWWFU.mjs.map +0 -1
- package/dist/chunk-PDTYQM5C.js.map +0 -1
- package/dist/chunk-TQJS5H5P.js.map +0 -1
- /package/dist/{chunk-XQ4CP2JK.mjs.map → chunk-MCWJ3AWF.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.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-BXcB5Uov.js';
|
|
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.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-D_MsVA5r.mjs';
|
|
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-CrBgn1V6.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-D_MsVA5r.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';
|
|
@@ -522,6 +522,23 @@ type CreateDatasetOptions = {
|
|
|
522
522
|
name: string;
|
|
523
523
|
/** Column type definitions (defaults to empty array) */
|
|
524
524
|
columnTypes?: DatasetColumnType[];
|
|
525
|
+
/** First rows, written with the dataset in one request. Each key must be a column. */
|
|
526
|
+
entries?: Record<string, unknown>[];
|
|
527
|
+
};
|
|
528
|
+
/**
|
|
529
|
+
* Options for upserting records by a key column.
|
|
530
|
+
*/
|
|
531
|
+
type UpsertRecordsOptions = {
|
|
532
|
+
/** The column that identifies a row, such as "case_id". */
|
|
533
|
+
key: string;
|
|
534
|
+
};
|
|
535
|
+
/**
|
|
536
|
+
* Result of upserting records: what was created, what was updated, how many were left alone.
|
|
537
|
+
*/
|
|
538
|
+
type UpsertRecordsResult = {
|
|
539
|
+
created: DatasetRecordResponse[];
|
|
540
|
+
updated: DatasetRecordResponse[];
|
|
541
|
+
unchanged: number;
|
|
525
542
|
};
|
|
526
543
|
/**
|
|
527
544
|
* Options for updating a dataset.
|
|
@@ -650,6 +667,15 @@ declare class DatasetsFacade {
|
|
|
650
667
|
* @returns The updated record
|
|
651
668
|
*/
|
|
652
669
|
updateRecord: (slugOrId: string, recordId: string, entry: Record<string, unknown>) => Promise<DatasetRecordResponse>;
|
|
670
|
+
/**
|
|
671
|
+
* Upserts rows matched on a key column: a known key updates in place (columns left out are
|
|
672
|
+
* kept), a new key adds a row, and an unchanged row is not written, so a rerun writes nothing.
|
|
673
|
+
* @param slugOrId - The slug or ID of the dataset
|
|
674
|
+
* @param entries - The rows to upsert; each must hold the key column
|
|
675
|
+
* @param options - The key column that identifies a row, such as "case_id"
|
|
676
|
+
* @returns The created and updated records and the number of rows left unchanged
|
|
677
|
+
*/
|
|
678
|
+
upsertRecords: (slugOrId: string, entries: Record<string, unknown>[], options: UpsertRecordsOptions) => Promise<UpsertRecordsResult>;
|
|
653
679
|
/**
|
|
654
680
|
* Deletes records from a dataset by IDs.
|
|
655
681
|
* @param slugOrId - The slug or ID of the dataset
|
|
@@ -706,8 +732,12 @@ declare class DatasetApiError extends DatasetError {
|
|
|
706
732
|
* Distinguished from DatasetApiError which represents server-side errors.
|
|
707
733
|
*/
|
|
708
734
|
declare class DatasetValidationError extends DatasetError {
|
|
709
|
-
|
|
735
|
+
/** Stable code for refusals a caller may branch on; the message may change. */
|
|
736
|
+
readonly code?: DatasetValidationCode;
|
|
737
|
+
constructor(message: string, code?: DatasetValidationCode);
|
|
710
738
|
}
|
|
739
|
+
/** Codes an upsert refusal carries. */
|
|
740
|
+
type DatasetValidationCode = "missing_upsert_key" | "duplicate_upsert_key" | "dataset_has_duplicate_key";
|
|
711
741
|
/**
|
|
712
742
|
* Thrown when a dataset operation exceeds the plan limit (403).
|
|
713
743
|
* The message includes the upgrade/subscription URL from the server.
|
|
@@ -1737,6 +1767,12 @@ declare class InstantEvalsApiService {
|
|
|
1737
1767
|
|
|
1738
1768
|
/** One test suite as the list answers it: a name and the scenarios filed in it. */
|
|
1739
1769
|
type TestSuite = NonNullable<paths["/api/v1/test-suites"]["get"]["responses"]["200"]["content"]["application/json"]>[number];
|
|
1770
|
+
/** One suite template as `GET /api/v1/test-suites/templates` answers it. */
|
|
1771
|
+
type SuiteTemplate = NonNullable<paths["/api/v1/test-suites/templates"]["get"]["responses"]["200"]["content"]["application/json"]>[number];
|
|
1772
|
+
/** The body `POST /api/v1/test-suites/templates/{templateId}/apply` takes. */
|
|
1773
|
+
type ApplySuiteTemplateBody = NonNullable<paths["/api/v1/test-suites/templates/{templateId}/apply"]["post"]["requestBody"]>["content"]["application/json"];
|
|
1774
|
+
/** The suite and scenarios a template apply created. */
|
|
1775
|
+
type AppliedSuiteTemplate = paths["/api/v1/test-suites/templates/{templateId}/apply"]["post"]["responses"]["201"]["content"]["application/json"];
|
|
1740
1776
|
/** One test suite read on its own, with its scenarios named. */
|
|
1741
1777
|
type TestSuiteDetail = paths["/api/v1/test-suites/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
1742
1778
|
/** The body `POST /api/v1/test-suites` takes. */
|
|
@@ -1784,6 +1820,13 @@ declare class TestSuitesApiService {
|
|
|
1784
1820
|
* request. A note of only spaces is no note.
|
|
1785
1821
|
*/
|
|
1786
1822
|
run(id: string, body: RunTestSuiteBody): Promise<TestSuiteRunResult>;
|
|
1823
|
+
/** Lists the suite templates that ship with LangWatch, scenarios included. */
|
|
1824
|
+
listTemplates(): Promise<SuiteTemplate[]>;
|
|
1825
|
+
/** Creates a test suite from a template, fitted to the agent under test. */
|
|
1826
|
+
applyTemplate({ templateId, body, }: {
|
|
1827
|
+
templateId: string;
|
|
1828
|
+
body: ApplySuiteTemplateBody;
|
|
1829
|
+
}): Promise<AppliedSuiteTemplate>;
|
|
1787
1830
|
}
|
|
1788
1831
|
|
|
1789
1832
|
type WorkflowResponse = NonNullable<paths["/api/v1/workflows"]["get"]["responses"]["200"]["content"]["application/json"]>[number];
|
|
@@ -3744,4 +3787,4 @@ declare const logger: {
|
|
|
3744
3787
|
NoOpLogger: typeof NoOpLogger;
|
|
3745
3788
|
};
|
|
3746
3789
|
|
|
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 };
|
|
3790
|
+
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, type DatasetValidationCode, 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 UpsertRecordsOptions, type UpsertRecordsResult, 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-BparHh-q.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-BXcB5Uov.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';
|
|
@@ -522,6 +522,23 @@ type CreateDatasetOptions = {
|
|
|
522
522
|
name: string;
|
|
523
523
|
/** Column type definitions (defaults to empty array) */
|
|
524
524
|
columnTypes?: DatasetColumnType[];
|
|
525
|
+
/** First rows, written with the dataset in one request. Each key must be a column. */
|
|
526
|
+
entries?: Record<string, unknown>[];
|
|
527
|
+
};
|
|
528
|
+
/**
|
|
529
|
+
* Options for upserting records by a key column.
|
|
530
|
+
*/
|
|
531
|
+
type UpsertRecordsOptions = {
|
|
532
|
+
/** The column that identifies a row, such as "case_id". */
|
|
533
|
+
key: string;
|
|
534
|
+
};
|
|
535
|
+
/**
|
|
536
|
+
* Result of upserting records: what was created, what was updated, how many were left alone.
|
|
537
|
+
*/
|
|
538
|
+
type UpsertRecordsResult = {
|
|
539
|
+
created: DatasetRecordResponse[];
|
|
540
|
+
updated: DatasetRecordResponse[];
|
|
541
|
+
unchanged: number;
|
|
525
542
|
};
|
|
526
543
|
/**
|
|
527
544
|
* Options for updating a dataset.
|
|
@@ -650,6 +667,15 @@ declare class DatasetsFacade {
|
|
|
650
667
|
* @returns The updated record
|
|
651
668
|
*/
|
|
652
669
|
updateRecord: (slugOrId: string, recordId: string, entry: Record<string, unknown>) => Promise<DatasetRecordResponse>;
|
|
670
|
+
/**
|
|
671
|
+
* Upserts rows matched on a key column: a known key updates in place (columns left out are
|
|
672
|
+
* kept), a new key adds a row, and an unchanged row is not written, so a rerun writes nothing.
|
|
673
|
+
* @param slugOrId - The slug or ID of the dataset
|
|
674
|
+
* @param entries - The rows to upsert; each must hold the key column
|
|
675
|
+
* @param options - The key column that identifies a row, such as "case_id"
|
|
676
|
+
* @returns The created and updated records and the number of rows left unchanged
|
|
677
|
+
*/
|
|
678
|
+
upsertRecords: (slugOrId: string, entries: Record<string, unknown>[], options: UpsertRecordsOptions) => Promise<UpsertRecordsResult>;
|
|
653
679
|
/**
|
|
654
680
|
* Deletes records from a dataset by IDs.
|
|
655
681
|
* @param slugOrId - The slug or ID of the dataset
|
|
@@ -706,8 +732,12 @@ declare class DatasetApiError extends DatasetError {
|
|
|
706
732
|
* Distinguished from DatasetApiError which represents server-side errors.
|
|
707
733
|
*/
|
|
708
734
|
declare class DatasetValidationError extends DatasetError {
|
|
709
|
-
|
|
735
|
+
/** Stable code for refusals a caller may branch on; the message may change. */
|
|
736
|
+
readonly code?: DatasetValidationCode;
|
|
737
|
+
constructor(message: string, code?: DatasetValidationCode);
|
|
710
738
|
}
|
|
739
|
+
/** Codes an upsert refusal carries. */
|
|
740
|
+
type DatasetValidationCode = "missing_upsert_key" | "duplicate_upsert_key" | "dataset_has_duplicate_key";
|
|
711
741
|
/**
|
|
712
742
|
* Thrown when a dataset operation exceeds the plan limit (403).
|
|
713
743
|
* The message includes the upgrade/subscription URL from the server.
|
|
@@ -1737,6 +1767,12 @@ declare class InstantEvalsApiService {
|
|
|
1737
1767
|
|
|
1738
1768
|
/** One test suite as the list answers it: a name and the scenarios filed in it. */
|
|
1739
1769
|
type TestSuite = NonNullable<paths["/api/v1/test-suites"]["get"]["responses"]["200"]["content"]["application/json"]>[number];
|
|
1770
|
+
/** One suite template as `GET /api/v1/test-suites/templates` answers it. */
|
|
1771
|
+
type SuiteTemplate = NonNullable<paths["/api/v1/test-suites/templates"]["get"]["responses"]["200"]["content"]["application/json"]>[number];
|
|
1772
|
+
/** The body `POST /api/v1/test-suites/templates/{templateId}/apply` takes. */
|
|
1773
|
+
type ApplySuiteTemplateBody = NonNullable<paths["/api/v1/test-suites/templates/{templateId}/apply"]["post"]["requestBody"]>["content"]["application/json"];
|
|
1774
|
+
/** The suite and scenarios a template apply created. */
|
|
1775
|
+
type AppliedSuiteTemplate = paths["/api/v1/test-suites/templates/{templateId}/apply"]["post"]["responses"]["201"]["content"]["application/json"];
|
|
1740
1776
|
/** One test suite read on its own, with its scenarios named. */
|
|
1741
1777
|
type TestSuiteDetail = paths["/api/v1/test-suites/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
1742
1778
|
/** The body `POST /api/v1/test-suites` takes. */
|
|
@@ -1784,6 +1820,13 @@ declare class TestSuitesApiService {
|
|
|
1784
1820
|
* request. A note of only spaces is no note.
|
|
1785
1821
|
*/
|
|
1786
1822
|
run(id: string, body: RunTestSuiteBody): Promise<TestSuiteRunResult>;
|
|
1823
|
+
/** Lists the suite templates that ship with LangWatch, scenarios included. */
|
|
1824
|
+
listTemplates(): Promise<SuiteTemplate[]>;
|
|
1825
|
+
/** Creates a test suite from a template, fitted to the agent under test. */
|
|
1826
|
+
applyTemplate({ templateId, body, }: {
|
|
1827
|
+
templateId: string;
|
|
1828
|
+
body: ApplySuiteTemplateBody;
|
|
1829
|
+
}): Promise<AppliedSuiteTemplate>;
|
|
1787
1830
|
}
|
|
1788
1831
|
|
|
1789
1832
|
type WorkflowResponse = NonNullable<paths["/api/v1/workflows"]["get"]["responses"]["200"]["content"]["application/json"]>[number];
|
|
@@ -3744,4 +3787,4 @@ declare const logger: {
|
|
|
3744
3787
|
NoOpLogger: typeof NoOpLogger;
|
|
3745
3788
|
};
|
|
3746
3789
|
|
|
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 };
|
|
3790
|
+
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, type DatasetValidationCode, 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 UpsertRecordsOptions, type UpsertRecordsResult, 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 };
|