@arizeai/openinference-instrumentation-openai 0.0.1-rc9 → 0.0.3
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/README.md +30 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/instrumentation.d.ts +19 -7
- package/dist/esm/instrumentation.d.ts.map +1 -1
- package/dist/esm/instrumentation.js +77 -9
- package/dist/esm/instrumentation.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/version.d.ts +2 -2
- package/dist/esm/version.d.ts.map +1 -1
- package/dist/esm/version.js +2 -2
- package/dist/esm/version.js.map +1 -1
- package/dist/esnext/index.d.ts +1 -1
- package/dist/esnext/index.js +1 -1
- package/dist/esnext/instrumentation.d.ts +19 -7
- package/dist/esnext/instrumentation.d.ts.map +1 -1
- package/dist/esnext/instrumentation.js +75 -9
- package/dist/esnext/instrumentation.js.map +1 -1
- package/dist/esnext/tsconfig.esnext.tsbuildinfo +1 -1
- package/dist/esnext/version.d.ts +2 -2
- package/dist/esnext/version.d.ts.map +1 -1
- package/dist/esnext/version.js +2 -2
- package/dist/esnext/version.js.map +1 -1
- package/dist/src/instrumentation.d.ts +6 -0
- package/dist/src/instrumentation.d.ts.map +1 -1
- package/dist/src/instrumentation.js +73 -7
- package/dist/src/instrumentation.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/test/openai.test.js +55 -10
- package/dist/test/openai.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/src/instrumentation.ts +183 -102
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
1
|
# OpenInference Instrumentation for OpenAI Node.js SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/js/@arizeai%2Fopeninference-instrumentation-openai)
|
|
4
|
+
|
|
5
|
+
This module provides automatic instrumentation for the [OpenAI Node.js SDK](https://github.com/openai/openai-node). which may be used in conjunction with [@opentelemetry/sdk-trace-node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
npm install --save @arizeai/openinference-instrumentation-openai
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
To load the OpenAI instrumentation, specify it in the registerInstrumentations call along with any additional instrumentation you wish to enable.
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
|
|
19
|
+
const {
|
|
20
|
+
OpenAIInstrumentation,
|
|
21
|
+
} = require("@arizeai/openinference-instrumentation-openai");
|
|
22
|
+
const { registerInstrumentations } = require("@opentelemetry/instrumentation");
|
|
23
|
+
|
|
24
|
+
const provider = new NodeTracerProvider();
|
|
25
|
+
provider.register();
|
|
26
|
+
|
|
27
|
+
registerInstrumentations({
|
|
28
|
+
instrumentations: [new OpenAIInstrumentation()],
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For more information on OpenTelemetry Node.js SDK, see the [OpenTelemetry Node.js SDK documentation](https://opentelemetry.io/docs/instrumentation/js/getting-started/nodejs/).
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./instrumentation";
|
|
2
|
-
//# sourceMappingURL=index.d.ts.map
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./instrumentation";
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import * as openai from "openai";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import {
|
|
3
|
+
InstrumentationBase,
|
|
4
|
+
InstrumentationConfig,
|
|
5
|
+
InstrumentationModuleDefinition,
|
|
6
|
+
} from "@opentelemetry/instrumentation";
|
|
7
|
+
export declare class OpenAIInstrumentation extends InstrumentationBase<
|
|
8
|
+
typeof openai
|
|
9
|
+
> {
|
|
10
|
+
constructor(config?: InstrumentationConfig);
|
|
11
|
+
protected init(): InstrumentationModuleDefinition<typeof openai>;
|
|
12
|
+
/**
|
|
13
|
+
* Patches the OpenAI module
|
|
14
|
+
*/
|
|
15
|
+
private patch;
|
|
16
|
+
/**
|
|
17
|
+
* Un-patches the OpenAI module's chat completions API
|
|
18
|
+
*/
|
|
19
|
+
private unpatch;
|
|
8
20
|
}
|
|
9
|
-
//# sourceMappingURL=instrumentation.d.ts.map
|
|
21
|
+
//# sourceMappingURL=instrumentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,+BAA+B,EAGhC,MAAM,gCAAgC,CAAC;AAwBxC,qBAAa,qBAAsB,SAAQ,mBAAmB,CAAC,OAAO,MAAM,CAAC;gBAC/D,MAAM,CAAC,EAAE,qBAAqB;IAQ1C,SAAS,CAAC,IAAI,IAAI,+BAA+B,CAAC,OAAO,MAAM,CAAC;IAShE;;OAEG;IACH,OAAO,CAAC,KAAK;IAgFb;;OAEG;IACH,OAAO,CAAC,OAAO;CAIhB"}
|
|
@@ -24,10 +24,21 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
24
|
};
|
|
25
25
|
return __assign.apply(this, arguments);
|
|
26
26
|
};
|
|
27
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
28
|
+
var t = {};
|
|
29
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
30
|
+
t[p] = s[p];
|
|
31
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
32
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
34
|
+
t[p[i]] = s[p[i]];
|
|
35
|
+
}
|
|
36
|
+
return t;
|
|
37
|
+
};
|
|
27
38
|
import { InstrumentationBase, InstrumentationNodeModuleDefinition, safeExecuteInTheMiddle, } from "@opentelemetry/instrumentation";
|
|
28
|
-
import { diag, context, trace, SpanKind, } from "@opentelemetry/api";
|
|
39
|
+
import { diag, context, trace, SpanKind, SpanStatusCode, } from "@opentelemetry/api";
|
|
29
40
|
import { VERSION } from "./version";
|
|
30
|
-
import { SemanticConventions, OpenInferenceSpanKind, } from "@arizeai/openinference-semantic-conventions";
|
|
41
|
+
import { SemanticConventions, OpenInferenceSpanKind, MimeType, } from "@arizeai/openinference-semantic-conventions";
|
|
31
42
|
var MODULE_NAME = "openai";
|
|
32
43
|
var OpenAIInstrumentation = /** @class */ (function (_super) {
|
|
33
44
|
__extends(OpenAIInstrumentation, _super);
|
|
@@ -38,14 +49,20 @@ var OpenAIInstrumentation = /** @class */ (function (_super) {
|
|
|
38
49
|
var module = new InstrumentationNodeModuleDefinition("openai", ["^4.0.0"], this.patch.bind(this), this.unpatch.bind(this));
|
|
39
50
|
return module;
|
|
40
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* Patches the OpenAI module
|
|
54
|
+
*/
|
|
41
55
|
OpenAIInstrumentation.prototype.patch = function (module, moduleVersion) {
|
|
42
|
-
|
|
43
|
-
var plugin = this;
|
|
56
|
+
diag.debug("Applying patch for ".concat(MODULE_NAME, "@").concat(moduleVersion));
|
|
44
57
|
if (module === null || module === void 0 ? void 0 : module.openInferencePatched) {
|
|
45
58
|
return module;
|
|
46
59
|
}
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
47
61
|
var instrumentation = this;
|
|
48
|
-
|
|
62
|
+
// Patch create chat completions
|
|
63
|
+
this._wrap(module.OpenAI.Chat.Completions.prototype, "create",
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
65
|
+
function (original) {
|
|
49
66
|
return function patchedCreate() {
|
|
50
67
|
var _a;
|
|
51
68
|
var _this = this;
|
|
@@ -54,9 +71,10 @@ var OpenAIInstrumentation = /** @class */ (function (_super) {
|
|
|
54
71
|
args[_i] = arguments[_i];
|
|
55
72
|
}
|
|
56
73
|
var body = args[0];
|
|
74
|
+
var _messages = body.messages, invocationParameters = __rest(body, ["messages"]);
|
|
57
75
|
var span = instrumentation.tracer.startSpan("OpenAI Chat Completions", {
|
|
58
76
|
kind: SpanKind.CLIENT,
|
|
59
|
-
attributes: __assign((_a = {}, _a[SemanticConventions.OPENINFERENCE_SPAN_KIND] = OpenInferenceSpanKind.LLM, _a), getLLMInputMessagesAttributes(body)),
|
|
77
|
+
attributes: __assign((_a = {}, _a[SemanticConventions.OPENINFERENCE_SPAN_KIND] = OpenInferenceSpanKind.LLM, _a[SemanticConventions.LLM_MODEL_NAME] = body.model, _a[SemanticConventions.INPUT_VALUE] = JSON.stringify(body), _a[SemanticConventions.INPUT_MIME_TYPE] = MimeType.JSON, _a[SemanticConventions.LLM_INVOCATION_PARAMETERS] = JSON.stringify(invocationParameters), _a), getLLMInputMessagesAttributes(body)),
|
|
60
78
|
});
|
|
61
79
|
var execContext = trace.setSpan(context.active(), span);
|
|
62
80
|
var execPromise = safeExecuteInTheMiddle(function () {
|
|
@@ -64,10 +82,18 @@ var OpenAIInstrumentation = /** @class */ (function (_super) {
|
|
|
64
82
|
return original.apply(_this, args);
|
|
65
83
|
});
|
|
66
84
|
}, function (error) {
|
|
67
|
-
//
|
|
85
|
+
// Push the error to the span
|
|
86
|
+
if (error) {
|
|
87
|
+
span.recordException(error);
|
|
88
|
+
}
|
|
68
89
|
});
|
|
69
90
|
var wrappedPromise = execPromise.then(function (result) {
|
|
70
|
-
|
|
91
|
+
var _a;
|
|
92
|
+
if (result) {
|
|
93
|
+
// Record the results
|
|
94
|
+
span.setAttributes(__assign(__assign((_a = {}, _a[SemanticConventions.OUTPUT_VALUE] = JSON.stringify(result), _a[SemanticConventions.OUTPUT_MIME_TYPE] = MimeType.JSON, _a), getLLMOutputMessagesAttributes(result)), getUsageAttributes(result)));
|
|
95
|
+
}
|
|
96
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
71
97
|
span.end();
|
|
72
98
|
return result;
|
|
73
99
|
});
|
|
@@ -77,14 +103,18 @@ var OpenAIInstrumentation = /** @class */ (function (_super) {
|
|
|
77
103
|
module.openInferencePatched = true;
|
|
78
104
|
return module;
|
|
79
105
|
};
|
|
106
|
+
/**
|
|
107
|
+
* Un-patches the OpenAI module's chat completions API
|
|
108
|
+
*/
|
|
80
109
|
OpenAIInstrumentation.prototype.unpatch = function (moduleExports, moduleVersion) {
|
|
81
110
|
diag.debug("Removing patch for ".concat(MODULE_NAME, "@").concat(moduleVersion));
|
|
111
|
+
this._unwrap(moduleExports.OpenAI.Chat.Completions.prototype, "create");
|
|
82
112
|
};
|
|
83
113
|
return OpenAIInstrumentation;
|
|
84
114
|
}(InstrumentationBase));
|
|
85
115
|
export { OpenAIInstrumentation };
|
|
86
116
|
/**
|
|
87
|
-
* Converts the body input
|
|
117
|
+
* Converts the body of the request to LLM input messages
|
|
88
118
|
*/
|
|
89
119
|
function getLLMInputMessagesAttributes(body) {
|
|
90
120
|
return body.messages.reduce(function (acc, message, index) {
|
|
@@ -94,4 +124,42 @@ function getLLMInputMessagesAttributes(body) {
|
|
|
94
124
|
return acc;
|
|
95
125
|
}, {});
|
|
96
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Get Usage attributes
|
|
129
|
+
*/
|
|
130
|
+
function getUsageAttributes(response) {
|
|
131
|
+
var _a;
|
|
132
|
+
if (Object.prototype.hasOwnProperty.call(response, "usage")) {
|
|
133
|
+
var completion = response;
|
|
134
|
+
if (completion.usage) {
|
|
135
|
+
return _a = {},
|
|
136
|
+
_a[SemanticConventions.LLM_TOKEN_COUNT_COMPLETION] = completion.usage.completion_tokens,
|
|
137
|
+
_a[SemanticConventions.LLM_TOKEN_COUNT_PROMPT] = completion.usage.prompt_tokens,
|
|
138
|
+
_a[SemanticConventions.LLM_TOKEN_COUNT_TOTAL] = completion.usage.total_tokens,
|
|
139
|
+
_a;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return {};
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Converts the result to LLM output attributes
|
|
146
|
+
*/
|
|
147
|
+
function getLLMOutputMessagesAttributes(response) {
|
|
148
|
+
// Handle chat completion
|
|
149
|
+
if (Object.prototype.hasOwnProperty.call(response, "choices")) {
|
|
150
|
+
var completion = response;
|
|
151
|
+
// Right now support just the first choice
|
|
152
|
+
var choice = completion.choices[0];
|
|
153
|
+
if (!choice) {
|
|
154
|
+
return {};
|
|
155
|
+
}
|
|
156
|
+
return [choice.message].reduce(function (acc, message, index) {
|
|
157
|
+
var index_prefix = "".concat(SemanticConventions.LLM_OUTPUT_MESSAGES, ".").concat(index);
|
|
158
|
+
acc["".concat(index_prefix, ".").concat(SemanticConventions.MESSAGE_CONTENT)] = String(message.content);
|
|
159
|
+
acc["".concat(index_prefix, ".").concat(SemanticConventions.MESSAGE_ROLE)] = message.role;
|
|
160
|
+
return acc;
|
|
161
|
+
}, {});
|
|
162
|
+
}
|
|
163
|
+
return {};
|
|
164
|
+
}
|
|
97
165
|
//# sourceMappingURL=instrumentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EACL,mBAAmB,EAGnB,mCAAmC,EACnC,sBAAsB,GACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,IAAI,EACJ,OAAO,EACP,KAAK,EACL,QAAQ,EAER,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,QAAQ,GACT,MAAM,6CAA6C,CAAC;AAQrD,IAAM,WAAW,GAAG,QAAQ,CAAC;AAE7B;IAA2C,yCAAkC;IAC3E,+BAAY,MAA8B;QACxC,OAAA,MAAK,YACH,+CAA+C,EAC/C,OAAO,EACP,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAC1B,SAAC;IACJ,CAAC;IAES,oCAAI,GAAd;QACE,IAAM,MAAM,GAAG,IAAI,mCAAmC,CACpD,QAAQ,EACR,CAAC,QAAQ,CAAC,EACV,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EACrB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CACxB,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IACD;;OAEG;IACK,qCAAK,GAAb,UACE,MAA0D,EAC1D,aAAsB;QAEtB,IAAI,CAAC,KAAK,CAAC,6BAAsB,WAAW,cAAI,aAAa,CAAE,CAAC,CAAC;QACjE,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,oBAAoB,EAAE,CAAC;YACjC,O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