@arizeai/openinference-instrumentation-openai
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

OpenInference Instrumentation for OpenAI Node.js SDK

npm version

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()],
});

For more information on OpenTelemetry Node.js SDK, see the OpenTelemetry Node.js SDK documentation.

Readme

Keywords

none

Package Sidebar

Install

npm i @arizeai/openinference-instrumentation-openai

Weekly Downloads

648

Version

1.0.0

License

Apache-2.0

Unpacked Size

482 kB

Total Files

61

Last publish

Collaborators

  • jackyxcs
  • nickleach22
  • parker-stafford
  • mikeldking
  • eunicode
  • koonal