langwatch 1.9.0 → 1.11.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.d.mts +301 -0
- package/dist/agent/index.d.ts +301 -0
- package/dist/agent/index.js +1468 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/index.mjs +1424 -0
- package/dist/agent/index.mjs.map +1 -0
- package/dist/{chunk-NFFB3DWW.js → chunk-2PD3YA5H.js} +17 -6
- package/dist/chunk-2PD3YA5H.js.map +1 -0
- package/dist/{chunk-HUMHSRVP.js → chunk-AJDFFRSW.js} +12 -12
- package/dist/{chunk-HUMHSRVP.js.map → chunk-AJDFFRSW.js.map} +1 -1
- package/dist/{chunk-4XQHESU7.mjs → chunk-BS5CNZ5S.mjs} +17 -6
- package/dist/chunk-BS5CNZ5S.mjs.map +1 -0
- package/dist/{chunk-A52LX4C4.mjs → chunk-VMNKKJVI.mjs} +2 -2
- package/dist/cli/bundle.js +722 -379
- package/dist/{implementation-BvwOB77X.d.ts → implementation-D58yPTJW.d.ts} +1 -1
- package/dist/{implementation-C1F0eCHp.d.mts → implementation-aczLxVpV.d.mts} +1 -1
- package/dist/index.d.mts +166 -3
- package/dist/index.d.ts +166 -3
- package/dist/index.js +292 -60
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +261 -29
- 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 +2 -2
- package/dist/observability-sdk/index.mjs +1 -1
- 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.js +3 -3
- package/dist/observability-sdk/setup/node/index.mjs +2 -2
- package/dist/{types-C3NpCWi_.d.mts → types-BmMuUDrO.d.mts} +3858 -657
- package/dist/{types-jx13nj4M.d.ts → types-D_YNU-VL.d.ts} +3858 -657
- package/package.json +8 -1
- package/dist/chunk-4XQHESU7.mjs.map +0 -1
- package/dist/chunk-NFFB3DWW.js.map +0 -1
- /package/dist/{chunk-A52LX4C4.mjs.map → chunk-VMNKKJVI.mjs.map} +0 -0
|
@@ -4,7 +4,7 @@ import { ExportResult } from '@opentelemetry/core';
|
|
|
4
4
|
import { Logger, LogRecord, LoggerProvider } from '@opentelemetry/api-logs';
|
|
5
5
|
import { b as SemConvLogRecordAttributes, a as SemConvAttributes } from './types-VOZv9LYO.js';
|
|
6
6
|
import { TracerProvider } from '@opentelemetry/api';
|
|
7
|
-
import { j as LangWatchTracer } from './types-
|
|
7
|
+
import { j as LangWatchTracer } from './types-D_YNU-VL.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Filterable Batch Span Exporter for OpenTelemetry
|
|
@@ -4,7 +4,7 @@ import { ExportResult } from '@opentelemetry/core';
|
|
|
4
4
|
import { Logger, LogRecord, LoggerProvider } from '@opentelemetry/api-logs';
|
|
5
5
|
import { b as SemConvLogRecordAttributes, a as SemConvAttributes } from './types-VOZv9LYO.mjs';
|
|
6
6
|
import { TracerProvider } from '@opentelemetry/api';
|
|
7
|
-
import { j as LangWatchTracer } from './types-
|
|
7
|
+
import { j as LangWatchTracer } from './types-BmMuUDrO.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Filterable Batch Span Exporter for OpenTelemetry
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-aczLxVpV.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
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-
|
|
4
|
+
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-BmMuUDrO.mjs';
|
|
5
5
|
import openApiCreateClient from 'openapi-fetch';
|
|
6
6
|
export { l as attributes } from './types-VOZv9LYO.mjs';
|
|
7
7
|
import { CliHandledErrorReason, CliHandledError } from '@langwatch/langy/cards/handled-error';
|
|
@@ -1941,6 +1941,8 @@ type ScenarioResponse = NonNullable<paths["/api/scenarios"]["get"]["responses"][
|
|
|
1941
1941
|
type CreateScenarioBody = NonNullable<paths["/api/scenarios"]["post"]["requestBody"]>["content"]["application/json"];
|
|
1942
1942
|
type UpdateScenarioBody = NonNullable<paths["/api/scenarios/{id}"]["put"]["requestBody"]>["content"]["application/json"];
|
|
1943
1943
|
type DeleteScenarioResponse = paths["/api/scenarios/{id}"]["delete"]["responses"]["200"]["content"]["application/json"];
|
|
1944
|
+
type ScenarioVersionListResponse = paths["/api/scenarios/{id}/versions"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
1945
|
+
type ScenarioVersionDetail = paths["/api/scenarios/{id}/versions/{version}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
1944
1946
|
|
|
1945
1947
|
declare class ScenariosApiService {
|
|
1946
1948
|
private readonly apiClient;
|
|
@@ -1950,6 +1952,13 @@ declare class ScenariosApiService {
|
|
|
1950
1952
|
get(id: string): Promise<ScenarioResponse>;
|
|
1951
1953
|
create(params: CreateScenarioBody): Promise<ScenarioResponse>;
|
|
1952
1954
|
update(id: string, params: UpdateScenarioBody): Promise<ScenarioResponse>;
|
|
1955
|
+
/** The saved versions of a scenario, newest first. */
|
|
1956
|
+
listVersions(id: string, options?: {
|
|
1957
|
+
limit?: number;
|
|
1958
|
+
cursor?: number;
|
|
1959
|
+
}): Promise<ScenarioVersionListResponse>;
|
|
1960
|
+
/** One saved version of a scenario, with the content it saved. */
|
|
1961
|
+
getVersion(id: string, version: number): Promise<ScenarioVersionDetail>;
|
|
1953
1962
|
delete(id: string): Promise<DeleteScenarioResponse>;
|
|
1954
1963
|
}
|
|
1955
1964
|
|
|
@@ -1974,12 +1983,25 @@ interface SuiteRunOptions {
|
|
|
1974
1983
|
* that name.
|
|
1975
1984
|
*/
|
|
1976
1985
|
parameters?: Record<string, string | number | boolean>;
|
|
1986
|
+
/**
|
|
1987
|
+
* One short line saying why this batch was run, e.g. a commit hash or what
|
|
1988
|
+
* changed. Every run of the batch carries it. Spaces around it are removed,
|
|
1989
|
+
* and a note of only spaces is sent as no note at all.
|
|
1990
|
+
*/
|
|
1991
|
+
note?: string;
|
|
1977
1992
|
}
|
|
1993
|
+
/** Which kind of suite `getAll` returns. Defaults to run plans. */
|
|
1994
|
+
type SuiteKind = "custom" | "folder";
|
|
1995
|
+
/**
|
|
1996
|
+
* @deprecated Use runPlans and testSuites; /api/suites is a frozen alias.
|
|
1997
|
+
*/
|
|
1978
1998
|
declare class SuitesApiService {
|
|
1979
1999
|
private readonly apiClient;
|
|
1980
2000
|
constructor(config?: Pick<InternalConfig, "langwatchApiClient">);
|
|
1981
2001
|
private handleApiError;
|
|
1982
|
-
getAll(
|
|
2002
|
+
getAll(options?: {
|
|
2003
|
+
kind?: SuiteKind;
|
|
2004
|
+
}): Promise<SuiteResponse[]>;
|
|
1983
2005
|
get(id: string): Promise<SuiteResponse>;
|
|
1984
2006
|
create(params: CreateSuiteBody): Promise<SuiteResponse>;
|
|
1985
2007
|
update(id: string, params: UpdateSuiteBody): Promise<SuiteResponse>;
|
|
@@ -1996,6 +2018,93 @@ declare class SuitesApiService {
|
|
|
1996
2018
|
}>;
|
|
1997
2019
|
}
|
|
1998
2020
|
|
|
2021
|
+
/** One run plan, exactly as the REST surface answers it. */
|
|
2022
|
+
type RunPlan = paths["/api/v1/run-plans/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
2023
|
+
/** The body `POST /api/v1/run-plans/run` takes. */
|
|
2024
|
+
type RunPlanRunBody = NonNullable<paths["/api/v1/run-plans/run"]["post"]["requestBody"]>["content"]["application/json"];
|
|
2025
|
+
/** What a scheduled run answers with. */
|
|
2026
|
+
type RunPlanRunResult = paths["/api/v1/run-plans/run"]["post"]["responses"]["200"]["content"]["application/json"];
|
|
2027
|
+
/** The body `POST /api/v1/run-plans/{id}/run` takes. */
|
|
2028
|
+
type RunPlanRerunBody = NonNullable<paths["/api/v1/run-plans/{id}/run"]["post"]["requestBody"]>["content"]["application/json"];
|
|
2029
|
+
/**
|
|
2030
|
+
* Typed client for the run plan family (`/api/v1/run-plans`).
|
|
2031
|
+
*
|
|
2032
|
+
* A run plan is identified by its NAME. Posting a configuration under a name
|
|
2033
|
+
* already in use replaces that plan's configuration and joins its history;
|
|
2034
|
+
* posting under a new name creates the plan; posting no name lets the platform
|
|
2035
|
+
* derive one from what the run covers and what it runs against.
|
|
2036
|
+
*
|
|
2037
|
+
* @see specs/typescript-sdk/run-plans-and-test-suites.feature
|
|
2038
|
+
*/
|
|
2039
|
+
declare class RunPlansApiService {
|
|
2040
|
+
private readonly apiClient;
|
|
2041
|
+
constructor(config?: Pick<InternalConfig, "langwatchApiClient">);
|
|
2042
|
+
private handleApiError;
|
|
2043
|
+
/** The project's run plans. Archived plans are left out unless asked for. */
|
|
2044
|
+
list(options?: {
|
|
2045
|
+
includeArchived?: boolean;
|
|
2046
|
+
}): Promise<RunPlan[]>;
|
|
2047
|
+
get(id: string): Promise<RunPlan>;
|
|
2048
|
+
/**
|
|
2049
|
+
* Runs a configuration under a name.
|
|
2050
|
+
*
|
|
2051
|
+
* A note of only spaces is no note: sending an empty string would store a
|
|
2052
|
+
* value every reader then has to filter out.
|
|
2053
|
+
*/
|
|
2054
|
+
run(body: RunPlanRunBody): Promise<RunPlanRunResult>;
|
|
2055
|
+
/** Runs a plan again with the configuration it already holds. */
|
|
2056
|
+
rerun(id: string, body?: RunPlanRerunBody): Promise<RunPlanRunResult>;
|
|
2057
|
+
archive(id: string): Promise<{
|
|
2058
|
+
id: string;
|
|
2059
|
+
archived: true;
|
|
2060
|
+
}>;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
/** One test suite as the list answers it: a name and the scenarios filed in it. */
|
|
2064
|
+
type TestSuite = NonNullable<paths["/api/v1/test-suites"]["get"]["responses"]["200"]["content"]["application/json"]>[number];
|
|
2065
|
+
/** One test suite read on its own, with its scenarios named. */
|
|
2066
|
+
type TestSuiteDetail = paths["/api/v1/test-suites/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
2067
|
+
/** The body `POST /api/v1/test-suites` takes. */
|
|
2068
|
+
type CreateTestSuiteBody = NonNullable<paths["/api/v1/test-suites"]["post"]["requestBody"]>["content"]["application/json"];
|
|
2069
|
+
/** The body `PATCH /api/v1/test-suites/{id}` takes. */
|
|
2070
|
+
type RenameTestSuiteBody = NonNullable<paths["/api/v1/test-suites/{id}"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
2071
|
+
/** The body `POST /api/v1/test-suites/{id}/run` takes. */
|
|
2072
|
+
type RunTestSuiteBody = NonNullable<paths["/api/v1/test-suites/{id}/run"]["post"]["requestBody"]>["content"]["application/json"];
|
|
2073
|
+
/** What a scheduled suite run answers with. It is a run plan run. */
|
|
2074
|
+
type TestSuiteRunResult = RunPlanRunResult;
|
|
2075
|
+
/**
|
|
2076
|
+
* Typed client for the test suite family (`/api/v1/test-suites`).
|
|
2077
|
+
*
|
|
2078
|
+
* A test suite is a group of scenarios: a name, and the scenarios filed in it.
|
|
2079
|
+
* It holds no targets and no configuration, so running one sends its targets with
|
|
2080
|
+
* the request and the platform files the run under a run plan.
|
|
2081
|
+
*
|
|
2082
|
+
* @see specs/typescript-sdk/run-plans-and-test-suites.feature
|
|
2083
|
+
*/
|
|
2084
|
+
declare class TestSuitesApiService {
|
|
2085
|
+
private readonly apiClient;
|
|
2086
|
+
constructor(config?: Pick<InternalConfig, "langwatchApiClient">);
|
|
2087
|
+
private handleApiError;
|
|
2088
|
+
/** The project's test suites. Archived suites are left out unless asked for. */
|
|
2089
|
+
list(options?: {
|
|
2090
|
+
includeArchived?: boolean;
|
|
2091
|
+
}): Promise<TestSuite[]>;
|
|
2092
|
+
create(params: CreateTestSuiteBody): Promise<TestSuite>;
|
|
2093
|
+
get(id: string): Promise<TestSuiteDetail>;
|
|
2094
|
+
/** Renames a suite. The slug is kept, so links and run history stay put. */
|
|
2095
|
+
rename(id: string, params: RenameTestSuiteBody): Promise<TestSuite>;
|
|
2096
|
+
/** Archives a suite. The scenarios filed in it are archived with it. */
|
|
2097
|
+
archive(id: string): Promise<{
|
|
2098
|
+
id: string;
|
|
2099
|
+
archived: true;
|
|
2100
|
+
}>;
|
|
2101
|
+
/**
|
|
2102
|
+
* Runs every scenario filed in the suite against the targets sent with the
|
|
2103
|
+
* request. A note of only spaces is no note.
|
|
2104
|
+
*/
|
|
2105
|
+
run(id: string, body: RunTestSuiteBody): Promise<TestSuiteRunResult>;
|
|
2106
|
+
}
|
|
2107
|
+
|
|
1999
2108
|
type WorkflowResponse = NonNullable<paths["/api/workflows"]["get"]["responses"]["200"]["content"]["application/json"]>[number];
|
|
2000
2109
|
type WorkflowDeleteResponse = paths["/api/workflows/{id}"]["delete"]["responses"]["200"]["content"]["application/json"];
|
|
2001
2110
|
declare class WorkflowsApiService {
|
|
@@ -2037,6 +2146,23 @@ declare class WorkflowsApiService {
|
|
|
2037
2146
|
}): Promise<ExperimentRunWithResults>;
|
|
2038
2147
|
}
|
|
2039
2148
|
|
|
2149
|
+
/** One run parameter an agent declares, as the platform lists it. */
|
|
2150
|
+
interface AgentParameterSpec {
|
|
2151
|
+
name: string;
|
|
2152
|
+
type: "string" | "number" | "boolean";
|
|
2153
|
+
options?: string[];
|
|
2154
|
+
default?: string | number | boolean;
|
|
2155
|
+
description?: string;
|
|
2156
|
+
required?: boolean;
|
|
2157
|
+
secret?: boolean;
|
|
2158
|
+
}
|
|
2159
|
+
/** One process connected as an instance of a connected agent. */
|
|
2160
|
+
interface AgentInstance {
|
|
2161
|
+
id: string;
|
|
2162
|
+
hostname: string;
|
|
2163
|
+
label?: string | null;
|
|
2164
|
+
connectedAt: string;
|
|
2165
|
+
}
|
|
2040
2166
|
interface AgentResponse {
|
|
2041
2167
|
id: string;
|
|
2042
2168
|
name: string;
|
|
@@ -2045,6 +2171,20 @@ interface AgentResponse {
|
|
|
2045
2171
|
createdAt: string;
|
|
2046
2172
|
updatedAt: string;
|
|
2047
2173
|
platformUrl?: string;
|
|
2174
|
+
/** Connected agents: the environment the SDK registered under. */
|
|
2175
|
+
environment?: string | null;
|
|
2176
|
+
/** Connected agents: online while at least one instance is connected. */
|
|
2177
|
+
status?: "online" | "offline" | null;
|
|
2178
|
+
instances?: AgentInstance[];
|
|
2179
|
+
lastSeenAt?: string | null;
|
|
2180
|
+
/** The owner of a personal agent. */
|
|
2181
|
+
owner?: {
|
|
2182
|
+
userId: string;
|
|
2183
|
+
name: string;
|
|
2184
|
+
} | null;
|
|
2185
|
+
/** The machine a host-scoped development agent belongs to. */
|
|
2186
|
+
hostLabel?: string | null;
|
|
2187
|
+
parameters?: AgentParameterSpec[];
|
|
2048
2188
|
}
|
|
2049
2189
|
interface AgentListResponse {
|
|
2050
2190
|
data: AgentResponse[];
|
|
@@ -2055,6 +2195,12 @@ interface AgentListResponse {
|
|
|
2055
2195
|
totalPages: number;
|
|
2056
2196
|
};
|
|
2057
2197
|
}
|
|
2198
|
+
/** The body `POST /api/v1/agents/{id}/call` takes. */
|
|
2199
|
+
type AgentCallBody = NonNullable<paths["/api/v1/agents/{id}/call"]["post"]["requestBody"]>["content"]["application/json"];
|
|
2200
|
+
/** The reply of the relay: the function's output and the instance that ran it. */
|
|
2201
|
+
type AgentCallResponse = paths["/api/v1/agents/{id}/call"]["post"]["responses"][200]["content"]["application/json"];
|
|
2202
|
+
/** The ids `POST /api/v1/agents/{id}/test` answers with. */
|
|
2203
|
+
type AgentTestRunResponse = paths["/api/v1/agents/{id}/test"]["post"]["responses"][200]["content"]["application/json"];
|
|
2058
2204
|
declare class AgentsApiService {
|
|
2059
2205
|
private readonly apiClient;
|
|
2060
2206
|
constructor(config?: Pick<InternalConfig, "langwatchApiClient">);
|
|
@@ -2079,6 +2225,18 @@ declare class AgentsApiService {
|
|
|
2079
2225
|
id: string;
|
|
2080
2226
|
name: string;
|
|
2081
2227
|
}>;
|
|
2228
|
+
/**
|
|
2229
|
+
* Runs one turn of a connected agent through the relay: the platform
|
|
2230
|
+
* dispatches it to a live instance and answers with the function's output.
|
|
2231
|
+
*/
|
|
2232
|
+
call(id: string, body: AgentCallBody): Promise<AgentCallResponse>;
|
|
2233
|
+
/**
|
|
2234
|
+
* Runs one scripted scenario against an agent: the user sends "ping", the
|
|
2235
|
+
* agent answers, and the run succeeds when the answer arrives. The project
|
|
2236
|
+
* gains no scenario, run plan or test suite, and the answer carries the run
|
|
2237
|
+
* ids to follow.
|
|
2238
|
+
*/
|
|
2239
|
+
test(id: string): Promise<AgentTestRunResponse>;
|
|
2082
2240
|
}
|
|
2083
2241
|
|
|
2084
2242
|
type AnnotationResponse = components["schemas"]["Annotation"];
|
|
@@ -3654,7 +3812,12 @@ declare class LangWatch {
|
|
|
3654
3812
|
readonly evaluations: EvaluationsFacade;
|
|
3655
3813
|
readonly evaluators: EvaluatorsApiService;
|
|
3656
3814
|
readonly scenarios: ScenariosApiService;
|
|
3815
|
+
/**
|
|
3816
|
+
* @deprecated Use runPlans and testSuites; /api/suites is a frozen alias.
|
|
3817
|
+
*/
|
|
3657
3818
|
readonly suites: SuitesApiService;
|
|
3819
|
+
readonly runPlans: RunPlansApiService;
|
|
3820
|
+
readonly testSuites: TestSuitesApiService;
|
|
3658
3821
|
readonly workflows: WorkflowsApiService;
|
|
3659
3822
|
readonly agents: AgentsApiService;
|
|
3660
3823
|
readonly annotations: AnnotationsApiService;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-D58yPTJW.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
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-
|
|
4
|
+
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_YNU-VL.js';
|
|
5
5
|
import openApiCreateClient from 'openapi-fetch';
|
|
6
6
|
export { l as attributes } from './types-VOZv9LYO.js';
|
|
7
7
|
import { CliHandledErrorReason, CliHandledError } from '@langwatch/langy/cards/handled-error';
|
|
@@ -1941,6 +1941,8 @@ type ScenarioResponse = NonNullable<paths["/api/scenarios"]["get"]["responses"][
|
|
|
1941
1941
|
type CreateScenarioBody = NonNullable<paths["/api/scenarios"]["post"]["requestBody"]>["content"]["application/json"];
|
|
1942
1942
|
type UpdateScenarioBody = NonNullable<paths["/api/scenarios/{id}"]["put"]["requestBody"]>["content"]["application/json"];
|
|
1943
1943
|
type DeleteScenarioResponse = paths["/api/scenarios/{id}"]["delete"]["responses"]["200"]["content"]["application/json"];
|
|
1944
|
+
type ScenarioVersionListResponse = paths["/api/scenarios/{id}/versions"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
1945
|
+
type ScenarioVersionDetail = paths["/api/scenarios/{id}/versions/{version}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
1944
1946
|
|
|
1945
1947
|
declare class ScenariosApiService {
|
|
1946
1948
|
private readonly apiClient;
|
|
@@ -1950,6 +1952,13 @@ declare class ScenariosApiService {
|
|
|
1950
1952
|
get(id: string): Promise<ScenarioResponse>;
|
|
1951
1953
|
create(params: CreateScenarioBody): Promise<ScenarioResponse>;
|
|
1952
1954
|
update(id: string, params: UpdateScenarioBody): Promise<ScenarioResponse>;
|
|
1955
|
+
/** The saved versions of a scenario, newest first. */
|
|
1956
|
+
listVersions(id: string, options?: {
|
|
1957
|
+
limit?: number;
|
|
1958
|
+
cursor?: number;
|
|
1959
|
+
}): Promise<ScenarioVersionListResponse>;
|
|
1960
|
+
/** One saved version of a scenario, with the content it saved. */
|
|
1961
|
+
getVersion(id: string, version: number): Promise<ScenarioVersionDetail>;
|
|
1953
1962
|
delete(id: string): Promise<DeleteScenarioResponse>;
|
|
1954
1963
|
}
|
|
1955
1964
|
|
|
@@ -1974,12 +1983,25 @@ interface SuiteRunOptions {
|
|
|
1974
1983
|
* that name.
|
|
1975
1984
|
*/
|
|
1976
1985
|
parameters?: Record<string, string | number | boolean>;
|
|
1986
|
+
/**
|
|
1987
|
+
* One short line saying why this batch was run, e.g. a commit hash or what
|
|
1988
|
+
* changed. Every run of the batch carries it. Spaces around it are removed,
|
|
1989
|
+
* and a note of only spaces is sent as no note at all.
|
|
1990
|
+
*/
|
|
1991
|
+
note?: string;
|
|
1977
1992
|
}
|
|
1993
|
+
/** Which kind of suite `getAll` returns. Defaults to run plans. */
|
|
1994
|
+
type SuiteKind = "custom" | "folder";
|
|
1995
|
+
/**
|
|
1996
|
+
* @deprecated Use runPlans and testSuites; /api/suites is a frozen alias.
|
|
1997
|
+
*/
|
|
1978
1998
|
declare class SuitesApiService {
|
|
1979
1999
|
private readonly apiClient;
|
|
1980
2000
|
constructor(config?: Pick<InternalConfig, "langwatchApiClient">);
|
|
1981
2001
|
private handleApiError;
|
|
1982
|
-
getAll(
|
|
2002
|
+
getAll(options?: {
|
|
2003
|
+
kind?: SuiteKind;
|
|
2004
|
+
}): Promise<SuiteResponse[]>;
|
|
1983
2005
|
get(id: string): Promise<SuiteResponse>;
|
|
1984
2006
|
create(params: CreateSuiteBody): Promise<SuiteResponse>;
|
|
1985
2007
|
update(id: string, params: UpdateSuiteBody): Promise<SuiteResponse>;
|
|
@@ -1996,6 +2018,93 @@ declare class SuitesApiService {
|
|
|
1996
2018
|
}>;
|
|
1997
2019
|
}
|
|
1998
2020
|
|
|
2021
|
+
/** One run plan, exactly as the REST surface answers it. */
|
|
2022
|
+
type RunPlan = paths["/api/v1/run-plans/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
2023
|
+
/** The body `POST /api/v1/run-plans/run` takes. */
|
|
2024
|
+
type RunPlanRunBody = NonNullable<paths["/api/v1/run-plans/run"]["post"]["requestBody"]>["content"]["application/json"];
|
|
2025
|
+
/** What a scheduled run answers with. */
|
|
2026
|
+
type RunPlanRunResult = paths["/api/v1/run-plans/run"]["post"]["responses"]["200"]["content"]["application/json"];
|
|
2027
|
+
/** The body `POST /api/v1/run-plans/{id}/run` takes. */
|
|
2028
|
+
type RunPlanRerunBody = NonNullable<paths["/api/v1/run-plans/{id}/run"]["post"]["requestBody"]>["content"]["application/json"];
|
|
2029
|
+
/**
|
|
2030
|
+
* Typed client for the run plan family (`/api/v1/run-plans`).
|
|
2031
|
+
*
|
|
2032
|
+
* A run plan is identified by its NAME. Posting a configuration under a name
|
|
2033
|
+
* already in use replaces that plan's configuration and joins its history;
|
|
2034
|
+
* posting under a new name creates the plan; posting no name lets the platform
|
|
2035
|
+
* derive one from what the run covers and what it runs against.
|
|
2036
|
+
*
|
|
2037
|
+
* @see specs/typescript-sdk/run-plans-and-test-suites.feature
|
|
2038
|
+
*/
|
|
2039
|
+
declare class RunPlansApiService {
|
|
2040
|
+
private readonly apiClient;
|
|
2041
|
+
constructor(config?: Pick<InternalConfig, "langwatchApiClient">);
|
|
2042
|
+
private handleApiError;
|
|
2043
|
+
/** The project's run plans. Archived plans are left out unless asked for. */
|
|
2044
|
+
list(options?: {
|
|
2045
|
+
includeArchived?: boolean;
|
|
2046
|
+
}): Promise<RunPlan[]>;
|
|
2047
|
+
get(id: string): Promise<RunPlan>;
|
|
2048
|
+
/**
|
|
2049
|
+
* Runs a configuration under a name.
|
|
2050
|
+
*
|
|
2051
|
+
* A note of only spaces is no note: sending an empty string would store a
|
|
2052
|
+
* value every reader then has to filter out.
|
|
2053
|
+
*/
|
|
2054
|
+
run(body: RunPlanRunBody): Promise<RunPlanRunResult>;
|
|
2055
|
+
/** Runs a plan again with the configuration it already holds. */
|
|
2056
|
+
rerun(id: string, body?: RunPlanRerunBody): Promise<RunPlanRunResult>;
|
|
2057
|
+
archive(id: string): Promise<{
|
|
2058
|
+
id: string;
|
|
2059
|
+
archived: true;
|
|
2060
|
+
}>;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
/** One test suite as the list answers it: a name and the scenarios filed in it. */
|
|
2064
|
+
type TestSuite = NonNullable<paths["/api/v1/test-suites"]["get"]["responses"]["200"]["content"]["application/json"]>[number];
|
|
2065
|
+
/** One test suite read on its own, with its scenarios named. */
|
|
2066
|
+
type TestSuiteDetail = paths["/api/v1/test-suites/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
2067
|
+
/** The body `POST /api/v1/test-suites` takes. */
|
|
2068
|
+
type CreateTestSuiteBody = NonNullable<paths["/api/v1/test-suites"]["post"]["requestBody"]>["content"]["application/json"];
|
|
2069
|
+
/** The body `PATCH /api/v1/test-suites/{id}` takes. */
|
|
2070
|
+
type RenameTestSuiteBody = NonNullable<paths["/api/v1/test-suites/{id}"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
2071
|
+
/** The body `POST /api/v1/test-suites/{id}/run` takes. */
|
|
2072
|
+
type RunTestSuiteBody = NonNullable<paths["/api/v1/test-suites/{id}/run"]["post"]["requestBody"]>["content"]["application/json"];
|
|
2073
|
+
/** What a scheduled suite run answers with. It is a run plan run. */
|
|
2074
|
+
type TestSuiteRunResult = RunPlanRunResult;
|
|
2075
|
+
/**
|
|
2076
|
+
* Typed client for the test suite family (`/api/v1/test-suites`).
|
|
2077
|
+
*
|
|
2078
|
+
* A test suite is a group of scenarios: a name, and the scenarios filed in it.
|
|
2079
|
+
* It holds no targets and no configuration, so running one sends its targets with
|
|
2080
|
+
* the request and the platform files the run under a run plan.
|
|
2081
|
+
*
|
|
2082
|
+
* @see specs/typescript-sdk/run-plans-and-test-suites.feature
|
|
2083
|
+
*/
|
|
2084
|
+
declare class TestSuitesApiService {
|
|
2085
|
+
private readonly apiClient;
|
|
2086
|
+
constructor(config?: Pick<InternalConfig, "langwatchApiClient">);
|
|
2087
|
+
private handleApiError;
|
|
2088
|
+
/** The project's test suites. Archived suites are left out unless asked for. */
|
|
2089
|
+
list(options?: {
|
|
2090
|
+
includeArchived?: boolean;
|
|
2091
|
+
}): Promise<TestSuite[]>;
|
|
2092
|
+
create(params: CreateTestSuiteBody): Promise<TestSuite>;
|
|
2093
|
+
get(id: string): Promise<TestSuiteDetail>;
|
|
2094
|
+
/** Renames a suite. The slug is kept, so links and run history stay put. */
|
|
2095
|
+
rename(id: string, params: RenameTestSuiteBody): Promise<TestSuite>;
|
|
2096
|
+
/** Archives a suite. The scenarios filed in it are archived with it. */
|
|
2097
|
+
archive(id: string): Promise<{
|
|
2098
|
+
id: string;
|
|
2099
|
+
archived: true;
|
|
2100
|
+
}>;
|
|
2101
|
+
/**
|
|
2102
|
+
* Runs every scenario filed in the suite against the targets sent with the
|
|
2103
|
+
* request. A note of only spaces is no note.
|
|
2104
|
+
*/
|
|
2105
|
+
run(id: string, body: RunTestSuiteBody): Promise<TestSuiteRunResult>;
|
|
2106
|
+
}
|
|
2107
|
+
|
|
1999
2108
|
type WorkflowResponse = NonNullable<paths["/api/workflows"]["get"]["responses"]["200"]["content"]["application/json"]>[number];
|
|
2000
2109
|
type WorkflowDeleteResponse = paths["/api/workflows/{id}"]["delete"]["responses"]["200"]["content"]["application/json"];
|
|
2001
2110
|
declare class WorkflowsApiService {
|
|
@@ -2037,6 +2146,23 @@ declare class WorkflowsApiService {
|
|
|
2037
2146
|
}): Promise<ExperimentRunWithResults>;
|
|
2038
2147
|
}
|
|
2039
2148
|
|
|
2149
|
+
/** One run parameter an agent declares, as the platform lists it. */
|
|
2150
|
+
interface AgentParameterSpec {
|
|
2151
|
+
name: string;
|
|
2152
|
+
type: "string" | "number" | "boolean";
|
|
2153
|
+
options?: string[];
|
|
2154
|
+
default?: string | number | boolean;
|
|
2155
|
+
description?: string;
|
|
2156
|
+
required?: boolean;
|
|
2157
|
+
secret?: boolean;
|
|
2158
|
+
}
|
|
2159
|
+
/** One process connected as an instance of a connected agent. */
|
|
2160
|
+
interface AgentInstance {
|
|
2161
|
+
id: string;
|
|
2162
|
+
hostname: string;
|
|
2163
|
+
label?: string | null;
|
|
2164
|
+
connectedAt: string;
|
|
2165
|
+
}
|
|
2040
2166
|
interface AgentResponse {
|
|
2041
2167
|
id: string;
|
|
2042
2168
|
name: string;
|
|
@@ -2045,6 +2171,20 @@ interface AgentResponse {
|
|
|
2045
2171
|
createdAt: string;
|
|
2046
2172
|
updatedAt: string;
|
|
2047
2173
|
platformUrl?: string;
|
|
2174
|
+
/** Connected agents: the environment the SDK registered under. */
|
|
2175
|
+
environment?: string | null;
|
|
2176
|
+
/** Connected agents: online while at least one instance is connected. */
|
|
2177
|
+
status?: "online" | "offline" | null;
|
|
2178
|
+
instances?: AgentInstance[];
|
|
2179
|
+
lastSeenAt?: string | null;
|
|
2180
|
+
/** The owner of a personal agent. */
|
|
2181
|
+
owner?: {
|
|
2182
|
+
userId: string;
|
|
2183
|
+
name: string;
|
|
2184
|
+
} | null;
|
|
2185
|
+
/** The machine a host-scoped development agent belongs to. */
|
|
2186
|
+
hostLabel?: string | null;
|
|
2187
|
+
parameters?: AgentParameterSpec[];
|
|
2048
2188
|
}
|
|
2049
2189
|
interface AgentListResponse {
|
|
2050
2190
|
data: AgentResponse[];
|
|
@@ -2055,6 +2195,12 @@ interface AgentListResponse {
|
|
|
2055
2195
|
totalPages: number;
|
|
2056
2196
|
};
|
|
2057
2197
|
}
|
|
2198
|
+
/** The body `POST /api/v1/agents/{id}/call` takes. */
|
|
2199
|
+
type AgentCallBody = NonNullable<paths["/api/v1/agents/{id}/call"]["post"]["requestBody"]>["content"]["application/json"];
|
|
2200
|
+
/** The reply of the relay: the function's output and the instance that ran it. */
|
|
2201
|
+
type AgentCallResponse = paths["/api/v1/agents/{id}/call"]["post"]["responses"][200]["content"]["application/json"];
|
|
2202
|
+
/** The ids `POST /api/v1/agents/{id}/test` answers with. */
|
|
2203
|
+
type AgentTestRunResponse = paths["/api/v1/agents/{id}/test"]["post"]["responses"][200]["content"]["application/json"];
|
|
2058
2204
|
declare class AgentsApiService {
|
|
2059
2205
|
private readonly apiClient;
|
|
2060
2206
|
constructor(config?: Pick<InternalConfig, "langwatchApiClient">);
|
|
@@ -2079,6 +2225,18 @@ declare class AgentsApiService {
|
|
|
2079
2225
|
id: string;
|
|
2080
2226
|
name: string;
|
|
2081
2227
|
}>;
|
|
2228
|
+
/**
|
|
2229
|
+
* Runs one turn of a connected agent through the relay: the platform
|
|
2230
|
+
* dispatches it to a live instance and answers with the function's output.
|
|
2231
|
+
*/
|
|
2232
|
+
call(id: string, body: AgentCallBody): Promise<AgentCallResponse>;
|
|
2233
|
+
/**
|
|
2234
|
+
* Runs one scripted scenario against an agent: the user sends "ping", the
|
|
2235
|
+
* agent answers, and the run succeeds when the answer arrives. The project
|
|
2236
|
+
* gains no scenario, run plan or test suite, and the answer carries the run
|
|
2237
|
+
* ids to follow.
|
|
2238
|
+
*/
|
|
2239
|
+
test(id: string): Promise<AgentTestRunResponse>;
|
|
2082
2240
|
}
|
|
2083
2241
|
|
|
2084
2242
|
type AnnotationResponse = components["schemas"]["Annotation"];
|
|
@@ -3654,7 +3812,12 @@ declare class LangWatch {
|
|
|
3654
3812
|
readonly evaluations: EvaluationsFacade;
|
|
3655
3813
|
readonly evaluators: EvaluatorsApiService;
|
|
3656
3814
|
readonly scenarios: ScenariosApiService;
|
|
3815
|
+
/**
|
|
3816
|
+
* @deprecated Use runPlans and testSuites; /api/suites is a frozen alias.
|
|
3817
|
+
*/
|
|
3657
3818
|
readonly suites: SuitesApiService;
|
|
3819
|
+
readonly runPlans: RunPlansApiService;
|
|
3820
|
+
readonly testSuites: TestSuitesApiService;
|
|
3658
3821
|
readonly workflows: WorkflowsApiService;
|
|
3659
3822
|
readonly agents: AgentsApiService;
|
|
3660
3823
|
readonly annotations: AnnotationsApiService;
|