@voltagent/core 1.1.38 → 1.1.39
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/index.js +38 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3899,6 +3899,16 @@ var WebSocketSpanProcessor = class {
|
|
|
3899
3899
|
if (!this.enabled) return;
|
|
3900
3900
|
const parentSpan = import_api5.trace.getSpan(parentContext);
|
|
3901
3901
|
const parentSpanId = parentSpan ? parentSpan.spanContext().spanId : void 0;
|
|
3902
|
+
const spanLinks = span.links;
|
|
3903
|
+
const links = spanLinks && spanLinks.length > 0 ? spanLinks.map((link) => ({
|
|
3904
|
+
context: {
|
|
3905
|
+
traceId: link.context.traceId,
|
|
3906
|
+
spanId: link.context.spanId,
|
|
3907
|
+
traceFlags: link.context.traceFlags,
|
|
3908
|
+
traceState: link.context.traceState
|
|
3909
|
+
},
|
|
3910
|
+
attributes: link.attributes
|
|
3911
|
+
})) : void 0;
|
|
3902
3912
|
const observabilitySpan = {
|
|
3903
3913
|
traceId: span.spanContext().traceId,
|
|
3904
3914
|
spanId: span.spanContext().spanId,
|
|
@@ -3908,7 +3918,8 @@ var WebSocketSpanProcessor = class {
|
|
|
3908
3918
|
startTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3909
3919
|
attributes: span.attributes || {},
|
|
3910
3920
|
status: { code: 0 },
|
|
3911
|
-
events: []
|
|
3921
|
+
events: [],
|
|
3922
|
+
links
|
|
3912
3923
|
};
|
|
3913
3924
|
const event = {
|
|
3914
3925
|
type: "span:start",
|
|
@@ -10700,34 +10711,30 @@ async function runEvalScorers(host, args) {
|
|
|
10700
10711
|
`eval.scorer.${definition.id}`,
|
|
10701
10712
|
{
|
|
10702
10713
|
kind: import_api10.SpanKind.INTERNAL,
|
|
10703
|
-
attributes: {
|
|
10714
|
+
attributes: {
|
|
10715
|
+
"span.type": "scorer",
|
|
10716
|
+
"voltagent.label": definition.name ?? descriptor.key ?? definition.id,
|
|
10717
|
+
"entity.id": host.id,
|
|
10718
|
+
"entity.type": "agent",
|
|
10719
|
+
"entity.name": host.name,
|
|
10720
|
+
"eval.scorer.id": definition.id,
|
|
10721
|
+
"eval.scorer.key": descriptor.key,
|
|
10722
|
+
"eval.scorer.name": definition.name ?? definition.id,
|
|
10723
|
+
"eval.scorer.kind": "live",
|
|
10724
|
+
"eval.scorer.status": "running",
|
|
10725
|
+
"eval.operation.id": storagePayload.operationId,
|
|
10726
|
+
"eval.operation.type": storagePayload.operationType,
|
|
10727
|
+
"eval.trace.id": storagePayload.traceId,
|
|
10728
|
+
"eval.source.span_id": storagePayload.spanId,
|
|
10729
|
+
"eval.trigger_source": config.triggerSource ?? "live",
|
|
10730
|
+
"eval.environment": config.environment,
|
|
10731
|
+
...storagePayload.userId ? { "user.id": storagePayload.userId } : {},
|
|
10732
|
+
...storagePayload.conversationId ? { "conversation.id": storagePayload.conversationId } : {}
|
|
10733
|
+
},
|
|
10704
10734
|
links
|
|
10705
10735
|
},
|
|
10706
10736
|
parentContext
|
|
10707
10737
|
);
|
|
10708
|
-
span.setAttributes({
|
|
10709
|
-
"voltagent.label": definition.name ?? descriptor.key ?? definition.id,
|
|
10710
|
-
"entity.id": host.id,
|
|
10711
|
-
"entity.type": "agent",
|
|
10712
|
-
"entity.name": host.name,
|
|
10713
|
-
"eval.scorer.id": definition.id,
|
|
10714
|
-
"eval.scorer.key": descriptor.key,
|
|
10715
|
-
"eval.scorer.name": definition.name ?? definition.id,
|
|
10716
|
-
"eval.scorer.kind": "live",
|
|
10717
|
-
"eval.scorer.status": "running",
|
|
10718
|
-
"eval.operation.id": storagePayload.operationId,
|
|
10719
|
-
"eval.operation.type": storagePayload.operationType,
|
|
10720
|
-
"eval.trace.id": storagePayload.traceId,
|
|
10721
|
-
"eval.source.span_id": storagePayload.spanId,
|
|
10722
|
-
"eval.trigger_source": config.triggerSource ?? "live",
|
|
10723
|
-
"eval.environment": config.environment
|
|
10724
|
-
});
|
|
10725
|
-
if (storagePayload.userId) {
|
|
10726
|
-
span.setAttribute("user.id", storagePayload.userId);
|
|
10727
|
-
}
|
|
10728
|
-
if (storagePayload.conversationId) {
|
|
10729
|
-
span.setAttribute("conversation.id", storagePayload.conversationId);
|
|
10730
|
-
}
|
|
10731
10738
|
span.addEvent("eval.scorer.started");
|
|
10732
10739
|
const spanContext = import_api10.trace.setSpan(parentContext, span);
|
|
10733
10740
|
return {
|
|
@@ -12398,7 +12405,8 @@ async function runInputGuardrails(input, oc, guardrails, operation, agent) {
|
|
|
12398
12405
|
{
|
|
12399
12406
|
label: guardrail.name,
|
|
12400
12407
|
attributes: {
|
|
12401
|
-
|
|
12408
|
+
// entity.type and entity.id are inherited from parent via commonAttributes
|
|
12409
|
+
"guardrail.type": "guardrail" /* GUARDRAIL */,
|
|
12402
12410
|
"guardrail.direction": "input",
|
|
12403
12411
|
"guardrail.operation": operation,
|
|
12404
12412
|
"guardrail.index": index,
|
|
@@ -12504,7 +12512,8 @@ async function runOutputGuardrails({
|
|
|
12504
12512
|
{
|
|
12505
12513
|
label: guardrail.name,
|
|
12506
12514
|
attributes: {
|
|
12507
|
-
|
|
12515
|
+
// entity.type and entity.id are inherited from parent via commonAttributes
|
|
12516
|
+
"guardrail.type": "guardrail" /* GUARDRAIL */,
|
|
12508
12517
|
"guardrail.direction": "output",
|
|
12509
12518
|
"guardrail.operation": operation,
|
|
12510
12519
|
"guardrail.index": index,
|
|
@@ -13261,7 +13270,8 @@ var OutputGuardrailStreamRunner = class {
|
|
|
13261
13270
|
{
|
|
13262
13271
|
label: guardrail.name,
|
|
13263
13272
|
attributes: {
|
|
13264
|
-
|
|
13273
|
+
// entity.type and entity.id are inherited from parent via commonAttributes
|
|
13274
|
+
"guardrail.type": "guardrail" /* GUARDRAIL */,
|
|
13265
13275
|
"guardrail.direction": "output",
|
|
13266
13276
|
"guardrail.mode": "stream",
|
|
13267
13277
|
"guardrail.operation": this.operation,
|