langwatch 1.7.0 → 1.8.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/{chunk-SYJIEBJY.mjs → chunk-2HA4SJSD.mjs} +2 -2
- package/dist/{chunk-K6KPNTQO.js → chunk-4ERRCKOH.js} +197 -197
- package/dist/{chunk-K6KPNTQO.js.map → chunk-4ERRCKOH.js.map} +1 -1
- package/dist/{chunk-LTDUROCE.mjs → chunk-57L2K66L.mjs} +2 -2
- package/dist/{chunk-ZTOXEWNX.js → chunk-73QOHSHU.js} +2 -2
- package/dist/{chunk-ZTOXEWNX.js.map → chunk-73QOHSHU.js.map} +1 -1
- package/dist/{chunk-3KAXFA26.js → chunk-FJ6JSLLE.js} +19 -19
- package/dist/{chunk-3KAXFA26.js.map → chunk-FJ6JSLLE.js.map} +1 -1
- package/dist/{chunk-3T7YUVMO.js → chunk-KS7O6FTO.js} +16 -16
- package/dist/{chunk-3T7YUVMO.js.map → chunk-KS7O6FTO.js.map} +1 -1
- package/dist/{chunk-CLTKABMO.js → chunk-LCG5Y2EG.js} +5 -3
- package/dist/chunk-LCG5Y2EG.js.map +1 -0
- package/dist/{chunk-GOIVDBO3.mjs → chunk-W6NUS5XK.mjs} +3 -3
- package/dist/{chunk-GOIVDBO3.mjs.map → chunk-W6NUS5XK.mjs.map} +1 -1
- package/dist/{chunk-CMZFFKLA.mjs → chunk-WMDQVWA6.mjs} +5 -3
- package/dist/{chunk-CMZFFKLA.mjs.map → chunk-WMDQVWA6.mjs.map} +1 -1
- package/dist/{chunk-MTOAYNSY.mjs → chunk-YEKLDVGO.mjs} +3 -3
- package/dist/cli/bundle.js +158 -158
- package/dist/{implementation-BRb66Lsz.d.mts → implementation-CMvLlYDH.d.mts} +1 -1
- package/dist/{implementation-j4Y9Dc12.d.ts → implementation-Di0CB66C.d.ts} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +227 -227
- package/dist/index.mjs +5 -5
- package/dist/observability-sdk/index.d.mts +3 -3
- package/dist/observability-sdk/index.d.ts +3 -3
- package/dist/observability-sdk/index.js +5 -5
- package/dist/observability-sdk/index.mjs +4 -4
- package/dist/observability-sdk/instrumentation/langchain/index.d.mts +1 -1
- package/dist/observability-sdk/instrumentation/langchain/index.d.ts +1 -1
- package/dist/observability-sdk/instrumentation/langchain/index.js +18 -18
- package/dist/observability-sdk/instrumentation/langchain/index.mjs +2 -2
- package/dist/observability-sdk/setup/node/index.js +4 -4
- package/dist/observability-sdk/setup/node/index.mjs +3 -3
- package/dist/{types-CUPefoJS.d.ts → types-Cg_frfBV.d.ts} +162 -2
- package/dist/{types-BUivXEKT.d.mts → types-DQqmFCDl.d.mts} +162 -2
- package/package.json +1 -1
- package/dist/chunk-CLTKABMO.js.map +0 -1
- /package/dist/{chunk-SYJIEBJY.mjs.map → chunk-2HA4SJSD.mjs.map} +0 -0
- /package/dist/{chunk-LTDUROCE.mjs.map → chunk-57L2K66L.mjs.map} +0 -0
- /package/dist/{chunk-MTOAYNSY.mjs.map → chunk-YEKLDVGO.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FilterableBatchSpanProcessor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-57L2K66L.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createLangWatchSpan,
|
|
6
6
|
external_exports,
|
|
7
7
|
getLangWatchTracer
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2HA4SJSD.mjs";
|
|
9
9
|
import {
|
|
10
10
|
ensureSetup,
|
|
11
11
|
resolveEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YEKLDVGO.mjs";
|
|
13
13
|
import {
|
|
14
14
|
LANGWATCH_SDK_LANGUAGE,
|
|
15
15
|
LANGWATCH_SDK_NAME_CLIENT,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
buildAuthHeaders,
|
|
21
21
|
getLangWatchLogger,
|
|
22
22
|
version
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-W6NUS5XK.mjs";
|
|
24
24
|
import {
|
|
25
25
|
ConsoleLogger,
|
|
26
26
|
NoOpLogger,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
attributes_exports,
|
|
39
39
|
shouldCaptureInput,
|
|
40
40
|
shouldCaptureOutput
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-WMDQVWA6.mjs";
|
|
42
42
|
|
|
43
43
|
// src/internal/credentialContext.ts
|
|
44
44
|
import { AsyncLocalStorage } from "async_hooks";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, b as LangWatchExporterOptions, c as LangWatchLogger, L as LangWatchTraceExporter, b as LangWatchTraceExporterOptions, S as SpanProcessingExcludeRule, g as getLangWatchLogger, d as getLangWatchLoggerFromProvider, a as getLangWatchTracer, e as getLangWatchTracerFromProvider } from '../implementation-
|
|
1
|
+
export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, b as LangWatchExporterOptions, c as LangWatchLogger, L as LangWatchTraceExporter, b as LangWatchTraceExporterOptions, S as SpanProcessingExcludeRule, g as getLangWatchLogger, d as getLangWatchLoggerFromProvider, a as getLangWatchTracer, e as getLangWatchTracerFromProvider } from '../implementation-CMvLlYDH.mjs';
|
|
2
2
|
import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';
|
|
3
3
|
import { D as DataCaptureMode } from '../types-DLfhJb38.mjs';
|
|
4
4
|
export { a as DataCaptureConfig, b as DataCaptureContext, c as DataCaptureOptions, d as DataCapturePredicate } from '../types-DLfhJb38.mjs';
|
|
5
|
-
import { L as LangWatchSpan } from '../types-
|
|
6
|
-
export { A as AddEvaluationParams, E as EvaluationStatus, e as EvaluationTimestamps, I as INPUT_OUTPUT_TYPES, f as InputOutputType, J as JsonSerializable, g as LangWatchSpanMetrics, h as LangWatchSpanOptions, i as LangWatchSpanRAGContext, j as LangWatchTracer, S as SimpleChatMessage, k as SpanType, l as emitEvaluationEvent, s as spanTypes } from '../types-
|
|
5
|
+
import { L as LangWatchSpan } from '../types-DQqmFCDl.mjs';
|
|
6
|
+
export { A as AddEvaluationParams, E as EvaluationStatus, e as EvaluationTimestamps, I as INPUT_OUTPUT_TYPES, f as InputOutputType, J as JsonSerializable, g as LangWatchSpanMetrics, h as LangWatchSpanOptions, i as LangWatchSpanRAGContext, j as LangWatchTracer, S as SimpleChatMessage, k as SpanType, l as emitEvaluationEvent, s as spanTypes } from '../types-DQqmFCDl.mjs';
|
|
7
7
|
import { Span } from '@opentelemetry/api';
|
|
8
8
|
export { S as SemConvAttributeKey, a as SemConvAttributes, b as SemConvLogRecordAttributes, l as attributes } from '../types-VOZv9LYO.mjs';
|
|
9
9
|
import '@opentelemetry/sdk-trace-base';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, b as LangWatchExporterOptions, c as LangWatchLogger, L as LangWatchTraceExporter, b as LangWatchTraceExporterOptions, S as SpanProcessingExcludeRule, g as getLangWatchLogger, d as getLangWatchLoggerFromProvider, a as getLangWatchTracer, e as getLangWatchTracerFromProvider } from '../implementation-
|
|
1
|
+
export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, b as LangWatchExporterOptions, c as LangWatchLogger, L as LangWatchTraceExporter, b as LangWatchTraceExporterOptions, S as SpanProcessingExcludeRule, g as getLangWatchLogger, d as getLangWatchLoggerFromProvider, a as getLangWatchTracer, e as getLangWatchTracerFromProvider } from '../implementation-Di0CB66C.js';
|
|
2
2
|
import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';
|
|
3
3
|
import { D as DataCaptureMode } from '../types-DLfhJb38.js';
|
|
4
4
|
export { a as DataCaptureConfig, b as DataCaptureContext, c as DataCaptureOptions, d as DataCapturePredicate } from '../types-DLfhJb38.js';
|
|
5
|
-
import { L as LangWatchSpan } from '../types-
|
|
6
|
-
export { A as AddEvaluationParams, E as EvaluationStatus, e as EvaluationTimestamps, I as INPUT_OUTPUT_TYPES, f as InputOutputType, J as JsonSerializable, g as LangWatchSpanMetrics, h as LangWatchSpanOptions, i as LangWatchSpanRAGContext, j as LangWatchTracer, S as SimpleChatMessage, k as SpanType, l as emitEvaluationEvent, s as spanTypes } from '../types-
|
|
5
|
+
import { L as LangWatchSpan } from '../types-Cg_frfBV.js';
|
|
6
|
+
export { A as AddEvaluationParams, E as EvaluationStatus, e as EvaluationTimestamps, I as INPUT_OUTPUT_TYPES, f as InputOutputType, J as JsonSerializable, g as LangWatchSpanMetrics, h as LangWatchSpanOptions, i as LangWatchSpanRAGContext, j as LangWatchTracer, S as SimpleChatMessage, k as SpanType, l as emitEvaluationEvent, s as spanTypes } from '../types-Cg_frfBV.js';
|
|
7
7
|
import { Span } from '@opentelemetry/api';
|
|
8
8
|
export { S as SemConvAttributeKey, a as SemConvAttributes, b as SemConvLogRecordAttributes, l as attributes } from '../types-VOZv9LYO.js';
|
|
9
9
|
import '@opentelemetry/sdk-trace-base';
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk73QOHSHUjs = require('../chunk-73QOHSHU.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk4ERRCKOHjs = require('../chunk-4ERRCKOH.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkFJ6JSLLEjs = require('../chunk-FJ6JSLLE.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkLCG5Y2EGjs = require('../chunk-LCG5Y2EG.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -38,5 +38,5 @@ var _chunkCLTKABMOjs = require('../chunk-CLTKABMO.js');
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
exports.DataCapturePresets =
|
|
41
|
+
exports.DataCapturePresets = _chunk73QOHSHUjs.DataCapturePresets; exports.FilterableBatchSpanProcessor = _chunk73QOHSHUjs.FilterableBatchSpanProcessor; exports.LangWatchExporter = _chunkFJ6JSLLEjs.LangWatchTraceExporter; exports.LangWatchLogsExporter = _chunkFJ6JSLLEjs.LangWatchLogsExporter; exports.LangWatchTraceExporter = _chunkFJ6JSLLEjs.LangWatchTraceExporter; exports.attributes = _chunkLCG5Y2EGjs.attributes_exports; exports.createLangWatchSpan = _chunk4ERRCKOHjs.createLangWatchSpan; exports.emitEvaluationEvent = _chunk4ERRCKOHjs.emitEvaluationEvent; exports.getDataCaptureMode = _chunkLCG5Y2EGjs.getDataCaptureMode; exports.getLangWatchLogger = _chunkFJ6JSLLEjs.getLangWatchLogger; exports.getLangWatchLoggerFromProvider = _chunkFJ6JSLLEjs.getLangWatchLoggerFromProvider; exports.getLangWatchTracer = _chunk4ERRCKOHjs.getLangWatchTracer; exports.getLangWatchTracerFromProvider = _chunk4ERRCKOHjs.getLangWatchTracerFromProvider; exports.shouldCaptureInput = _chunkLCG5Y2EGjs.shouldCaptureInput; exports.shouldCaptureOutput = _chunkLCG5Y2EGjs.shouldCaptureOutput; exports.spanTypes = _chunk4ERRCKOHjs.spanTypes;
|
|
42
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataCapturePresets,
|
|
3
3
|
FilterableBatchSpanProcessor
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-57L2K66L.mjs";
|
|
5
5
|
import {
|
|
6
6
|
createLangWatchSpan,
|
|
7
7
|
emitEvaluationEvent,
|
|
8
8
|
getLangWatchTracer,
|
|
9
9
|
getLangWatchTracerFromProvider,
|
|
10
10
|
spanTypes
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-2HA4SJSD.mjs";
|
|
12
12
|
import {
|
|
13
13
|
LangWatchLogsExporter,
|
|
14
14
|
LangWatchTraceExporter,
|
|
15
15
|
getLangWatchLogger,
|
|
16
16
|
getLangWatchLoggerFromProvider
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-W6NUS5XK.mjs";
|
|
18
18
|
import {
|
|
19
19
|
attributes_exports,
|
|
20
20
|
getDataCaptureMode,
|
|
21
21
|
shouldCaptureInput,
|
|
22
22
|
shouldCaptureOutput
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-WMDQVWA6.mjs";
|
|
24
24
|
export {
|
|
25
25
|
DataCapturePresets,
|
|
26
26
|
FilterableBatchSpanProcessor,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _opentelemetry_api from '@opentelemetry/api';
|
|
2
2
|
import { Attributes } from '@opentelemetry/api';
|
|
3
|
-
import { j as LangWatchTracer, L as LangWatchSpan, m as ChatMessage } from '../../../types-
|
|
3
|
+
import { j as LangWatchTracer, L as LangWatchSpan, m as ChatMessage } from '../../../types-DQqmFCDl.mjs';
|
|
4
4
|
import { AgentAction, AgentFinish } from '@langchain/core/agents';
|
|
5
5
|
import { BaseCallbackHandler } from '@langchain/core/callbacks/base';
|
|
6
6
|
import { DocumentInterface } from '@langchain/core/documents';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _opentelemetry_api from '@opentelemetry/api';
|
|
2
2
|
import { Attributes } from '@opentelemetry/api';
|
|
3
|
-
import { j as LangWatchTracer, L as LangWatchSpan, m as ChatMessage } from '../../../types-
|
|
3
|
+
import { j as LangWatchTracer, L as LangWatchSpan, m as ChatMessage } from '../../../types-Cg_frfBV.js';
|
|
4
4
|
import { AgentAction, AgentFinish } from '@langchain/core/agents';
|
|
5
5
|
import { BaseCallbackHandler } from '@langchain/core/callbacks/base';
|
|
6
6
|
import { DocumentInterface } from '@langchain/core/documents';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk4ERRCKOHjs = require('../../../chunk-4ERRCKOH.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkLCG5Y2EGjs = require('../../../chunk-LCG5Y2EG.js');
|
|
10
10
|
|
|
11
11
|
// src/observability-sdk/instrumentation/langchain/index.ts
|
|
12
12
|
var _base = require('@langchain/core/callbacks/base');
|
|
@@ -29,7 +29,7 @@ var LangWatchCallbackHandler = class extends _base.BaseCallbackHandler {
|
|
|
29
29
|
constructor() {
|
|
30
30
|
super(...arguments);
|
|
31
31
|
this.name = "LangWatchCallbackHandler";
|
|
32
|
-
this.tracer =
|
|
32
|
+
this.tracer = _chunk4ERRCKOHjs.getLangWatchTracer.call(void 0, "langwatch.instrumentation.langchain");
|
|
33
33
|
this.spans = {};
|
|
34
34
|
this.parentOf = {};
|
|
35
35
|
this.skipped = {};
|
|
@@ -64,7 +64,7 @@ var LangWatchCallbackHandler = class extends _base.BaseCallbackHandler {
|
|
|
64
64
|
span.setType(type);
|
|
65
65
|
if ((_a = args.tags) == null ? void 0 : _a.length)
|
|
66
66
|
span.setAttribute("langwatch.langchain.run.tags", args.tags.slice(0, 50));
|
|
67
|
-
if (
|
|
67
|
+
if (_chunkLCG5Y2EGjs.shouldCaptureInput.call(void 0, ) && args.input !== void 0) {
|
|
68
68
|
const i = args.input;
|
|
69
69
|
if (i && typeof i === "object" && "type" in i && "value" in i) {
|
|
70
70
|
span.setInput(i.type, i.value);
|
|
@@ -104,7 +104,7 @@ var LangWatchCallbackHandler = class extends _base.BaseCallbackHandler {
|
|
|
104
104
|
if (end.err) {
|
|
105
105
|
span.recordException(end.err);
|
|
106
106
|
span.setStatus({ code: _api.SpanStatusCode.ERROR, message: end.err.message });
|
|
107
|
-
} else if (
|
|
107
|
+
} else if (_chunkLCG5Y2EGjs.shouldCaptureOutput.call(void 0, ) && end.output !== void 0) {
|
|
108
108
|
span.setOutput(end.output);
|
|
109
109
|
}
|
|
110
110
|
span.end();
|
|
@@ -114,7 +114,7 @@ var LangWatchCallbackHandler = class extends _base.BaseCallbackHandler {
|
|
|
114
114
|
this.seenStarts.delete(runId);
|
|
115
115
|
}
|
|
116
116
|
async handleLLMStart(llm, prompts, runId, parentRunId, extraParams, tags, metadata, name) {
|
|
117
|
-
const input =
|
|
117
|
+
const input = _chunkLCG5Y2EGjs.shouldCaptureInput.call(void 0, ) && prompts ? {
|
|
118
118
|
type: "list",
|
|
119
119
|
value: prompts.map((p) => ({ type: "text", value: p }))
|
|
120
120
|
} : void 0;
|
|
@@ -131,7 +131,7 @@ var LangWatchCallbackHandler = class extends _base.BaseCallbackHandler {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
async handleChatModelStart(llm, messages, runId, parentRunId, extraParams, tags, metadata, name) {
|
|
134
|
-
const input =
|
|
134
|
+
const input = _chunkLCG5Y2EGjs.shouldCaptureInput.call(void 0, ) ? {
|
|
135
135
|
type: "chat_messages",
|
|
136
136
|
value: messages.flatMap(convertFromLangChainMessages)
|
|
137
137
|
} : void 0;
|
|
@@ -158,7 +158,7 @@ var LangWatchCallbackHandler = class extends _base.BaseCallbackHandler {
|
|
|
158
158
|
"gen_ai.usage.total_tokens": (_d = tu.totalTokens) != null ? _d : 0
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
|
-
const outputs =
|
|
161
|
+
const outputs = _chunkLCG5Y2EGjs.shouldCaptureOutput.call(void 0, ) ? response.generations.flat().map((g) => {
|
|
162
162
|
if ("message" in g && g.message) {
|
|
163
163
|
return convertFromLangChainMessages([
|
|
164
164
|
g.message
|
|
@@ -186,7 +186,7 @@ var LangWatchCallbackHandler = class extends _base.BaseCallbackHandler {
|
|
|
186
186
|
metadata,
|
|
187
187
|
tags,
|
|
188
188
|
name,
|
|
189
|
-
input:
|
|
189
|
+
input: _chunkLCG5Y2EGjs.shouldCaptureInput.call(void 0, ) ? inputs : void 0
|
|
190
190
|
});
|
|
191
191
|
if (_runType) {
|
|
192
192
|
const span = this.spans[runId];
|
|
@@ -214,7 +214,7 @@ var LangWatchCallbackHandler = class extends _base.BaseCallbackHandler {
|
|
|
214
214
|
metadata,
|
|
215
215
|
tags,
|
|
216
216
|
name,
|
|
217
|
-
input:
|
|
217
|
+
input: _chunkLCG5Y2EGjs.shouldCaptureInput.call(void 0, ) ? { type: "text", value: input } : void 0
|
|
218
218
|
});
|
|
219
219
|
const span = this.spans[runId];
|
|
220
220
|
if (span) {
|
|
@@ -226,7 +226,7 @@ var LangWatchCallbackHandler = class extends _base.BaseCallbackHandler {
|
|
|
226
226
|
}
|
|
227
227
|
async handleToolEnd(output, runId, parentRunId) {
|
|
228
228
|
this.finishRun(runId, {
|
|
229
|
-
output:
|
|
229
|
+
output: _chunkLCG5Y2EGjs.shouldCaptureOutput.call(void 0, ) ? { type: "text", value: output } : void 0,
|
|
230
230
|
event: "handleToolEnd",
|
|
231
231
|
parentRunId
|
|
232
232
|
});
|
|
@@ -243,7 +243,7 @@ var LangWatchCallbackHandler = class extends _base.BaseCallbackHandler {
|
|
|
243
243
|
metadata,
|
|
244
244
|
tags,
|
|
245
245
|
name,
|
|
246
|
-
input:
|
|
246
|
+
input: _chunkLCG5Y2EGjs.shouldCaptureInput.call(void 0, ) ? { type: "text", value: query } : void 0
|
|
247
247
|
});
|
|
248
248
|
const span = this.spans[runId];
|
|
249
249
|
if (span) {
|
|
@@ -255,10 +255,10 @@ var LangWatchCallbackHandler = class extends _base.BaseCallbackHandler {
|
|
|
255
255
|
}
|
|
256
256
|
async handleRetrieverEnd(documents, runId, parentRunId, tags) {
|
|
257
257
|
const span = this.spans[runId];
|
|
258
|
-
if (span &&
|
|
258
|
+
if (span && _chunkLCG5Y2EGjs.shouldCaptureOutput.call(void 0, )) {
|
|
259
259
|
span.setOutput(documents);
|
|
260
260
|
}
|
|
261
|
-
if (span &&
|
|
261
|
+
if (span && _chunkLCG5Y2EGjs.shouldCaptureInput.call(void 0, )) {
|
|
262
262
|
span.setRAGContexts(
|
|
263
263
|
documents.map((document) => ({
|
|
264
264
|
document_id: document.metadata.id,
|
|
@@ -286,7 +286,7 @@ var LangWatchCallbackHandler = class extends _base.BaseCallbackHandler {
|
|
|
286
286
|
}
|
|
287
287
|
async handleAgentEnd(action, runId, parentRunId, tags) {
|
|
288
288
|
this.finishRun(runId, {
|
|
289
|
-
output:
|
|
289
|
+
output: _chunkLCG5Y2EGjs.shouldCaptureOutput.call(void 0, ) ? { type: "json", value: action.returnValues } : void 0,
|
|
290
290
|
event: "handleAgentEnd",
|
|
291
291
|
parentRunId,
|
|
292
292
|
tags
|
|
@@ -328,7 +328,7 @@ function convertFromLangChainMessage(message) {
|
|
|
328
328
|
(c) => (c == null ? void 0 : c.type) === "text" ? { type: "text", text: c.text } : (c == null ? void 0 : c.type) === "image_url" ? { type: "image_url", image_url: c.image_url } : { type: "text", text: JSON.stringify(c) }
|
|
329
329
|
) : JSON.stringify(message.content);
|
|
330
330
|
const functionCall = message.additional_kwargs;
|
|
331
|
-
return
|
|
331
|
+
return _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {
|
|
332
332
|
role,
|
|
333
333
|
content
|
|
334
334
|
}, functionCall && typeof functionCall === "object" && Object.keys(functionCall).length > 0 ? { function_call: functionCall } : {});
|
|
@@ -360,7 +360,7 @@ function wrapNonScalarValues(value) {
|
|
|
360
360
|
if (value === null) return JSON.stringify(null);
|
|
361
361
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean")
|
|
362
362
|
return value;
|
|
363
|
-
const chatMessages =
|
|
363
|
+
const chatMessages = _chunk4ERRCKOHjs.chatMessageSchema.array().safeParse(value);
|
|
364
364
|
if (Array.isArray(value) && chatMessages.success) {
|
|
365
365
|
return JSON.stringify({ type: "chat_messages", value: chatMessages.data });
|
|
366
366
|
}
|
|
@@ -379,7 +379,7 @@ function wrapNonScalarValues(value) {
|
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
function addLangChainEvent(span, eventName, runId, parentRunId, tags, metadata, attributes) {
|
|
382
|
-
const attrs =
|
|
382
|
+
const attrs = _chunkLCG5Y2EGjs.__spreadValues.call(void 0, {
|
|
383
383
|
"langwatch.langchain.run.id": runId,
|
|
384
384
|
"langwatch.langchain.run.parent_id": parentRunId,
|
|
385
385
|
"langwatch.langchain.event.name": eventName
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
chatMessageSchema,
|
|
3
3
|
getLangWatchTracer
|
|
4
|
-
} from "../../../chunk-
|
|
4
|
+
} from "../../../chunk-2HA4SJSD.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__spreadValues,
|
|
7
7
|
shouldCaptureInput,
|
|
8
8
|
shouldCaptureOutput
|
|
9
|
-
} from "../../../chunk-
|
|
9
|
+
} from "../../../chunk-WMDQVWA6.mjs";
|
|
10
10
|
|
|
11
11
|
// src/observability-sdk/instrumentation/langchain/index.ts
|
|
12
12
|
import { BaseCallbackHandler } from "@langchain/core/callbacks/base";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../../../chunk-
|
|
6
|
-
require('../../../chunk-
|
|
4
|
+
var _chunkKS7O6FTOjs = require('../../../chunk-KS7O6FTO.js');
|
|
5
|
+
require('../../../chunk-FJ6JSLLE.js');
|
|
6
|
+
require('../../../chunk-LCG5Y2EG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.ensureSetup =
|
|
10
|
+
exports.ensureSetup = _chunkKS7O6FTOjs.ensureSetup; exports.setupObservability = _chunkKS7O6FTOjs.setupObservability;
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureSetup,
|
|
3
3
|
setupObservability
|
|
4
|
-
} from "../../../chunk-
|
|
5
|
-
import "../../../chunk-
|
|
6
|
-
import "../../../chunk-
|
|
4
|
+
} from "../../../chunk-YEKLDVGO.mjs";
|
|
5
|
+
import "../../../chunk-W6NUS5XK.mjs";
|
|
6
|
+
import "../../../chunk-WMDQVWA6.mjs";
|
|
7
7
|
export {
|
|
8
8
|
ensureSetup,
|
|
9
9
|
setupObservability
|
|
@@ -3407,6 +3407,23 @@ interface paths {
|
|
|
3407
3407
|
patch?: never;
|
|
3408
3408
|
trace?: never;
|
|
3409
3409
|
};
|
|
3410
|
+
"/api/simulation-runs/batches/{batchRunId}": {
|
|
3411
|
+
parameters: {
|
|
3412
|
+
query?: never;
|
|
3413
|
+
header?: never;
|
|
3414
|
+
path?: never;
|
|
3415
|
+
cookie?: never;
|
|
3416
|
+
};
|
|
3417
|
+
/** @description Get the summary of a single batch run, including its completion flag */
|
|
3418
|
+
get: operations["getApiSimulationRunsBatchesByBatchRunId"];
|
|
3419
|
+
put?: never;
|
|
3420
|
+
post?: never;
|
|
3421
|
+
delete?: never;
|
|
3422
|
+
options?: never;
|
|
3423
|
+
head?: never;
|
|
3424
|
+
patch?: never;
|
|
3425
|
+
trace?: never;
|
|
3426
|
+
};
|
|
3410
3427
|
"/api/suites": {
|
|
3411
3428
|
parameters: {
|
|
3412
3429
|
query?: never;
|
|
@@ -10632,6 +10649,15 @@ interface operations {
|
|
|
10632
10649
|
/** @default null */
|
|
10633
10650
|
rpd?: number | null;
|
|
10634
10651
|
};
|
|
10652
|
+
/**
|
|
10653
|
+
* @default {
|
|
10654
|
+
* "maxOpenSessions": null
|
|
10655
|
+
* }
|
|
10656
|
+
*/
|
|
10657
|
+
realtime?: {
|
|
10658
|
+
/** @default null */
|
|
10659
|
+
maxOpenSessions?: number | null;
|
|
10660
|
+
};
|
|
10635
10661
|
/**
|
|
10636
10662
|
* @default {
|
|
10637
10663
|
* "tags": []
|
|
@@ -11062,6 +11088,15 @@ interface operations {
|
|
|
11062
11088
|
/** @default null */
|
|
11063
11089
|
rpd?: number | null;
|
|
11064
11090
|
};
|
|
11091
|
+
/**
|
|
11092
|
+
* @default {
|
|
11093
|
+
* "maxOpenSessions": null
|
|
11094
|
+
* }
|
|
11095
|
+
*/
|
|
11096
|
+
realtime?: {
|
|
11097
|
+
/** @default null */
|
|
11098
|
+
maxOpenSessions?: number | null;
|
|
11099
|
+
};
|
|
11065
11100
|
/**
|
|
11066
11101
|
* @default {
|
|
11067
11102
|
* "tags": []
|
|
@@ -21614,7 +21649,10 @@ interface operations {
|
|
|
21614
21649
|
parameters: {
|
|
21615
21650
|
name: string;
|
|
21616
21651
|
description?: string;
|
|
21652
|
+
/** @description The value the run uses when it supplies none. A secret parameter cannot carry one. */
|
|
21617
21653
|
defaultValue?: string | number | boolean;
|
|
21654
|
+
/** @description Whether the value is a credential, supplied when the run starts and delivered to the target as secrets.NAME. A secret parameter is rejected when it also carries defaultValue. */
|
|
21655
|
+
secret?: boolean;
|
|
21618
21656
|
}[];
|
|
21619
21657
|
/** Format: uri */
|
|
21620
21658
|
platformUrl: string;
|
|
@@ -21687,11 +21725,14 @@ interface operations {
|
|
|
21687
21725
|
criteria?: string[];
|
|
21688
21726
|
/** @default [] */
|
|
21689
21727
|
labels?: string[];
|
|
21690
|
-
/** @description The parameters this scenario declares by name, each with an optional description and default. A run supplies values for these names, readable from the scenario's own text as params.NAME. */
|
|
21728
|
+
/** @description The parameters this scenario declares by name, each with an optional description and default. A run supplies values for these names, readable from the scenario's own text as params.NAME. A parameter marked secret carries no default: its value is supplied per run, encrypted, delivered to the target as secrets.NAME, and never readable from the scenario's own text. */
|
|
21691
21729
|
parameters?: {
|
|
21692
21730
|
name: string;
|
|
21693
21731
|
description?: string;
|
|
21732
|
+
/** @description The value the run uses when it supplies none. A secret parameter cannot carry one. */
|
|
21694
21733
|
defaultValue?: string | number | boolean;
|
|
21734
|
+
/** @description Whether the value is a credential, supplied when the run starts and delivered to the target as secrets.NAME. A secret parameter is rejected when it also carries defaultValue. */
|
|
21735
|
+
secret?: boolean;
|
|
21695
21736
|
}[];
|
|
21696
21737
|
};
|
|
21697
21738
|
};
|
|
@@ -21712,7 +21753,10 @@ interface operations {
|
|
|
21712
21753
|
parameters: {
|
|
21713
21754
|
name: string;
|
|
21714
21755
|
description?: string;
|
|
21756
|
+
/** @description The value the run uses when it supplies none. A secret parameter cannot carry one. */
|
|
21715
21757
|
defaultValue?: string | number | boolean;
|
|
21758
|
+
/** @description Whether the value is a credential, supplied when the run starts and delivered to the target as secrets.NAME. A secret parameter is rejected when it also carries defaultValue. */
|
|
21759
|
+
secret?: boolean;
|
|
21716
21760
|
}[];
|
|
21717
21761
|
/** Format: uri */
|
|
21718
21762
|
platformUrl: string;
|
|
@@ -21795,7 +21839,10 @@ interface operations {
|
|
|
21795
21839
|
parameters: {
|
|
21796
21840
|
name: string;
|
|
21797
21841
|
description?: string;
|
|
21842
|
+
/** @description The value the run uses when it supplies none. A secret parameter cannot carry one. */
|
|
21798
21843
|
defaultValue?: string | number | boolean;
|
|
21844
|
+
/** @description Whether the value is a credential, supplied when the run starts and delivered to the target as secrets.NAME. A secret parameter is rejected when it also carries defaultValue. */
|
|
21845
|
+
secret?: boolean;
|
|
21799
21846
|
}[];
|
|
21800
21847
|
/** Format: uri */
|
|
21801
21848
|
platformUrl: string;
|
|
@@ -21880,11 +21927,14 @@ interface operations {
|
|
|
21880
21927
|
situation?: string;
|
|
21881
21928
|
criteria?: string[];
|
|
21882
21929
|
labels?: string[];
|
|
21883
|
-
/** @description The parameters this scenario declares by name, each with an optional description and default. A run supplies values for these names, readable from the scenario's own text as params.NAME. */
|
|
21930
|
+
/** @description The parameters this scenario declares by name, each with an optional description and default. A run supplies values for these names, readable from the scenario's own text as params.NAME. A parameter marked secret carries no default: its value is supplied per run, encrypted, delivered to the target as secrets.NAME, and never readable from the scenario's own text. */
|
|
21884
21931
|
parameters?: {
|
|
21885
21932
|
name: string;
|
|
21886
21933
|
description?: string;
|
|
21934
|
+
/** @description The value the run uses when it supplies none. A secret parameter cannot carry one. */
|
|
21887
21935
|
defaultValue?: string | number | boolean;
|
|
21936
|
+
/** @description Whether the value is a credential, supplied when the run starts and delivered to the target as secrets.NAME. A secret parameter is rejected when it also carries defaultValue. */
|
|
21937
|
+
secret?: boolean;
|
|
21888
21938
|
}[];
|
|
21889
21939
|
};
|
|
21890
21940
|
};
|
|
@@ -21905,7 +21955,10 @@ interface operations {
|
|
|
21905
21955
|
parameters: {
|
|
21906
21956
|
name: string;
|
|
21907
21957
|
description?: string;
|
|
21958
|
+
/** @description The value the run uses when it supplies none. A secret parameter cannot carry one. */
|
|
21908
21959
|
defaultValue?: string | number | boolean;
|
|
21960
|
+
/** @description Whether the value is a credential, supplied when the run starts and delivered to the target as secrets.NAME. A secret parameter is rejected when it also carries defaultValue. */
|
|
21961
|
+
secret?: boolean;
|
|
21909
21962
|
}[];
|
|
21910
21963
|
/** Format: uri */
|
|
21911
21964
|
platformUrl: string;
|
|
@@ -23082,11 +23135,18 @@ interface operations {
|
|
|
23082
23135
|
passCount: number;
|
|
23083
23136
|
failCount: number;
|
|
23084
23137
|
runningCount: number;
|
|
23138
|
+
settledCount: number;
|
|
23085
23139
|
stalledCount: number;
|
|
23086
23140
|
lastRunAt: number;
|
|
23087
23141
|
lastUpdatedAt: number;
|
|
23088
23142
|
firstCompletedAt: number | null;
|
|
23143
|
+
/**
|
|
23144
|
+
* @deprecated
|
|
23145
|
+
* @description Deprecated: read settledCount and isComplete instead. It carries the last update time of a batch where no run is running.
|
|
23146
|
+
*/
|
|
23089
23147
|
allCompletedAt: number | null;
|
|
23148
|
+
/** @description True when every run of the batch reached a terminal status. */
|
|
23149
|
+
isComplete: boolean;
|
|
23090
23150
|
}[];
|
|
23091
23151
|
hasMore?: boolean;
|
|
23092
23152
|
nextCursor?: string;
|
|
@@ -23143,6 +23203,106 @@ interface operations {
|
|
|
23143
23203
|
};
|
|
23144
23204
|
};
|
|
23145
23205
|
};
|
|
23206
|
+
getApiSimulationRunsBatchesByBatchRunId: {
|
|
23207
|
+
parameters: {
|
|
23208
|
+
query?: never;
|
|
23209
|
+
header?: never;
|
|
23210
|
+
path: {
|
|
23211
|
+
batchRunId: string;
|
|
23212
|
+
};
|
|
23213
|
+
cookie?: never;
|
|
23214
|
+
};
|
|
23215
|
+
requestBody?: never;
|
|
23216
|
+
responses: {
|
|
23217
|
+
/** @description Success */
|
|
23218
|
+
200: {
|
|
23219
|
+
headers: {
|
|
23220
|
+
[name: string]: unknown;
|
|
23221
|
+
};
|
|
23222
|
+
content: {
|
|
23223
|
+
"application/json": {
|
|
23224
|
+
batchRunId: string;
|
|
23225
|
+
totalCount: number;
|
|
23226
|
+
passCount: number;
|
|
23227
|
+
failCount: number;
|
|
23228
|
+
runningCount: number;
|
|
23229
|
+
settledCount: number;
|
|
23230
|
+
stalledCount: number;
|
|
23231
|
+
lastRunAt: number;
|
|
23232
|
+
lastUpdatedAt: number;
|
|
23233
|
+
firstCompletedAt: number | null;
|
|
23234
|
+
/**
|
|
23235
|
+
* @deprecated
|
|
23236
|
+
* @description Deprecated: read settledCount and isComplete instead. It carries the last update time of a batch where no run is running.
|
|
23237
|
+
*/
|
|
23238
|
+
allCompletedAt: number | null;
|
|
23239
|
+
/** @description True when every run of the batch reached a terminal status. */
|
|
23240
|
+
isComplete: boolean;
|
|
23241
|
+
};
|
|
23242
|
+
};
|
|
23243
|
+
};
|
|
23244
|
+
/** @description Bad Request */
|
|
23245
|
+
400: {
|
|
23246
|
+
headers: {
|
|
23247
|
+
[name: string]: unknown;
|
|
23248
|
+
};
|
|
23249
|
+
content: {
|
|
23250
|
+
"application/json": {
|
|
23251
|
+
error: string;
|
|
23252
|
+
message?: string;
|
|
23253
|
+
};
|
|
23254
|
+
};
|
|
23255
|
+
};
|
|
23256
|
+
/** @description Unauthorized */
|
|
23257
|
+
401: {
|
|
23258
|
+
headers: {
|
|
23259
|
+
[name: string]: unknown;
|
|
23260
|
+
};
|
|
23261
|
+
content: {
|
|
23262
|
+
"application/json": {
|
|
23263
|
+
error: string;
|
|
23264
|
+
message?: string;
|
|
23265
|
+
};
|
|
23266
|
+
};
|
|
23267
|
+
};
|
|
23268
|
+
/** @description Batch run not found */
|
|
23269
|
+
404: {
|
|
23270
|
+
headers: {
|
|
23271
|
+
[name: string]: unknown;
|
|
23272
|
+
};
|
|
23273
|
+
content: {
|
|
23274
|
+
"application/json": {
|
|
23275
|
+
error: string;
|
|
23276
|
+
message?: string;
|
|
23277
|
+
};
|
|
23278
|
+
};
|
|
23279
|
+
};
|
|
23280
|
+
/** @description Unprocessable Entity */
|
|
23281
|
+
422: {
|
|
23282
|
+
headers: {
|
|
23283
|
+
[name: string]: unknown;
|
|
23284
|
+
};
|
|
23285
|
+
content: {
|
|
23286
|
+
"application/json": {
|
|
23287
|
+
error: string;
|
|
23288
|
+
message?: string;
|
|
23289
|
+
};
|
|
23290
|
+
};
|
|
23291
|
+
};
|
|
23292
|
+
/** @description Internal Server Error */
|
|
23293
|
+
500: {
|
|
23294
|
+
headers: {
|
|
23295
|
+
[name: string]: unknown;
|
|
23296
|
+
};
|
|
23297
|
+
content: {
|
|
23298
|
+
"application/json": {
|
|
23299
|
+
error: string;
|
|
23300
|
+
message?: string;
|
|
23301
|
+
};
|
|
23302
|
+
};
|
|
23303
|
+
};
|
|
23304
|
+
};
|
|
23305
|
+
};
|
|
23146
23306
|
getApiSuites: {
|
|
23147
23307
|
parameters: {
|
|
23148
23308
|
query?: never;
|