@arizeai/openinference-instrumentation-beeai 1.0.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/LICENSE +201 -0
- package/README.md +80 -0
- package/dist/esm/config.d.ts +39 -0
- package/dist/esm/config.d.ts.map +1 -0
- package/dist/esm/config.js +39 -0
- package/dist/esm/config.js.map +1 -0
- package/dist/esm/helpers/buildTraceTree.d.ts +21 -0
- package/dist/esm/helpers/buildTraceTree.d.ts.map +1 -0
- package/dist/esm/helpers/buildTraceTree.js +71 -0
- package/dist/esm/helpers/buildTraceTree.js.map +1 -0
- package/dist/esm/helpers/create-span.d.ts +32 -0
- package/dist/esm/helpers/create-span.d.ts.map +1 -0
- package/dist/esm/helpers/create-span.js +42 -0
- package/dist/esm/helpers/create-span.js.map +1 -0
- package/dist/esm/helpers/getErrorSafe.d.ts +17 -0
- package/dist/esm/helpers/getErrorSafe.d.ts.map +1 -0
- package/dist/esm/helpers/getErrorSafe.js +24 -0
- package/dist/esm/helpers/getErrorSafe.js.map +1 -0
- package/dist/esm/helpers/getSerializedObjectSafe.d.ts +18 -0
- package/dist/esm/helpers/getSerializedObjectSafe.d.ts.map +1 -0
- package/dist/esm/helpers/getSerializedObjectSafe.js +217 -0
- package/dist/esm/helpers/getSerializedObjectSafe.js.map +1 -0
- package/dist/esm/helpers/idNameManager.d.ts +31 -0
- package/dist/esm/helpers/idNameManager.d.ts.map +1 -0
- package/dist/esm/helpers/idNameManager.js +50 -0
- package/dist/esm/helpers/idNameManager.js.map +1 -0
- package/dist/esm/helpers/traceSerializer.d.ts +19 -0
- package/dist/esm/helpers/traceSerializer.d.ts.map +1 -0
- package/dist/esm/helpers/traceSerializer.js +35 -0
- package/dist/esm/helpers/traceSerializer.js.map +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/instrumentation.d.ts +34 -0
- package/dist/esm/instrumentation.d.ts.map +1 -0
- package/dist/esm/instrumentation.js +71 -0
- package/dist/esm/instrumentation.js.map +1 -0
- package/dist/esm/middleware.d.ts +27 -0
- package/dist/esm/middleware.d.ts.map +1 -0
- package/dist/esm/middleware.js +247 -0
- package/dist/esm/middleware.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/esm/types.d.ts +36 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +17 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esnext/config.d.ts +39 -0
- package/dist/esnext/config.d.ts.map +1 -0
- package/dist/esnext/config.js +39 -0
- package/dist/esnext/config.js.map +1 -0
- package/dist/esnext/helpers/buildTraceTree.d.ts +21 -0
- package/dist/esnext/helpers/buildTraceTree.d.ts.map +1 -0
- package/dist/esnext/helpers/buildTraceTree.js +57 -0
- package/dist/esnext/helpers/buildTraceTree.js.map +1 -0
- package/dist/esnext/helpers/create-span.d.ts +32 -0
- package/dist/esnext/helpers/create-span.d.ts.map +1 -0
- package/dist/esnext/helpers/create-span.js +37 -0
- package/dist/esnext/helpers/create-span.js.map +1 -0
- package/dist/esnext/helpers/getErrorSafe.d.ts +17 -0
- package/dist/esnext/helpers/getErrorSafe.d.ts.map +1 -0
- package/dist/esnext/helpers/getErrorSafe.js +24 -0
- package/dist/esnext/helpers/getErrorSafe.js.map +1 -0
- package/dist/esnext/helpers/getSerializedObjectSafe.d.ts +18 -0
- package/dist/esnext/helpers/getSerializedObjectSafe.d.ts.map +1 -0
- package/dist/esnext/helpers/getSerializedObjectSafe.js +165 -0
- package/dist/esnext/helpers/getSerializedObjectSafe.js.map +1 -0
- package/dist/esnext/helpers/idNameManager.d.ts +31 -0
- package/dist/esnext/helpers/idNameManager.d.ts.map +1 -0
- package/dist/esnext/helpers/idNameManager.js +50 -0
- package/dist/esnext/helpers/idNameManager.js.map +1 -0
- package/dist/esnext/helpers/traceSerializer.d.ts +19 -0
- package/dist/esnext/helpers/traceSerializer.d.ts.map +1 -0
- package/dist/esnext/helpers/traceSerializer.js +35 -0
- package/dist/esnext/helpers/traceSerializer.js.map +1 -0
- package/dist/esnext/index.d.ts +2 -0
- package/dist/esnext/index.d.ts.map +1 -0
- package/dist/esnext/index.js +2 -0
- package/dist/esnext/index.js.map +1 -0
- package/dist/esnext/instrumentation.d.ts +34 -0
- package/dist/esnext/instrumentation.d.ts.map +1 -0
- package/dist/esnext/instrumentation.js +71 -0
- package/dist/esnext/instrumentation.js.map +1 -0
- package/dist/esnext/middleware.d.ts +27 -0
- package/dist/esnext/middleware.d.ts.map +1 -0
- package/dist/esnext/middleware.js +241 -0
- package/dist/esnext/middleware.js.map +1 -0
- package/dist/esnext/tsconfig.esnext.tsbuildinfo +1 -0
- package/dist/esnext/types.d.ts +36 -0
- package/dist/esnext/types.d.ts.map +1 -0
- package/dist/esnext/types.js +17 -0
- package/dist/esnext/types.js.map +1 -0
- package/dist/examples/bee.d.ts +2 -0
- package/dist/examples/bee.d.ts.map +1 -0
- package/dist/examples/bee.js +35 -0
- package/dist/examples/bee.js.map +1 -0
- package/dist/examples/instrumentation.d.ts +2 -0
- package/dist/examples/instrumentation.d.ts.map +1 -0
- package/dist/examples/instrumentation.js +54 -0
- package/dist/examples/instrumentation.js.map +1 -0
- package/dist/src/config.d.ts +39 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +42 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/helpers/buildTraceTree.d.ts +21 -0
- package/dist/src/helpers/buildTraceTree.d.ts.map +1 -0
- package/dist/src/helpers/buildTraceTree.js +60 -0
- package/dist/src/helpers/buildTraceTree.js.map +1 -0
- package/dist/src/helpers/create-span.d.ts +32 -0
- package/dist/src/helpers/create-span.d.ts.map +1 -0
- package/dist/src/helpers/create-span.js +40 -0
- package/dist/src/helpers/create-span.js.map +1 -0
- package/dist/src/helpers/getErrorSafe.d.ts +17 -0
- package/dist/src/helpers/getErrorSafe.d.ts.map +1 -0
- package/dist/src/helpers/getErrorSafe.js +27 -0
- package/dist/src/helpers/getErrorSafe.js.map +1 -0
- package/dist/src/helpers/getSerializedObjectSafe.d.ts +18 -0
- package/dist/src/helpers/getSerializedObjectSafe.d.ts.map +1 -0
- package/dist/src/helpers/getSerializedObjectSafe.js +168 -0
- package/dist/src/helpers/getSerializedObjectSafe.js.map +1 -0
- package/dist/src/helpers/idNameManager.d.ts +31 -0
- package/dist/src/helpers/idNameManager.d.ts.map +1 -0
- package/dist/src/helpers/idNameManager.js +54 -0
- package/dist/src/helpers/idNameManager.js.map +1 -0
- package/dist/src/helpers/traceSerializer.d.ts +19 -0
- package/dist/src/helpers/traceSerializer.d.ts.map +1 -0
- package/dist/src/helpers/traceSerializer.js +38 -0
- package/dist/src/helpers/traceSerializer.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +18 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/instrumentation.d.ts +34 -0
- package/dist/src/instrumentation.d.ts.map +1 -0
- package/dist/src/instrumentation.js +76 -0
- package/dist/src/instrumentation.js.map +1 -0
- package/dist/src/middleware.d.ts +27 -0
- package/dist/src/middleware.d.ts.map +1 -0
- package/dist/src/middleware.js +254 -0
- package/dist/src/middleware.js.map +1 -0
- package/dist/src/types.d.ts +36 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +18 -0
- package/dist/src/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +64 -0
- package/src/config.ts +48 -0
- package/src/helpers/buildTraceTree.ts +118 -0
- package/src/helpers/create-span.ts +66 -0
- package/src/helpers/getErrorSafe.ts +26 -0
- package/src/helpers/getSerializedObjectSafe.ts +325 -0
- package/src/helpers/idNameManager.ts +53 -0
- package/src/helpers/traceSerializer.ts +46 -0
- package/src/index.ts +1 -0
- package/src/instrumentation.ts +123 -0
- package/src/middleware.ts +318 -0
- package/src/types.ts +38 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
|
|
27
|
+
const api_1 = require("@opentelemetry/api");
|
|
28
|
+
const exporter_trace_otlp_proto_1 = require("@opentelemetry/exporter-trace-otlp-proto");
|
|
29
|
+
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
|
|
30
|
+
const openinference_semantic_conventions_1 = require("@arizeai/openinference-semantic-conventions");
|
|
31
|
+
const resources_1 = require("@opentelemetry/resources");
|
|
32
|
+
const beeaiFramework = __importStar(require("beeai-framework"));
|
|
33
|
+
const index_1 = require("../src/index");
|
|
34
|
+
// For troubleshooting, set the log level to DiagLogLevel.DEBUG
|
|
35
|
+
api_1.diag.setLogger(new api_1.DiagConsoleLogger(), api_1.DiagLogLevel.DEBUG);
|
|
36
|
+
/////////////////// instrumentation ///////////////////
|
|
37
|
+
const provider = new sdk_trace_node_1.NodeTracerProvider({
|
|
38
|
+
resource: new resources_1.Resource({
|
|
39
|
+
[semantic_conventions_1.ATTR_SERVICE_NAME]: "beeai",
|
|
40
|
+
[openinference_semantic_conventions_1.SEMRESATTRS_PROJECT_NAME]: "beeai-project",
|
|
41
|
+
}),
|
|
42
|
+
spanProcessors: [
|
|
43
|
+
new sdk_trace_node_1.SimpleSpanProcessor(new sdk_trace_node_1.ConsoleSpanExporter()),
|
|
44
|
+
new sdk_trace_node_1.SimpleSpanProcessor(new exporter_trace_otlp_proto_1.OTLPTraceExporter({
|
|
45
|
+
url: "http://localhost:6006/v1/traces",
|
|
46
|
+
})),
|
|
47
|
+
],
|
|
48
|
+
});
|
|
49
|
+
const beeAIInstrumentation = new index_1.BeeAIInstrumentation();
|
|
50
|
+
beeAIInstrumentation.manuallyInstrument(beeaiFramework);
|
|
51
|
+
provider.register();
|
|
52
|
+
// eslint-disable-next-line no-console
|
|
53
|
+
console.log("👀 OpenInference initialized");
|
|
54
|
+
//# sourceMappingURL=instrumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../examples/instrumentation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAIuC;AACvC,4CAA2E;AAC3E,wFAA6E;AAC7E,8EAAwE;AACxE,oGAAuF;AACvF,wDAAoD;AACpD,gEAAkD;AAClD,wCAAoD;AAEpD,+DAA+D;AAC/D,UAAI,CAAC,SAAS,CAAC,IAAI,uBAAiB,EAAE,EAAE,kBAAY,CAAC,KAAK,CAAC,CAAC;AAE5D,uDAAuD;AACvD,MAAM,QAAQ,GAAG,IAAI,mCAAkB,CAAC;IACtC,QAAQ,EAAE,IAAI,oBAAQ,CAAC;QACrB,CAAC,wCAAiB,CAAC,EAAE,OAAO;QAC5B,CAAC,6DAAwB,CAAC,EAAE,eAAe;KAC5C,CAAC;IACF,cAAc,EAAE;QACd,IAAI,oCAAmB,CAAC,IAAI,oCAAmB,EAAE,CAAC;QAClD,IAAI,oCAAmB,CACrB,IAAI,6CAAiB,CAAC;YACpB,GAAG,EAAE,iCAAiC;SACvC,CAAC,CACH;KACF;CACF,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,IAAI,4BAAoB,EAAE,CAAC;AACxD,oBAAoB,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAExD,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAEpB,sCAAsC;AACtC,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 IBM Corp.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { BeeCallbacks } from "beeai-framework/agents/bee/types";
|
|
17
|
+
import { ChatModelEvents } from "beeai-framework/backend/chat";
|
|
18
|
+
import { ToolEvents } from "beeai-framework/tools/base";
|
|
19
|
+
export declare const INSTRUMENTATION_IGNORED_KEYS: string[];
|
|
20
|
+
export declare const partialUpdateEventName: keyof BeeCallbacks;
|
|
21
|
+
export declare const updateEventName: keyof BeeCallbacks;
|
|
22
|
+
export declare const toolErrorEventName: keyof BeeCallbacks;
|
|
23
|
+
export declare const toolStartEventName: keyof BeeCallbacks;
|
|
24
|
+
export declare const toolSuccessEventName: keyof BeeCallbacks;
|
|
25
|
+
export declare const startEventName: keyof BeeCallbacks;
|
|
26
|
+
export declare const successEventName: keyof BeeCallbacks;
|
|
27
|
+
export declare const errorEventName: keyof BeeCallbacks;
|
|
28
|
+
export declare const retryEventName: keyof BeeCallbacks;
|
|
29
|
+
export declare const newTokenLLMEventName: keyof ChatModelEvents;
|
|
30
|
+
export declare const successLLMEventName: keyof ChatModelEvents;
|
|
31
|
+
export declare const startLLMEventName: keyof ChatModelEvents;
|
|
32
|
+
export declare const errorLLMEventName: keyof ChatModelEvents;
|
|
33
|
+
export declare const finishLLMEventName: keyof ChatModelEvents;
|
|
34
|
+
export declare const startToolEventName: keyof ToolEvents;
|
|
35
|
+
export declare const successToolEventName: keyof ToolEvents;
|
|
36
|
+
export declare const finishToolEventName: keyof ToolEvents;
|
|
37
|
+
export declare const retryToolEventName: keyof ToolEvents;
|
|
38
|
+
export declare const errorToolEventName: keyof ToolEvents;
|
|
39
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,eAAO,MAAM,4BAA4B,UAKnC,CAAC;AAEP,eAAO,MAAM,sBAAsB,EAAE,MAAM,YAA8B,CAAC;AAC1E,eAAO,MAAM,eAAe,EAAE,MAAM,YAAuB,CAAC;AAC5D,eAAO,MAAM,kBAAkB,EAAE,MAAM,YAA0B,CAAC;AAClE,eAAO,MAAM,kBAAkB,EAAE,MAAM,YAA0B,CAAC;AAClE,eAAO,MAAM,oBAAoB,EAAE,MAAM,YAA4B,CAAC;AACtE,eAAO,MAAM,cAAc,EAAE,MAAM,YAAsB,CAAC;AAC1D,eAAO,MAAM,gBAAgB,EAAE,MAAM,YAAwB,CAAC;AAC9D,eAAO,MAAM,cAAc,EAAE,MAAM,YAAsB,CAAC;AAC1D,eAAO,MAAM,cAAc,EAAE,MAAM,YAAsB,CAAC;AAE1D,eAAO,MAAM,oBAAoB,EAAE,MAAM,eAA4B,CAAC;AACtE,eAAO,MAAM,mBAAmB,EAAE,MAAM,eAA2B,CAAC;AACpE,eAAO,MAAM,iBAAiB,EAAE,MAAM,eAAyB,CAAC;AAChE,eAAO,MAAM,iBAAiB,EAAE,MAAM,eAAyB,CAAC;AAChE,eAAO,MAAM,kBAAkB,EAAE,MAAM,eAA0B,CAAC;AAElE,eAAO,MAAM,kBAAkB,EAAE,MAAM,UAAoB,CAAC;AAC5D,eAAO,MAAM,oBAAoB,EAAE,MAAM,UAAsB,CAAC;AAChE,eAAO,MAAM,mBAAmB,EAAE,MAAM,UAAqB,CAAC;AAC9D,eAAO,MAAM,kBAAkB,EAAE,MAAM,UAAoB,CAAC;AAC5D,eAAO,MAAM,kBAAkB,EAAE,MAAM,UAAoB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025 IBM Corp.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.errorToolEventName = exports.retryToolEventName = exports.finishToolEventName = exports.successToolEventName = exports.startToolEventName = exports.finishLLMEventName = exports.errorLLMEventName = exports.startLLMEventName = exports.successLLMEventName = exports.newTokenLLMEventName = exports.retryEventName = exports.errorEventName = exports.successEventName = exports.startEventName = exports.toolSuccessEventName = exports.toolStartEventName = exports.toolErrorEventName = exports.updateEventName = exports.partialUpdateEventName = exports.INSTRUMENTATION_IGNORED_KEYS = void 0;
|
|
19
|
+
exports.INSTRUMENTATION_IGNORED_KEYS = process.env
|
|
20
|
+
.BEE_FRAMEWORK_INSTRUMENTATION_IGNORED_KEYS
|
|
21
|
+
? process.env.BEE_FRAMEWORK_INSTRUMENTATION_IGNORED_KEYS.split(",").filter(Boolean)
|
|
22
|
+
: [];
|
|
23
|
+
exports.partialUpdateEventName = "partialUpdate";
|
|
24
|
+
exports.updateEventName = "update";
|
|
25
|
+
exports.toolErrorEventName = "toolError";
|
|
26
|
+
exports.toolStartEventName = "toolStart";
|
|
27
|
+
exports.toolSuccessEventName = "toolSuccess";
|
|
28
|
+
exports.startEventName = "start";
|
|
29
|
+
exports.successEventName = "success";
|
|
30
|
+
exports.errorEventName = "error";
|
|
31
|
+
exports.retryEventName = "retry";
|
|
32
|
+
exports.newTokenLLMEventName = `newToken`;
|
|
33
|
+
exports.successLLMEventName = `success`;
|
|
34
|
+
exports.startLLMEventName = `start`;
|
|
35
|
+
exports.errorLLMEventName = `error`;
|
|
36
|
+
exports.finishLLMEventName = `finish`;
|
|
37
|
+
exports.startToolEventName = "start";
|
|
38
|
+
exports.successToolEventName = "success";
|
|
39
|
+
exports.finishToolEventName = "finish";
|
|
40
|
+
exports.retryToolEventName = "retry";
|
|
41
|
+
exports.errorToolEventName = "error";
|
|
42
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAMU,QAAA,4BAA4B,GAAG,OAAO,CAAC,GAAG;KACpD,0CAA0C;IAC3C,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CACtE,OAAO,CACR;IACH,CAAC,CAAC,EAAE,CAAC;AAEM,QAAA,sBAAsB,GAAuB,eAAe,CAAC;AAC7D,QAAA,eAAe,GAAuB,QAAQ,CAAC;AAC/C,QAAA,kBAAkB,GAAuB,WAAW,CAAC;AACrD,QAAA,kBAAkB,GAAuB,WAAW,CAAC;AACrD,QAAA,oBAAoB,GAAuB,aAAa,CAAC;AACzD,QAAA,cAAc,GAAuB,OAAO,CAAC;AAC7C,QAAA,gBAAgB,GAAuB,SAAS,CAAC;AACjD,QAAA,cAAc,GAAuB,OAAO,CAAC;AAC7C,QAAA,cAAc,GAAuB,OAAO,CAAC;AAE7C,QAAA,oBAAoB,GAA0B,UAAU,CAAC;AACzD,QAAA,mBAAmB,GAA0B,SAAS,CAAC;AACvD,QAAA,iBAAiB,GAA0B,OAAO,CAAC;AACnD,QAAA,iBAAiB,GAA0B,OAAO,CAAC;AACnD,QAAA,kBAAkB,GAA0B,QAAQ,CAAC;AAErD,QAAA,kBAAkB,GAAqB,OAAO,CAAC;AAC/C,QAAA,oBAAoB,GAAqB,SAAS,CAAC;AACnD,QAAA,mBAAmB,GAAqB,QAAQ,CAAC;AACjD,QAAA,kBAAkB,GAAqB,OAAO,CAAC;AAC/C,QAAA,kBAAkB,GAAqB,OAAO,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OITracer } from "@arizeai/openinference-core";
|
|
2
|
+
import { FrameworkSpan, GeneratedResponse } from "../types";
|
|
3
|
+
import { TimeInput } from "@opentelemetry/api";
|
|
4
|
+
interface BuiltTraceTreeProps {
|
|
5
|
+
tracer: OITracer;
|
|
6
|
+
data: {
|
|
7
|
+
prompt?: string | null;
|
|
8
|
+
history: GeneratedResponse[] | undefined;
|
|
9
|
+
generatedMessage: GeneratedResponse | undefined;
|
|
10
|
+
spans: FrameworkSpan[];
|
|
11
|
+
traceId: string;
|
|
12
|
+
version: string;
|
|
13
|
+
runErrorSpanKey: string;
|
|
14
|
+
startTime: TimeInput;
|
|
15
|
+
endTime: TimeInput;
|
|
16
|
+
source: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare function buildTraceTree({ tracer, data }: BuiltTraceTreeProps): void;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=buildTraceTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildTraceTree.d.ts","sourceRoot":"","sources":["../../../src/helpers/buildTraceTree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAkB,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAM/D,UAAU,mBAAmB;IAC3B,MAAM,EAAE,QAAQ,CAAC;IACjB,IAAI,EAAE;QACJ,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,OAAO,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;QACzC,gBAAgB,EAAE,iBAAiB,GAAG,SAAS,CAAC;QAChD,KAAK,EAAE,aAAa,EAAE,CAAC;QACvB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,eAAe,EAAE,MAAM,CAAC;QACxB,SAAS,EAAE,SAAS,CAAC;QACrB,OAAO,EAAE,SAAS,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAoDD,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,mBAAmB,QA2CnE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildTraceTree = buildTraceTree;
|
|
4
|
+
const api_1 = require("@opentelemetry/api");
|
|
5
|
+
const openinference_semantic_conventions_1 = require("@arizeai/openinference-semantic-conventions");
|
|
6
|
+
function buildSpansForParent({ tracer, data }) {
|
|
7
|
+
data.spans
|
|
8
|
+
.filter((beeaiSpan) => beeaiSpan.parent_id === data.parentId)
|
|
9
|
+
.forEach((beeaiSpan) => {
|
|
10
|
+
tracer.startActiveSpan(beeaiSpan.context.span_id, {
|
|
11
|
+
// custom start time
|
|
12
|
+
startTime: beeaiSpan.start_time,
|
|
13
|
+
// set span important attributes
|
|
14
|
+
attributes: Object.assign(Object.assign({ target: beeaiSpan.attributes.target, name: beeaiSpan.name, traceId: data.traceId }, (beeaiSpan.attributes.metadata && {
|
|
15
|
+
metadata: JSON.stringify(beeaiSpan.attributes.metadata),
|
|
16
|
+
})), (beeaiSpan.attributes.data && Object.assign({}, beeaiSpan.attributes.data))),
|
|
17
|
+
}, (activeSpan) => {
|
|
18
|
+
// set status
|
|
19
|
+
activeSpan.setStatus(beeaiSpan.status);
|
|
20
|
+
// set nested spans
|
|
21
|
+
buildSpansForParent({
|
|
22
|
+
tracer,
|
|
23
|
+
data: {
|
|
24
|
+
spans: data.spans,
|
|
25
|
+
traceId: data.traceId,
|
|
26
|
+
parentId: beeaiSpan.context.span_id,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
// finish the span
|
|
30
|
+
activeSpan.end(beeaiSpan.end_time);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function buildTraceTree({ tracer, data }) {
|
|
35
|
+
tracer.startActiveSpan(`beeai-framework-main`, {
|
|
36
|
+
// custom start time
|
|
37
|
+
startTime: data.startTime,
|
|
38
|
+
// set main span important attributes
|
|
39
|
+
attributes: Object.assign(Object.assign(Object.assign({ source: data.source, traceId: data.traceId, [openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND]: openinference_semantic_conventions_1.OpenInferenceSpanKind.AGENT, ["beeai.version"]: data.version }, (data.prompt && { [openinference_semantic_conventions_1.SemanticConventions.INPUT_VALUE]: data.prompt })), (data.generatedMessage !== undefined && {
|
|
40
|
+
[openinference_semantic_conventions_1.SemanticConventions.OUTPUT_VALUE]: JSON.stringify(data.generatedMessage),
|
|
41
|
+
})), (data.history && { history: JSON.stringify(data.history) })),
|
|
42
|
+
}, (activeSpan) => {
|
|
43
|
+
// set status
|
|
44
|
+
const runErrorSpan = data.spans.find((span) => span.attributes.target === data.runErrorSpanKey);
|
|
45
|
+
if (runErrorSpan) {
|
|
46
|
+
activeSpan.setStatus(runErrorSpan.status);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
activeSpan.setStatus({ code: api_1.SpanStatusCode.OK });
|
|
50
|
+
}
|
|
51
|
+
// set nested spans
|
|
52
|
+
buildSpansForParent({
|
|
53
|
+
tracer,
|
|
54
|
+
data: { spans: data.spans, traceId: data.traceId, parentId: undefined },
|
|
55
|
+
});
|
|
56
|
+
// finish the main span with custom end time
|
|
57
|
+
activeSpan.end(data.endTime);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=buildTraceTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildTraceTree.js","sourceRoot":"","sources":["../../../src/helpers/buildTraceTree.ts"],"names":[],"mappings":";;AA0EA,wCA2CC;AAnHD,4CAA+D;AAC/D,oGAGqD;AA2BrD,SAAS,mBAAmB,CAAC,EAAE,MAAM,EAAE,IAAI,EAA4B;IACrE,IAAI,CAAC,KAAK;SACP,MAAM,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AAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 IBM Corp.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { TimeInput } from "@opentelemetry/api";
|
|
17
|
+
import { FrameworkSpan } from "../types";
|
|
18
|
+
interface CreateSpanProps {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
target: string;
|
|
22
|
+
startedAt: TimeInput;
|
|
23
|
+
ctx?: any;
|
|
24
|
+
data?: any;
|
|
25
|
+
error?: string;
|
|
26
|
+
parent?: {
|
|
27
|
+
id: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare function createSpan({ target, name, data, error, ctx, parent, id, startedAt, }: CreateSpanProps): FrameworkSpan;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=create-span.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-span.d.ts","sourceRoot":"","sources":["../../../src/helpers/create-span.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAkB,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,UAAU,eAAe;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IAErB,GAAG,CAAC,EAAE,GAAG,CAAC;IAEV,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACzB;AAED,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,GAAG,EACH,MAAM,EACN,EAAE,EACF,SAAS,GACV,EAAE,eAAe,GAAG,aAAa,CAuBjC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025 IBM Corp.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.createSpan = createSpan;
|
|
19
|
+
const api_1 = require("@opentelemetry/api");
|
|
20
|
+
const remeda_1 = require("remeda");
|
|
21
|
+
function createSpan({ target, name, data, error, ctx, parent, id, startedAt, }) {
|
|
22
|
+
return {
|
|
23
|
+
name: name,
|
|
24
|
+
attributes: Object.assign(Object.assign({ target, metadata: ctx && !(0, remeda_1.isEmpty)(ctx) ? Object.assign({}, ctx) : undefined }, (error && {
|
|
25
|
+
"exception.message": error,
|
|
26
|
+
"exception.type": "FrameworkError",
|
|
27
|
+
})), { data: data && !(0, remeda_1.isEmpty)(data) ? Object.assign({}, data) : null }),
|
|
28
|
+
context: {
|
|
29
|
+
span_id: id,
|
|
30
|
+
},
|
|
31
|
+
parent_id: parent === null || parent === void 0 ? void 0 : parent.id,
|
|
32
|
+
status: {
|
|
33
|
+
code: error ? api_1.SpanStatusCode.ERROR : api_1.SpanStatusCode.OK,
|
|
34
|
+
message: error ? error : "",
|
|
35
|
+
},
|
|
36
|
+
start_time: startedAt,
|
|
37
|
+
end_time: performance.now(),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=create-span.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-span.js","sourceRoot":"","sources":["../../../src/helpers/create-span.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAmBH,gCAgCC;AAjDD,4CAA+D;AAE/D,mCAAiC;AAejC,SAAgB,UAAU,CAAC,EACzB,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,GAAG,EACH,MAAM,EACN,EAAE,EACF,SAAS,GACO;IAChB,OAAO;QACL,IAAI,EAAE,IAAI;QACV,UAAU,gCACR,MAAM,EACN,QAAQ,EAAE,GAAG,IAAI,CAAC,IAAA,gBAAO,EAAC,GAAG,CAAC,CAAC,CAAC,mBAAM,GAAG,EAAG,CAAC,CAAC,SAAS,IACpD,CAAC,KAAK,IAAI;YACX,mBAAmB,EAAE,KAAK;YAC1B,gBAAgB,EAAE,gBAAgB;SACnC,CAAC,KACF,IAAI,EAAE,IAAI,IAAI,CAAC,IAAA,gBAAO,EAAC,IAAI,CAAC,CAAC,CAAC,mBAAM,IAAI,EAAG,CAAC,CAAC,IAAI,GAClD;QACD,OAAO,EAAE;YACP,OAAO,EAAE,EAAE;SACZ;QACD,SAAS,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE;QACrB,MAAM,EAAE;YACN,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,oBAAc,CAAC,KAAK,CAAC,CAAC,CAAC,oBAAc,CAAC,EAAE;YACtD,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;SAC5B;QACD,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,WAAW,CAAC,GAAG,EAAE;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 IBM Corp.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getErrorSafe(data: unknown): string | undefined;
|
|
17
|
+
//# sourceMappingURL=getErrorSafe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getErrorSafe.d.ts","sourceRoot":"","sources":["../../../src/helpers/getErrorSafe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAM9D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025 IBM Corp.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.getErrorSafe = getErrorSafe;
|
|
19
|
+
const errors_1 = require("beeai-framework/errors");
|
|
20
|
+
const object_1 = require("beeai-framework/internals/helpers/object");
|
|
21
|
+
function getErrorSafe(data) {
|
|
22
|
+
const error = (0, object_1.getProp)(data, ["error"], data);
|
|
23
|
+
if (error instanceof errors_1.FrameworkError) {
|
|
24
|
+
return errors_1.FrameworkError.ensure(error).explain();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=getErrorSafe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getErrorSafe.js","sourceRoot":"","sources":["../../../src/helpers/getErrorSafe.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAKH,oCAMC;AATD,mDAAwD;AACxD,qEAAmE;AAEnE,SAAgB,YAAY,CAAC,IAAa;IACxC,MAAM,KAAK,GAAG,IAAA,gBAAO,EAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;IAE7C,IAAI,KAAK,YAAY,uBAAc,EAAE,CAAC;QACpC,OAAO,uBAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;IAChD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 IBM Corp.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { EventMeta } from "beeai-framework/emitter/types";
|
|
17
|
+
export declare function getSerializedObjectSafe(dataObject: unknown, meta: EventMeta<unknown>): any;
|
|
18
|
+
//# sourceMappingURL=getSerializedObjectSafe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSerializedObjectSafe.d.ts","sourceRoot":"","sources":["../../../src/helpers/getSerializedObjectSafe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EAAE,SAAS,EAAsB,MAAM,+BAA+B,CAAC;AAwE9E,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,OAuOzB"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025 IBM Corp.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.getSerializedObjectSafe = getSerializedObjectSafe;
|
|
19
|
+
const serializable_1 = require("beeai-framework/internals/serializable");
|
|
20
|
+
const logger_1 = require("beeai-framework/instrumentation/logger");
|
|
21
|
+
const object_1 = require("beeai-framework/internals/helpers/object");
|
|
22
|
+
const chat_1 = require("beeai-framework/backend/chat");
|
|
23
|
+
const base_1 = require("beeai-framework/agents/base");
|
|
24
|
+
const config_1 = require("../config");
|
|
25
|
+
const openinference_semantic_conventions_1 = require("@arizeai/openinference-semantic-conventions");
|
|
26
|
+
const base_2 = require("beeai-framework/tools/base");
|
|
27
|
+
function parserLLMInputMessages(messages) {
|
|
28
|
+
return messages.reduce((acc, item, key) => (Object.assign(Object.assign({}, acc), { [`${openinference_semantic_conventions_1.SemanticAttributePrefixes.llm}.${openinference_semantic_conventions_1.LLMAttributePostfixes.input_messages}.${key}.${openinference_semantic_conventions_1.SemanticAttributePrefixes.message}.${openinference_semantic_conventions_1.MessageAttributePostfixes.role}`]: item.role, [`${openinference_semantic_conventions_1.SemanticAttributePrefixes.llm}.${openinference_semantic_conventions_1.LLMAttributePostfixes.input_messages}.${key}.${openinference_semantic_conventions_1.SemanticAttributePrefixes.message}.${openinference_semantic_conventions_1.MessageAttributePostfixes.content}`]: item.content
|
|
29
|
+
.filter((c) => c.type === "text")
|
|
30
|
+
.map((c) => c.text)
|
|
31
|
+
.join("") })), {});
|
|
32
|
+
}
|
|
33
|
+
function parseLLMOutputMessages(messages) {
|
|
34
|
+
return messages.reduce((acc, item, key) => (Object.assign(Object.assign({}, acc), { [`${openinference_semantic_conventions_1.SemanticAttributePrefixes.llm}.${openinference_semantic_conventions_1.LLMAttributePostfixes.output_messages}.${key}.${openinference_semantic_conventions_1.SemanticAttributePrefixes.message}.${openinference_semantic_conventions_1.MessageAttributePostfixes.role}`]: item.role, [`${openinference_semantic_conventions_1.SemanticAttributePrefixes.llm}.${openinference_semantic_conventions_1.LLMAttributePostfixes.output_messages}.${key}.${openinference_semantic_conventions_1.SemanticAttributePrefixes.message}.${openinference_semantic_conventions_1.MessageAttributePostfixes.content}`]: item.content
|
|
35
|
+
.filter((c) => c.type === "text")
|
|
36
|
+
.map((c) => c.text)
|
|
37
|
+
.join("") })), {});
|
|
38
|
+
}
|
|
39
|
+
function getSerializedObjectSafe(dataObject, meta) {
|
|
40
|
+
var _a, _b, _c, _d, _e, _f;
|
|
41
|
+
// agent events
|
|
42
|
+
if ([config_1.startEventName, config_1.successEventName, config_1.errorEventName, config_1.retryEventName].includes(meta.name) &&
|
|
43
|
+
meta.creator instanceof base_1.BaseAgent) {
|
|
44
|
+
const { meta, tools, memory, error, data } = dataObject;
|
|
45
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({ [openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND]: openinference_semantic_conventions_1.OpenInferenceSpanKind.AGENT, iteration: meta.iteration }, ((tools === null || tools === void 0 ? void 0 : tools.length) > 0 && {
|
|
46
|
+
[openinference_semantic_conventions_1.SemanticConventions.LLM_TOOLS]: tools.map((tool) => ({
|
|
47
|
+
[openinference_semantic_conventions_1.SemanticConventions.TOOL_NAME]: tool.name,
|
|
48
|
+
[openinference_semantic_conventions_1.SemanticConventions.TOOL_DESCRIPTION]: tool.description,
|
|
49
|
+
"tool.options": tool.options,
|
|
50
|
+
})),
|
|
51
|
+
})), (memory.messages.length > 0 && {
|
|
52
|
+
[openinference_semantic_conventions_1.SemanticConventions.INPUT_MIME_TYPE]: openinference_semantic_conventions_1.MimeType.JSON,
|
|
53
|
+
[openinference_semantic_conventions_1.SemanticConventions.INPUT_VALUE]: JSON.stringify(memory.messages),
|
|
54
|
+
})), (error && {
|
|
55
|
+
"exception.message": error.message,
|
|
56
|
+
"exception.stacktrace": error.stack,
|
|
57
|
+
"exception.type": error.name,
|
|
58
|
+
})), (data && {
|
|
59
|
+
[openinference_semantic_conventions_1.SemanticConventions.OUTPUT_MIME_TYPE]: openinference_semantic_conventions_1.MimeType.JSON,
|
|
60
|
+
[openinference_semantic_conventions_1.SemanticConventions.OUTPUT_VALUE]: JSON.stringify(data),
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
// update events
|
|
64
|
+
if ([config_1.updateEventName, config_1.partialUpdateEventName].includes(meta.name)) {
|
|
65
|
+
const { data } = dataObject;
|
|
66
|
+
const output = data.final_answer || data.tool_output;
|
|
67
|
+
return Object.assign(Object.assign(Object.assign({ [openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND]: openinference_semantic_conventions_1.OpenInferenceSpanKind.AGENT, thought: data.thought }, (data.tool_name && {
|
|
68
|
+
[openinference_semantic_conventions_1.SemanticConventions.TOOL_NAME]: data.tool_name,
|
|
69
|
+
})), (data.tool_input && {
|
|
70
|
+
[openinference_semantic_conventions_1.SemanticConventions.TOOL_PARAMETERS]: JSON.stringify(data.tool_input),
|
|
71
|
+
})), (output && {
|
|
72
|
+
[openinference_semantic_conventions_1.SemanticConventions.OUTPUT_MIME_TYPE]: openinference_semantic_conventions_1.MimeType.JSON,
|
|
73
|
+
[openinference_semantic_conventions_1.SemanticConventions.OUTPUT_VALUE]: output,
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
// tool events (from agent)
|
|
77
|
+
if ([config_1.toolErrorEventName, config_1.toolStartEventName, config_1.toolSuccessEventName].includes(meta.name)) {
|
|
78
|
+
const { data } = dataObject;
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
80
|
+
const output = data.result && data.result.createSnapshot();
|
|
81
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ [openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND]: openinference_semantic_conventions_1.OpenInferenceSpanKind.TOOL, thought: data.iteration.thought }, (data.input
|
|
82
|
+
? { [openinference_semantic_conventions_1.SemanticConventions.TOOL_PARAMETERS]: JSON.stringify(data.input) }
|
|
83
|
+
: {})), (data.tool.description && {
|
|
84
|
+
[openinference_semantic_conventions_1.SemanticConventions.TOOL_DESCRIPTION]: data.tool.description,
|
|
85
|
+
})), (data.tool.name && {
|
|
86
|
+
[openinference_semantic_conventions_1.SemanticConventions.TOOL_NAME]: data.tool.name,
|
|
87
|
+
})), (data.error && {
|
|
88
|
+
"exception.message": data.error.message,
|
|
89
|
+
"exception.stacktrace": data.error.stack,
|
|
90
|
+
"exception.type": data.error.name,
|
|
91
|
+
})), (output && {
|
|
92
|
+
[openinference_semantic_conventions_1.SemanticConventions.OUTPUT_VALUE]: JSON.stringify(output),
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
// tool events native
|
|
96
|
+
if ([
|
|
97
|
+
config_1.startToolEventName,
|
|
98
|
+
config_1.successToolEventName,
|
|
99
|
+
config_1.finishToolEventName,
|
|
100
|
+
config_1.errorToolEventName,
|
|
101
|
+
config_1.retryToolEventName,
|
|
102
|
+
].includes(meta.name) &&
|
|
103
|
+
meta.creator instanceof base_2.Tool) {
|
|
104
|
+
if (!dataObject) {
|
|
105
|
+
return {
|
|
106
|
+
[openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND]: openinference_semantic_conventions_1.OpenInferenceSpanKind.TOOL,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
const { input, output, error } = dataObject;
|
|
110
|
+
return Object.assign(Object.assign(Object.assign({ [openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND]: openinference_semantic_conventions_1.OpenInferenceSpanKind.TOOL }, (input
|
|
111
|
+
? { [openinference_semantic_conventions_1.SemanticConventions.TOOL_PARAMETERS]: JSON.stringify(input) }
|
|
112
|
+
: {})), (output && {
|
|
113
|
+
[openinference_semantic_conventions_1.SemanticConventions.OUTPUT_VALUE]: JSON.stringify(output),
|
|
114
|
+
})), (error && {
|
|
115
|
+
"exception.message": error.message,
|
|
116
|
+
"exception.stacktrace": error.stack,
|
|
117
|
+
"exception.type": error.name,
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
// llm events
|
|
121
|
+
if ([
|
|
122
|
+
config_1.successLLMEventName,
|
|
123
|
+
config_1.startLLMEventName,
|
|
124
|
+
config_1.errorLLMEventName,
|
|
125
|
+
config_1.newTokenLLMEventName,
|
|
126
|
+
].includes(meta.name) &&
|
|
127
|
+
meta.creator instanceof chat_1.ChatModel) {
|
|
128
|
+
const { value, input, error } = dataObject;
|
|
129
|
+
const creator = meta.creator.createSnapshot();
|
|
130
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ [openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND]: openinference_semantic_conventions_1.OpenInferenceSpanKind.LLM }, (((_a = value === null || value === void 0 ? void 0 : value.usage) === null || _a === void 0 ? void 0 : _a.completionTokens) && {
|
|
131
|
+
[openinference_semantic_conventions_1.SemanticConventions.LLM_TOKEN_COUNT_COMPLETION]: (_b = value === null || value === void 0 ? void 0 : value.usage) === null || _b === void 0 ? void 0 : _b.completionTokens,
|
|
132
|
+
})), (((_c = value === null || value === void 0 ? void 0 : value.usage) === null || _c === void 0 ? void 0 : _c.promptTokens) && {
|
|
133
|
+
[openinference_semantic_conventions_1.SemanticConventions.LLM_TOKEN_COUNT_PROMPT]: (_d = value === null || value === void 0 ? void 0 : value.usage) === null || _d === void 0 ? void 0 : _d.promptTokens,
|
|
134
|
+
})), (((_e = value === null || value === void 0 ? void 0 : value.usage) === null || _e === void 0 ? void 0 : _e.totalTokens) && {
|
|
135
|
+
[openinference_semantic_conventions_1.SemanticConventions.LLM_TOKEN_COUNT_TOTAL]: (_f = value === null || value === void 0 ? void 0 : value.usage) === null || _f === void 0 ? void 0 : _f.totalTokens,
|
|
136
|
+
})), ((input === null || input === void 0 ? void 0 : input.messages.length) > 0 && Object.assign({ [openinference_semantic_conventions_1.SemanticConventions.INPUT_MIME_TYPE]: openinference_semantic_conventions_1.MimeType.JSON, [openinference_semantic_conventions_1.SemanticConventions.INPUT_VALUE]: JSON.stringify(input.messages) }, parserLLMInputMessages(input.messages)))), ((value === null || value === void 0 ? void 0 : value.messages.length) > 0 && Object.assign({ [openinference_semantic_conventions_1.SemanticConventions.OUTPUT_MIME_TYPE]: openinference_semantic_conventions_1.MimeType.JSON, [openinference_semantic_conventions_1.SemanticConventions.OUTPUT_VALUE]: JSON.stringify(value.messages) }, parseLLMOutputMessages(value.messages)))), (error && {
|
|
137
|
+
"exception.message": error.message,
|
|
138
|
+
"exception.stacktrace": error.stack,
|
|
139
|
+
"exception.type": error.name,
|
|
140
|
+
})), ("providerId" in creator && {
|
|
141
|
+
[openinference_semantic_conventions_1.SemanticConventions.LLM_PROVIDER]: creator.providerId,
|
|
142
|
+
[`${openinference_semantic_conventions_1.SemanticAttributePrefixes.metadata}.${openinference_semantic_conventions_1.LLMAttributePostfixes.provider}`]: creator.providerId,
|
|
143
|
+
})), ("modelId" in creator && {
|
|
144
|
+
[openinference_semantic_conventions_1.SemanticConventions.LLM_MODEL_NAME]: creator.modelId,
|
|
145
|
+
[`${openinference_semantic_conventions_1.SemanticAttributePrefixes.metadata}.${openinference_semantic_conventions_1.LLMAttributePostfixes.model_name}`]: creator.modelId,
|
|
146
|
+
})), (creator.parameters && {
|
|
147
|
+
[openinference_semantic_conventions_1.SemanticConventions.LLM_INVOCATION_PARAMETERS]: JSON.stringify(creator.parameters),
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
if (meta.name === config_1.finishLLMEventName && meta.creator instanceof chat_1.ChatModel) {
|
|
151
|
+
return {
|
|
152
|
+
[openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND]: openinference_semantic_conventions_1.OpenInferenceSpanKind.LLM,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
// other events
|
|
156
|
+
const data = (0, object_1.getProp)(dataObject, ["data"], dataObject);
|
|
157
|
+
if (data instanceof serializable_1.Serializable) {
|
|
158
|
+
try {
|
|
159
|
+
return { data: JSON.stringify(data.createSnapshot()), test: "hallo" };
|
|
160
|
+
}
|
|
161
|
+
catch (e) {
|
|
162
|
+
logger_1.instrumentationLogger.warn(e, "Invalid createSnapshot method in the Serializable class");
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return { data: JSON.stringify(data) };
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=getSerializedObjectSafe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSerializedObjectSafe.js","sourceRoot":"","sources":["../../../src/helpers/getSerializedObjectSafe.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AA6EH,0DAyOC;AApTD,yEAAsE;AACtE,mEAA+E;AAC/E,qEAAmE;AAGnE,uDAA0E;AAC1E,sDAAwD;AAExD,sCAoBmB;AACnB,oGAOqD;AACrD,qDAA8D;AAE9D,SAAS,sBAAsB,CAC7B,QAAwD;IAExD,OAAO,QAAQ,CAAC,MAAM,CACpB,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,iCACf,GAAG,KACN,CAAC,GAAG,8DAAyB,CAAC,GAAG,IAAI,0DAAqB,CAAC,cAAc,IAAI,GAAG,IAAI,8DAAyB,CAAC,OAAO,IAAI,8DAAyB,CAAC,IAAI,EAAE,CAAC,EACxJ,IAAI,CAAC,IAAI,EACX,CAAC,GAAG,8DAAyB,CAAC,GAAG,IAAI,0DAAqB,CAAC,cAAc,IAAI,GAAG,IAAI,8DAAyB,CAAC,OAAO,IAAI,8DAAyB,CAAC,OAAO,EAAE,CAAC,EAC3J,IAAI,CAAC,OAAO;aACT,MAAM,C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C,CAAC,OAAO,CAAC,UAAU,IAAI;YACxB,CAAC,wDAAmB,CAAC,yBAAyB,CAAC,EAAE,IAAI,CAAC,SAAS,CAC7D,OAAO,CAAC,UAAU,CACnB;SACF,CAAC,EACF;IACJ,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,2BAAkB,IAAI,IAAI,CAAC,OAAO,YAAY,gBAAS,EAAE,CAAC;QAC1E,OAAO;YACL,CAAC,wDAAmB,CAAC,uBAAuB,CAAC,EAAE,0DAAqB,CAAC,GAAG;SACzE,CAAC;IACJ,CAAC;IAED,eAAe;IACf,MAAM,IAAI,GAAG,IAAA,gBAAO,EAAC,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;IACvD,IAAI,IAAI,YAAY,2BAAY,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QACxE,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,8BAAqB,CAAC,IAAI,CACxB,CAAC,EACD,yDAAyD,CAC1D,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 IBM Corp.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
interface GetIdsProps {
|
|
17
|
+
path: string;
|
|
18
|
+
id: string;
|
|
19
|
+
runId: string;
|
|
20
|
+
parentRunId?: string;
|
|
21
|
+
groupId?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class IdNameManager {
|
|
24
|
+
#private;
|
|
25
|
+
getIds({ path, id, runId, parentRunId, groupId }: GetIdsProps): {
|
|
26
|
+
spanId: string;
|
|
27
|
+
parentSpanId: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=idNameManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idNameManager.d.ts","sourceRoot":"","sources":["../../../src/helpers/idNameManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,aAAa;;IAcxB,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,WAAW;;;;CAc9D"}
|