@arizeai/openinference-instrumentation-openai v2.3.0
OpenInference Instrumentation for OpenAI Node.js SDK
This module provides automatic instrumentation for the OpenAI Node.js SDK. which may be used in conjunction with @opentelemetry/sdk-trace-node.
Installation
npm install --save @arizeai/openinference-instrumentation-openai
Usage
To load the OpenAI instrumentation, specify it in the registerInstrumentations call along with any additional instrumentation you wish to enable.
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const {
OpenAIInstrumentation,
} = require("@arizeai/openinference-instrumentation-openai");
const { registerInstrumentations } = require("@opentelemetry/instrumentation");
const provider = new NodeTracerProvider();
provider.register();
registerInstrumentations({
instrumentations: [new OpenAIInstrumentation()],
});
Examples
To run an example, run the following commands:
cd js/packages/openinference-instrumentation-openai
pnpm install
pnpm -r build
npx -y tsx examples/chat.ts # or responses.ts, embed.ts, etc
For more information on OpenTelemetry Node.js SDK, see the OpenTelemetry Node.js SDK documentation.
11 months ago
11 months ago
11 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
10 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago