langwatch 1.15.0 → 1.16.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-ZI7OXROR.js → chunk-6SSJPQAW.js} +2 -2
- package/dist/{chunk-ZI7OXROR.js.map → chunk-6SSJPQAW.js.map} +1 -1
- package/dist/{chunk-Y6NVAU6Z.js → chunk-FUDF46YW.js} +12 -12
- package/dist/{chunk-Y6NVAU6Z.js.map → chunk-FUDF46YW.js.map} +1 -1
- package/dist/{chunk-ZKNCPK33.mjs → chunk-NZP72HTX.mjs} +2 -2
- package/dist/{chunk-ZKNCPK33.mjs.map → chunk-NZP72HTX.mjs.map} +1 -1
- package/dist/{chunk-GWMU6OA4.mjs → chunk-XC6AXWVR.mjs} +2 -2
- package/dist/cli/bundle.js +327 -294
- package/dist/{implementation-BioGaCjm.d.mts → implementation-BvHTdJLg.d.mts} +1 -1
- package/dist/{implementation-BYM7X0I8.d.ts → implementation-Dlxw5hlM.d.ts} +1 -1
- package/dist/index.d.mts +116 -7
- package/dist/index.d.ts +116 -7
- package/dist/index.js +205 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +174 -9
- 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-BJwkO7NN.d.ts → types-CzElA_6o.d.ts} +1421 -247
- package/dist/{types-eq6Fz5Oj.d.mts → types-Dd2d9hCy.d.mts} +1421 -247
- package/package.json +1 -1
- /package/dist/{chunk-GWMU6OA4.mjs.map → chunk-XC6AXWVR.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var _chunkO4J3ZPZYjs = require('./chunk-O4J3ZPZY.js');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkFUDF46YWjs = require('./chunk-FUDF46YW.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -20,7 +20,7 @@ var _chunkY6NVAU6Zjs = require('./chunk-Y6NVAU6Z.js');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunk6SSJPQAWjs = require('./chunk-6SSJPQAW.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -329,7 +329,7 @@ var PromptServiceTracingDecorator = class {
|
|
|
329
329
|
};
|
|
330
330
|
|
|
331
331
|
// src/client-sdk/services/prompts/tracing/tracer.ts
|
|
332
|
-
var tracer = _chunkO4J3ZPZYjs.getLangWatchTracer.call(void 0, `${
|
|
332
|
+
var tracer = _chunkO4J3ZPZYjs.getLangWatchTracer.call(void 0, `${_chunk6SSJPQAWjs.LANGWATCH_SDK_NAME_CLIENT}.prompts`, _chunk6SSJPQAWjs.LANGWATCH_SDK_VERSION);
|
|
333
333
|
|
|
334
334
|
// src/client-sdk/tracing/create-tracing-proxy.ts
|
|
335
335
|
var _api = require('@opentelemetry/api');
|
|
@@ -884,15 +884,15 @@ var handledErrorMiddleware = {
|
|
|
884
884
|
};
|
|
885
885
|
var createLangWatchApiClient = (apiKey = ((_b) => (_b = ((_a) => (_a = scopedApiKey()) != null ? _a : process.env.LANGWATCH_API_KEY)()) != null ? _b : "")(), endpoint, projectId = ((_c) => (_c = scopedProjectId()) != null ? _c : process.env.LANGWATCH_PROJECT_ID)()) => {
|
|
886
886
|
const client = _openapifetch2.default.call(void 0, {
|
|
887
|
-
baseUrl:
|
|
887
|
+
baseUrl: _chunkFUDF46YWjs.resolveEndpoint.call(void 0, endpoint),
|
|
888
888
|
fetch: langwatchFetch,
|
|
889
|
-
headers: _chunkLCG5Y2EGjs.__spreadProps.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {},
|
|
889
|
+
headers: _chunkLCG5Y2EGjs.__spreadProps.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {}, _chunk6SSJPQAWjs.buildAuthHeaders.call(void 0, { apiKey, projectId })), {
|
|
890
890
|
"content-type": "application/json",
|
|
891
|
-
"user-agent": `langwatch-sdk-node/${
|
|
892
|
-
"x-langwatch-sdk-name":
|
|
893
|
-
"x-langwatch-sdk-language":
|
|
894
|
-
"x-langwatch-sdk-version":
|
|
895
|
-
"x-langwatch-sdk-platform":
|
|
891
|
+
"user-agent": `langwatch-sdk-node/${_chunk6SSJPQAWjs.version}`,
|
|
892
|
+
"x-langwatch-sdk-name": _chunk6SSJPQAWjs.LANGWATCH_SDK_NAME_OBSERVABILITY,
|
|
893
|
+
"x-langwatch-sdk-language": _chunk6SSJPQAWjs.LANGWATCH_SDK_LANGUAGE,
|
|
894
|
+
"x-langwatch-sdk-version": _chunk6SSJPQAWjs.LANGWATCH_SDK_VERSION,
|
|
895
|
+
"x-langwatch-sdk-platform": _chunk6SSJPQAWjs.LANGWATCH_SDK_RUNTIME.call(void 0, )
|
|
896
896
|
})
|
|
897
897
|
});
|
|
898
898
|
client.use(handledErrorMiddleware);
|
|
@@ -2169,12 +2169,12 @@ var DatasetPlanLimitError = class extends DatasetError {
|
|
|
2169
2169
|
};
|
|
2170
2170
|
|
|
2171
2171
|
// src/client-sdk/services/datasets/tracing/tracer.ts
|
|
2172
|
-
var tracer2 = _chunkO4J3ZPZYjs.getLangWatchTracer.call(void 0, `${
|
|
2172
|
+
var tracer2 = _chunkO4J3ZPZYjs.getLangWatchTracer.call(void 0, `${_chunk6SSJPQAWjs.LANGWATCH_SDK_NAME_CLIENT}.datasets`, _chunk6SSJPQAWjs.LANGWATCH_SDK_VERSION);
|
|
2173
2173
|
|
|
2174
2174
|
// src/client-sdk/services/datasets/dataset.service.ts
|
|
2175
2175
|
var DatasetService = class {
|
|
2176
2176
|
constructor(config) {
|
|
2177
|
-
this.config = _chunkLCG5Y2EGjs.__spreadProps.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {}, config), { endpoint:
|
|
2177
|
+
this.config = _chunkLCG5Y2EGjs.__spreadProps.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {}, config), { endpoint: _chunkFUDF46YWjs.resolveEndpoint.call(void 0, config.endpoint) });
|
|
2178
2178
|
return createTracingProxy(this, tracer2);
|
|
2179
2179
|
}
|
|
2180
2180
|
/**
|
|
@@ -2455,7 +2455,7 @@ var DatasetService = class {
|
|
|
2455
2455
|
const url = `${endpoint}${path2}`;
|
|
2456
2456
|
const response = await langwatchFetch(url, {
|
|
2457
2457
|
method: "POST",
|
|
2458
|
-
headers:
|
|
2458
|
+
headers: _chunk6SSJPQAWjs.buildAuthHeaders.call(void 0, { apiKey }),
|
|
2459
2459
|
body: formData
|
|
2460
2460
|
});
|
|
2461
2461
|
if (!response.ok) {
|
|
@@ -3154,7 +3154,7 @@ var Experiment = class _Experiment {
|
|
|
3154
3154
|
this.experimentSlug = name;
|
|
3155
3155
|
this.runId = (_a = options.runId) != null ? _a : generateHumanReadableId();
|
|
3156
3156
|
this.apiClient = options.apiClient;
|
|
3157
|
-
this.endpoint =
|
|
3157
|
+
this.endpoint = _chunkFUDF46YWjs.resolveEndpoint.call(void 0, options.endpoint);
|
|
3158
3158
|
this.apiKey = options.apiKey;
|
|
3159
3159
|
this.logger = options.logger;
|
|
3160
3160
|
this.concurrency = (_b = options.concurrency) != null ? _b : DEFAULT_CONCURRENCY;
|
|
@@ -3164,7 +3164,7 @@ var Experiment = class _Experiment {
|
|
|
3164
3164
|
* Initialize an evaluation session
|
|
3165
3165
|
*/
|
|
3166
3166
|
static async init(name, options) {
|
|
3167
|
-
|
|
3167
|
+
_chunkFUDF46YWjs.ensureSetup.call(void 0, );
|
|
3168
3168
|
const experiment = new _Experiment(name, options);
|
|
3169
3169
|
await experiment.initialize();
|
|
3170
3170
|
return experiment;
|
|
@@ -3183,7 +3183,7 @@ var Experiment = class _Experiment {
|
|
|
3183
3183
|
method: "POST",
|
|
3184
3184
|
headers: _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {
|
|
3185
3185
|
"Content-Type": "application/json"
|
|
3186
|
-
},
|
|
3186
|
+
}, _chunk6SSJPQAWjs.buildAuthHeaders.call(void 0, { apiKey: this.apiKey })),
|
|
3187
3187
|
body: JSON.stringify({
|
|
3188
3188
|
experiment_name: this.name,
|
|
3189
3189
|
experiment_slug: this.experimentSlug,
|
|
@@ -3539,7 +3539,7 @@ var Experiment = class _Experiment {
|
|
|
3539
3539
|
method: "POST",
|
|
3540
3540
|
headers: _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {
|
|
3541
3541
|
"Content-Type": "application/json"
|
|
3542
|
-
},
|
|
3542
|
+
}, _chunk6SSJPQAWjs.buildAuthHeaders.call(void 0, { apiKey: this.apiKey })),
|
|
3543
3543
|
body: JSON.stringify({
|
|
3544
3544
|
trace_id: traceId != null ? traceId : null,
|
|
3545
3545
|
span_id: spanId != null ? spanId : null,
|
|
@@ -4076,7 +4076,7 @@ var Experiment = class _Experiment {
|
|
|
4076
4076
|
method: "POST",
|
|
4077
4077
|
headers: _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {
|
|
4078
4078
|
"Content-Type": "application/json"
|
|
4079
|
-
},
|
|
4079
|
+
}, _chunk6SSJPQAWjs.buildAuthHeaders.call(void 0, { apiKey: this.apiKey })),
|
|
4080
4080
|
body: JSON.stringify(body)
|
|
4081
4081
|
}).then((response) => {
|
|
4082
4082
|
if (!response.ok) {
|
|
@@ -5064,7 +5064,7 @@ var EvaluationsFacade = class {
|
|
|
5064
5064
|
method: "POST",
|
|
5065
5065
|
headers: _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {
|
|
5066
5066
|
"Content-Type": "application/json"
|
|
5067
|
-
},
|
|
5067
|
+
}, _chunk6SSJPQAWjs.buildAuthHeaders.call(void 0, { apiKey: _chunkLCG5Y2EGjs.__privateGet.call(void 0, this, _apiKey) })),
|
|
5068
5068
|
body: JSON.stringify(requestBody)
|
|
5069
5069
|
});
|
|
5070
5070
|
if (!response.ok) {
|
|
@@ -5496,6 +5496,149 @@ function withTrimmedNote(body) {
|
|
|
5496
5496
|
return rest;
|
|
5497
5497
|
}
|
|
5498
5498
|
|
|
5499
|
+
// src/client-sdk/services/instant-evals/instant-evals-api.service.ts
|
|
5500
|
+
var InstantEvalsApiError = class extends Error {
|
|
5501
|
+
constructor(message, operation, originalError, status) {
|
|
5502
|
+
super(message);
|
|
5503
|
+
this.operation = operation;
|
|
5504
|
+
this.originalError = originalError;
|
|
5505
|
+
this.status = status;
|
|
5506
|
+
this.name = "InstantEvalsApiError";
|
|
5507
|
+
}
|
|
5508
|
+
};
|
|
5509
|
+
var InstantEvalsApiService = class {
|
|
5510
|
+
constructor(config) {
|
|
5511
|
+
var _a;
|
|
5512
|
+
this.apiClient = (_a = config == null ? void 0 : config.langwatchApiClient) != null ? _a : createLangWatchApiClient();
|
|
5513
|
+
}
|
|
5514
|
+
handleApiError(operation, error, response) {
|
|
5515
|
+
var _a;
|
|
5516
|
+
const status = (_a = response == null ? void 0 : response.status) != null ? _a : extractStatusFromResponse(error);
|
|
5517
|
+
const message = formatApiErrorForOperation({
|
|
5518
|
+
operation,
|
|
5519
|
+
error,
|
|
5520
|
+
options: { status }
|
|
5521
|
+
});
|
|
5522
|
+
throwIfHandledError({ operation, error, response, message });
|
|
5523
|
+
throw new InstantEvalsApiError(message, operation, error, status);
|
|
5524
|
+
}
|
|
5525
|
+
/**
|
|
5526
|
+
* The body of a successful answer. A failed response can arrive with no body
|
|
5527
|
+
* at all (a proxy answering 502 while the platform restarts), which leaves
|
|
5528
|
+
* `error` empty, so the response status decides and not the error alone.
|
|
5529
|
+
*/
|
|
5530
|
+
unwrap({
|
|
5531
|
+
operation,
|
|
5532
|
+
data,
|
|
5533
|
+
error,
|
|
5534
|
+
response
|
|
5535
|
+
}) {
|
|
5536
|
+
const failed = response !== void 0 && !response.ok;
|
|
5537
|
+
if (error || failed || data === void 0) {
|
|
5538
|
+
this.handleApiError(operation, error != null ? error : void 0, response);
|
|
5539
|
+
}
|
|
5540
|
+
return data;
|
|
5541
|
+
}
|
|
5542
|
+
/** Starts a run. The judging happens on the queue. */
|
|
5543
|
+
async create(body) {
|
|
5544
|
+
const { data, error, response } = await this.apiClient.POST(
|
|
5545
|
+
"/api/v1/instant-evals",
|
|
5546
|
+
{ body }
|
|
5547
|
+
);
|
|
5548
|
+
return this.unwrap({
|
|
5549
|
+
operation: "start an instant eval run",
|
|
5550
|
+
data,
|
|
5551
|
+
error,
|
|
5552
|
+
response
|
|
5553
|
+
});
|
|
5554
|
+
}
|
|
5555
|
+
/** Prices a run without starting it. Nothing is judged and nothing is charged. */
|
|
5556
|
+
async estimate(body) {
|
|
5557
|
+
const { data, error, response } = await this.apiClient.POST(
|
|
5558
|
+
"/api/v1/instant-evals/estimate",
|
|
5559
|
+
{ body }
|
|
5560
|
+
);
|
|
5561
|
+
return this.unwrap({
|
|
5562
|
+
operation: "estimate an instant eval run",
|
|
5563
|
+
data,
|
|
5564
|
+
error,
|
|
5565
|
+
response
|
|
5566
|
+
});
|
|
5567
|
+
}
|
|
5568
|
+
/** The project's runs, newest first. */
|
|
5569
|
+
async list(options) {
|
|
5570
|
+
const query = _chunkLCG5Y2EGjs.__spreadValues.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {}, (options == null ? void 0 : options.limit) === void 0 ? {} : { limit: options.limit }), (options == null ? void 0 : options.before) === void 0 ? {} : { before: options.before }), (options == null ? void 0 : options.beforeId) === void 0 ? {} : { beforeId: options.beforeId });
|
|
5571
|
+
const { data, error, response } = await this.apiClient.GET(
|
|
5572
|
+
"/api/v1/instant-evals",
|
|
5573
|
+
{ params: { query } }
|
|
5574
|
+
);
|
|
5575
|
+
return this.unwrap({
|
|
5576
|
+
operation: "list instant eval runs",
|
|
5577
|
+
data,
|
|
5578
|
+
error,
|
|
5579
|
+
response
|
|
5580
|
+
}).runs;
|
|
5581
|
+
}
|
|
5582
|
+
async get(id) {
|
|
5583
|
+
const { data, error, response } = await this.apiClient.GET(
|
|
5584
|
+
"/api/v1/instant-evals/{id}",
|
|
5585
|
+
{ params: { path: { id } } }
|
|
5586
|
+
);
|
|
5587
|
+
return this.unwrap({
|
|
5588
|
+
operation: `get instant eval run "${id}"`,
|
|
5589
|
+
data,
|
|
5590
|
+
error,
|
|
5591
|
+
response
|
|
5592
|
+
});
|
|
5593
|
+
}
|
|
5594
|
+
/** Asks a run to stop. It stops before its next page. */
|
|
5595
|
+
async cancel(id) {
|
|
5596
|
+
const { data, error, response } = await this.apiClient.POST(
|
|
5597
|
+
"/api/v1/instant-evals/{id}/cancel",
|
|
5598
|
+
{ params: { path: { id } } }
|
|
5599
|
+
);
|
|
5600
|
+
return this.unwrap({
|
|
5601
|
+
operation: `cancel instant eval run "${id}"`,
|
|
5602
|
+
data,
|
|
5603
|
+
error,
|
|
5604
|
+
response
|
|
5605
|
+
});
|
|
5606
|
+
}
|
|
5607
|
+
/**
|
|
5608
|
+
* One page of a run's judgements.
|
|
5609
|
+
*
|
|
5610
|
+
* Pass the `nextCursor` a page answers with to read the page after it. The
|
|
5611
|
+
* last page carries none.
|
|
5612
|
+
*/
|
|
5613
|
+
async results(id, options) {
|
|
5614
|
+
const query = _chunkLCG5Y2EGjs.__spreadValues.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {}, (options == null ? void 0 : options.questionId) === void 0 ? {} : { questionId: options.questionId }), (options == null ? void 0 : options.isMatched) === void 0 ? {} : { matched: options.isMatched ? "true" : "false" }), (options == null ? void 0 : options.status) === void 0 ? {} : { status: options.status }), (options == null ? void 0 : options.limit) === void 0 ? {} : { limit: options.limit }), (options == null ? void 0 : options.cursor) === void 0 ? {} : { cursor: options.cursor });
|
|
5615
|
+
const { data, error, response } = await this.apiClient.GET(
|
|
5616
|
+
"/api/v1/instant-evals/{id}/results",
|
|
5617
|
+
{ params: { path: { id }, query } }
|
|
5618
|
+
);
|
|
5619
|
+
return this.unwrap({
|
|
5620
|
+
operation: `read instant eval run "${id}" results`,
|
|
5621
|
+
data,
|
|
5622
|
+
error,
|
|
5623
|
+
response
|
|
5624
|
+
});
|
|
5625
|
+
}
|
|
5626
|
+
/** A few of the run's rows, with the judged text beside the verdict. */
|
|
5627
|
+
async sample(id, options) {
|
|
5628
|
+
const query = (options == null ? void 0 : options.n) === void 0 ? {} : { n: options.n };
|
|
5629
|
+
const { data, error, response } = await this.apiClient.GET(
|
|
5630
|
+
"/api/v1/instant-evals/{id}/sample",
|
|
5631
|
+
{ params: { path: { id }, query } }
|
|
5632
|
+
);
|
|
5633
|
+
return this.unwrap({
|
|
5634
|
+
operation: `sample instant eval run "${id}"`,
|
|
5635
|
+
data,
|
|
5636
|
+
error,
|
|
5637
|
+
response
|
|
5638
|
+
});
|
|
5639
|
+
}
|
|
5640
|
+
};
|
|
5641
|
+
|
|
5499
5642
|
// src/client-sdk/services/test-suites/test-suites-api.service.ts
|
|
5500
5643
|
var TestSuitesApiError = class extends Error {
|
|
5501
5644
|
constructor(message, operation, originalError, status) {
|
|
@@ -5611,7 +5754,7 @@ var WorkflowsApiError = class extends Error {
|
|
|
5611
5754
|
var WorkflowsApiService = class {
|
|
5612
5755
|
constructor(config) {
|
|
5613
5756
|
var _a;
|
|
5614
|
-
this.endpoint =
|
|
5757
|
+
this.endpoint = _chunkFUDF46YWjs.resolveEndpoint.call(void 0, config == null ? void 0 : config.endpoint);
|
|
5615
5758
|
this.apiClient = (_a = config == null ? void 0 : config.langwatchApiClient) != null ? _a : createLangWatchApiClient(void 0, this.endpoint);
|
|
5616
5759
|
this.experimentsApiService = new ExperimentsApiService({
|
|
5617
5760
|
langwatchApiClient: this.apiClient
|
|
@@ -6027,7 +6170,7 @@ var QueryApiService = class {
|
|
|
6027
6170
|
throw new QueryApiError(message, operation, error, status);
|
|
6028
6171
|
}
|
|
6029
6172
|
/**
|
|
6030
|
-
* Runs one read-only LangWatchQL `SELECT` over the analytics
|
|
6173
|
+
* Runs one read-only LangWatchQL `SELECT` over the analytics views and
|
|
6031
6174
|
* returns typed columns, rows, execution statistics, truncation state and
|
|
6032
6175
|
* diagnostics, scoped to the caller's project.
|
|
6033
6176
|
*/
|
|
@@ -6040,7 +6183,7 @@ var QueryApiService = class {
|
|
|
6040
6183
|
return data;
|
|
6041
6184
|
}
|
|
6042
6185
|
/**
|
|
6043
|
-
* Lists the LangWatchQL analytics
|
|
6186
|
+
* Lists the LangWatchQL analytics views this key may query, with each
|
|
6044
6187
|
* column's type, description, the permissions that unlock it, and whether
|
|
6045
6188
|
* this caller holds them — plus each dataset's grain, join keys,
|
|
6046
6189
|
* partition-pruning time column, freshness and a runnable example query.
|
|
@@ -6053,6 +6196,20 @@ var QueryApiService = class {
|
|
|
6053
6196
|
if (error) this.handleApiError("discover query schema", error, response);
|
|
6054
6197
|
return data;
|
|
6055
6198
|
}
|
|
6199
|
+
/**
|
|
6200
|
+
* Describes both query languages in one payload: the LangWatchQL schema,
|
|
6201
|
+
* limits and endpoints, the trace filter's syntax and fields, worked examples
|
|
6202
|
+
* validated in both, and which language answers which kind of
|
|
6203
|
+
* question.
|
|
6204
|
+
*/
|
|
6205
|
+
async reference() {
|
|
6206
|
+
const { data, error, response } = await this.apiClient.GET(
|
|
6207
|
+
"/api/v1/query/reference",
|
|
6208
|
+
{}
|
|
6209
|
+
);
|
|
6210
|
+
if (error) this.handleApiError("read query reference", error, response);
|
|
6211
|
+
return data;
|
|
6212
|
+
}
|
|
6056
6213
|
};
|
|
6057
6214
|
|
|
6058
6215
|
// src/client-sdk/services/triggers/triggers-api.service.ts
|
|
@@ -6232,12 +6389,12 @@ var MonitorsApiService = class {
|
|
|
6232
6389
|
constructor(config) {
|
|
6233
6390
|
var _a, _b, _c;
|
|
6234
6391
|
this.apiKey = (_c = (_b = (_a = config == null ? void 0 : config.apiKey) != null ? _a : scopedApiKey()) != null ? _b : process.env.LANGWATCH_API_KEY) != null ? _c : "";
|
|
6235
|
-
this.endpoint =
|
|
6392
|
+
this.endpoint = _chunkFUDF46YWjs.resolveEndpoint.call(void 0, config == null ? void 0 : config.endpoint);
|
|
6236
6393
|
}
|
|
6237
6394
|
async request(path2, options) {
|
|
6238
6395
|
var _a, _b;
|
|
6239
6396
|
const response = await langwatchFetch(`${this.endpoint}${path2}`, _chunkLCG5Y2EGjs.__spreadProps.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {}, options), {
|
|
6240
|
-
headers: _chunkLCG5Y2EGjs.__spreadValues.call(void 0, _chunkLCG5Y2EGjs.__spreadProps.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {},
|
|
6397
|
+
headers: _chunkLCG5Y2EGjs.__spreadValues.call(void 0, _chunkLCG5Y2EGjs.__spreadProps.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {}, _chunk6SSJPQAWjs.buildAuthHeaders.call(void 0, { apiKey: this.apiKey })), {
|
|
6241
6398
|
"Content-Type": "application/json"
|
|
6242
6399
|
}), options == null ? void 0 : options.headers)
|
|
6243
6400
|
}));
|
|
@@ -6307,12 +6464,12 @@ var SecretsApiService = class {
|
|
|
6307
6464
|
constructor(config) {
|
|
6308
6465
|
var _a, _b, _c;
|
|
6309
6466
|
this.apiKey = (_c = (_b = (_a = config == null ? void 0 : config.apiKey) != null ? _a : scopedApiKey()) != null ? _b : process.env.LANGWATCH_API_KEY) != null ? _c : "";
|
|
6310
|
-
this.endpoint =
|
|
6467
|
+
this.endpoint = _chunkFUDF46YWjs.resolveEndpoint.call(void 0, config == null ? void 0 : config.endpoint);
|
|
6311
6468
|
}
|
|
6312
6469
|
async request(path2, options) {
|
|
6313
6470
|
var _a, _b;
|
|
6314
6471
|
const response = await langwatchFetch(`${this.endpoint}${path2}`, _chunkLCG5Y2EGjs.__spreadProps.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {}, options), {
|
|
6315
|
-
headers: _chunkLCG5Y2EGjs.__spreadValues.call(void 0, _chunkLCG5Y2EGjs.__spreadProps.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {},
|
|
6472
|
+
headers: _chunkLCG5Y2EGjs.__spreadValues.call(void 0, _chunkLCG5Y2EGjs.__spreadProps.call(void 0, _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {}, _chunk6SSJPQAWjs.buildAuthHeaders.call(void 0, { apiKey: this.apiKey })), {
|
|
6316
6473
|
"Content-Type": "application/json"
|
|
6317
6474
|
}), options == null ? void 0 : options.headers)
|
|
6318
6475
|
}));
|
|
@@ -6442,7 +6599,7 @@ var VirtualKeysApiError = class extends Error {
|
|
|
6442
6599
|
var VirtualKeysApiService = class {
|
|
6443
6600
|
constructor(config) {
|
|
6444
6601
|
var _a, _b, _c, _d;
|
|
6445
|
-
this.endpoint =
|
|
6602
|
+
this.endpoint = _chunkFUDF46YWjs.resolveEndpoint.call(void 0, config == null ? void 0 : config.endpoint);
|
|
6446
6603
|
this.apiKey = (_c = (_b = (_a = config == null ? void 0 : config.apiKey) != null ? _a : scopedApiKey()) != null ? _b : process.env.LANGWATCH_API_KEY) != null ? _c : "";
|
|
6447
6604
|
this.projectId = (_d = config == null ? void 0 : config.projectId) != null ? _d : process.env.LANGWATCH_PROJECT_ID;
|
|
6448
6605
|
}
|
|
@@ -6581,11 +6738,6 @@ var VirtualKeysApiService = class {
|
|
|
6581
6738
|
);
|
|
6582
6739
|
return virtual_key;
|
|
6583
6740
|
}
|
|
6584
|
-
/**
|
|
6585
|
-
* Mint a key. The response carries the secret ONCE; nothing ever serves it
|
|
6586
|
-
* again, so a create that times out is recovered with `idempotencyKey`
|
|
6587
|
-
* rather than by listing.
|
|
6588
|
-
*/
|
|
6589
6741
|
async create(input, options) {
|
|
6590
6742
|
return this.request(
|
|
6591
6743
|
"create virtual key",
|
|
@@ -6670,7 +6822,7 @@ var GatewayBudgetsApiError = class extends Error {
|
|
|
6670
6822
|
var GatewayBudgetsApiService = class {
|
|
6671
6823
|
constructor(config) {
|
|
6672
6824
|
var _a, _b, _c, _d;
|
|
6673
|
-
this.endpoint =
|
|
6825
|
+
this.endpoint = _chunkFUDF46YWjs.resolveEndpoint.call(void 0, config == null ? void 0 : config.endpoint);
|
|
6674
6826
|
this.apiKey = (_c = (_b = (_a = config == null ? void 0 : config.apiKey) != null ? _a : scopedApiKey()) != null ? _b : process.env.LANGWATCH_API_KEY) != null ? _c : "";
|
|
6675
6827
|
this.projectId = (_d = config == null ? void 0 : config.projectId) != null ? _d : process.env.LANGWATCH_PROJECT_ID;
|
|
6676
6828
|
}
|
|
@@ -6938,7 +7090,7 @@ var SpendEventsApiError = class extends Error {
|
|
|
6938
7090
|
var SpendEventsApiService = class {
|
|
6939
7091
|
constructor(config) {
|
|
6940
7092
|
var _a, _b, _c;
|
|
6941
|
-
this.endpoint =
|
|
7093
|
+
this.endpoint = _chunkFUDF46YWjs.resolveEndpoint.call(void 0, config == null ? void 0 : config.endpoint);
|
|
6942
7094
|
this.apiKey = (_c = (_b = (_a = config == null ? void 0 : config.apiKey) != null ? _a : scopedApiKey()) != null ? _b : process.env.LANGWATCH_API_KEY) != null ? _c : "";
|
|
6943
7095
|
}
|
|
6944
7096
|
async request(operation, path2, init) {
|
|
@@ -7167,7 +7319,7 @@ var WebhooksApiError = class extends Error {
|
|
|
7167
7319
|
var WebhooksApiService = class {
|
|
7168
7320
|
constructor(config) {
|
|
7169
7321
|
var _a, _b, _c;
|
|
7170
|
-
this.endpoint =
|
|
7322
|
+
this.endpoint = _chunkFUDF46YWjs.resolveEndpoint.call(void 0, config == null ? void 0 : config.endpoint);
|
|
7171
7323
|
this.apiKey = (_c = (_b = (_a = config == null ? void 0 : config.apiKey) != null ? _a : scopedApiKey()) != null ? _b : process.env.LANGWATCH_API_KEY) != null ? _c : "";
|
|
7172
7324
|
}
|
|
7173
7325
|
async request(operation, path2, init) {
|
|
@@ -7504,7 +7656,7 @@ var TeamsApiService = class {
|
|
|
7504
7656
|
constructor(config) {
|
|
7505
7657
|
_chunkLCG5Y2EGjs.__privateAdd.call(void 0, this, _request);
|
|
7506
7658
|
_chunkLCG5Y2EGjs.__privateSet.call(void 0, this, _request, createManagementRequest({
|
|
7507
|
-
endpoint:
|
|
7659
|
+
endpoint: _chunkFUDF46YWjs.resolveEndpoint.call(void 0, config == null ? void 0 : config.endpoint),
|
|
7508
7660
|
token: resolveManagementToken({ apiKey: config == null ? void 0 : config.apiKey }),
|
|
7509
7661
|
errorFactory: ({ message, operation, body }) => new TeamsApiError(message, operation, body)
|
|
7510
7662
|
}));
|
|
@@ -7591,7 +7743,7 @@ var ProjectsApiError = class extends Error {
|
|
|
7591
7743
|
var ProjectsApiService = class {
|
|
7592
7744
|
constructor(config) {
|
|
7593
7745
|
var _a, _b, _c;
|
|
7594
|
-
this.endpoint =
|
|
7746
|
+
this.endpoint = _chunkFUDF46YWjs.resolveEndpoint.call(void 0, config == null ? void 0 : config.endpoint);
|
|
7595
7747
|
this.apiKey = (_c = (_b = (_a = config == null ? void 0 : config.apiKey) != null ? _a : scopedApiKey()) != null ? _b : process.env.LANGWATCH_API_KEY) != null ? _c : "";
|
|
7596
7748
|
}
|
|
7597
7749
|
/**
|
|
@@ -7655,6 +7807,18 @@ var ProjectsApiService = class {
|
|
|
7655
7807
|
`/api/projects/${encodeURIComponent(id)}`
|
|
7656
7808
|
);
|
|
7657
7809
|
}
|
|
7810
|
+
/**
|
|
7811
|
+
* The project's ingest key. The platform hands it out only to a credential
|
|
7812
|
+
* with `project:update` on the project, so a 403 here is the answer "this
|
|
7813
|
+
* login may not", not a transport failure.
|
|
7814
|
+
*/
|
|
7815
|
+
async getApiKey(id) {
|
|
7816
|
+
const answer = await this.request(
|
|
7817
|
+
`get api key of project "${id}"`,
|
|
7818
|
+
`/api/projects/${encodeURIComponent(id)}/api-key`
|
|
7819
|
+
);
|
|
7820
|
+
return answer.apiKey;
|
|
7821
|
+
}
|
|
7658
7822
|
async create(input) {
|
|
7659
7823
|
return this.request(
|
|
7660
7824
|
"create project",
|
|
@@ -7689,7 +7853,7 @@ var TracesError = class extends Error {
|
|
|
7689
7853
|
};
|
|
7690
7854
|
|
|
7691
7855
|
// src/client-sdk/services/traces/tracing/tracer.ts
|
|
7692
|
-
var tracer3 = _chunkO4J3ZPZYjs.getLangWatchTracer.call(void 0, `${
|
|
7856
|
+
var tracer3 = _chunkO4J3ZPZYjs.getLangWatchTracer.call(void 0, `${_chunk6SSJPQAWjs.LANGWATCH_SDK_NAME_CLIENT}.traces`, _chunk6SSJPQAWjs.LANGWATCH_SDK_VERSION);
|
|
7693
7857
|
|
|
7694
7858
|
// src/client-sdk/services/traces/service.ts
|
|
7695
7859
|
var TracesService = class {
|
|
@@ -7761,7 +7925,7 @@ var LangWatch = class {
|
|
|
7761
7925
|
_chunkLCG5Y2EGjs.__privateAdd.call(void 0, this, _projects);
|
|
7762
7926
|
var _a, _b, _c;
|
|
7763
7927
|
const apiKey = (_c = (_b = (_a = options.apiKey) != null ? _a : scopedApiKey()) != null ? _b : process.env.LANGWATCH_API_KEY) != null ? _c : "";
|
|
7764
|
-
const endpoint =
|
|
7928
|
+
const endpoint = _chunkFUDF46YWjs.resolveEndpoint.call(void 0, options.endpoint);
|
|
7765
7929
|
this.config = _chunkLCG5Y2EGjs.__privateMethod.call(void 0, this, _LangWatch_instances, createInternalConfig_fn).call(this, {
|
|
7766
7930
|
apiKey,
|
|
7767
7931
|
endpoint,
|
|
@@ -7793,6 +7957,7 @@ var LangWatch = class {
|
|
|
7793
7957
|
this.scenarios = new ScenariosApiService(this.config);
|
|
7794
7958
|
this.suites = new SuitesApiService(this.config);
|
|
7795
7959
|
this.runPlans = new RunPlansApiService(this.config);
|
|
7960
|
+
this.instantEvals = new InstantEvalsApiService(this.config);
|
|
7796
7961
|
this.testSuites = new TestSuitesApiService(this.config);
|
|
7797
7962
|
this.workflows = new WorkflowsApiService(this.config);
|
|
7798
7963
|
this.agents = new AgentsApiService(this.config);
|
|
@@ -8007,5 +8172,5 @@ var logger = {
|
|
|
8007
8172
|
|
|
8008
8173
|
|
|
8009
8174
|
|
|
8010
|
-
exports.ComparisonError = ComparisonError; exports.DatasetApiError = DatasetApiError; exports.DatasetError = DatasetError; exports.DatasetNotFoundError = DatasetNotFoundError; exports.DatasetPlanLimitError = DatasetPlanLimitError; exports.DatasetValidationError = DatasetValidationError; exports.DatasetsFacade = DatasetsFacade; exports.EvaluationError = EvaluationError; exports.EvaluationsApiError = EvaluationsApiError; exports.EvaluationsFacade = EvaluationsFacade; exports.EvaluatorCallError = EvaluatorCallError; exports.EvaluatorError = EvaluatorError; exports.EvaluatorNotFoundError = EvaluatorNotFoundError; exports.EvaluatorsApiError = EvaluatorsApiError; exports.EvaluatorsApiService = EvaluatorsApiService; exports.Experiment = Experiment; exports.ExperimentApiError = ExperimentApiError; exports.ExperimentError = ExperimentError; exports.ExperimentInitError = ExperimentInitError; exports.ExperimentsFacade = ExperimentsFacade; exports.FetchPolicy = FetchPolicy; exports.FilterableBatchSpanProcessor = _chunk73QOHSHUjs.FilterableBatchSpanProcessor; exports.GatewayBudgetsApiError = GatewayBudgetsApiError; exports.GatewayBudgetsApiService = GatewayBudgetsApiService; exports.IDEMPOTENCY_KEY_HEADER = IDEMPOTENCY_KEY_HEADER; exports.IDEMPOTENT_REPLAY_HEADER = IDEMPOTENT_REPLAY_HEADER; exports.LangWatch = LangWatch; exports.LangWatchApiError = LangWatchApiError; exports.LangWatchExporter =
|
|
8175
|
+
exports.ComparisonError = ComparisonError; exports.DatasetApiError = DatasetApiError; exports.DatasetError = DatasetError; exports.DatasetNotFoundError = DatasetNotFoundError; exports.DatasetPlanLimitError = DatasetPlanLimitError; exports.DatasetValidationError = DatasetValidationError; exports.DatasetsFacade = DatasetsFacade; exports.EvaluationError = EvaluationError; exports.EvaluationsApiError = EvaluationsApiError; exports.EvaluationsFacade = EvaluationsFacade; exports.EvaluatorCallError = EvaluatorCallError; exports.EvaluatorError = EvaluatorError; exports.EvaluatorNotFoundError = EvaluatorNotFoundError; exports.EvaluatorsApiError = EvaluatorsApiError; exports.EvaluatorsApiService = EvaluatorsApiService; exports.Experiment = Experiment; exports.ExperimentApiError = ExperimentApiError; exports.ExperimentError = ExperimentError; exports.ExperimentInitError = ExperimentInitError; exports.ExperimentsFacade = ExperimentsFacade; exports.FetchPolicy = FetchPolicy; exports.FilterableBatchSpanProcessor = _chunk73QOHSHUjs.FilterableBatchSpanProcessor; exports.GatewayBudgetsApiError = GatewayBudgetsApiError; exports.GatewayBudgetsApiService = GatewayBudgetsApiService; exports.IDEMPOTENCY_KEY_HEADER = IDEMPOTENCY_KEY_HEADER; exports.IDEMPOTENT_REPLAY_HEADER = IDEMPOTENT_REPLAY_HEADER; exports.LangWatch = LangWatch; exports.LangWatchApiError = LangWatchApiError; exports.LangWatchExporter = _chunk6SSJPQAWjs.LangWatchTraceExporter; exports.LangWatchHandledError = LangWatchHandledError; exports.LangWatchRedirectError = LangWatchRedirectError; exports.ProjectsApiError = ProjectsApiError; exports.ProjectsApiService = ProjectsApiService; exports.SpendEventsApiError = SpendEventsApiError; exports.SpendEventsApiService = SpendEventsApiService; exports.TargetMetadataConflictError = TargetMetadataConflictError; exports.TeamsApiError = TeamsApiError; exports.TeamsApiService = TeamsApiService; exports.VirtualKeysApiError = VirtualKeysApiError; exports.VirtualKeysApiService = VirtualKeysApiService; exports.WEBHOOK_DELIVERY_ID_HEADER = WEBHOOK_DELIVERY_ID_HEADER; exports.WEBHOOK_EVENT_ID_HEADER = WEBHOOK_EVENT_ID_HEADER; exports.WEBHOOK_SIGNATURE_DEFAULT_TOLERANCE_SECONDS = WEBHOOK_SIGNATURE_DEFAULT_TOLERANCE_SECONDS; exports.WEBHOOK_SIGNATURE_HEADER = WEBHOOK_SIGNATURE_HEADER; exports.WebhookSignatureVerificationError = WebhookSignatureVerificationError; exports.WebhooksApiError = WebhooksApiError; exports.WebhooksApiService = WebhooksApiService; exports.attributes = _chunkLCG5Y2EGjs.attributes_exports; exports.createLangWatchFetch = createLangWatchFetch; exports.getLangWatchLogger = _chunk6SSJPQAWjs.getLangWatchLogger; exports.getLangWatchTracer = _chunkO4J3ZPZYjs.getLangWatchTracer; exports.isLangWatchHandledError = isLangWatchHandledError; exports.langwatchFetch = langwatchFetch; exports.logger = logger; exports.verifyWebhookSignature = verifyWebhookSignature;
|
|
8011
8176
|
//# sourceMappingURL=index.js.map
|